IntelligenceX

API Reference

Class

ChatGptUsageCache

Namespace IntelligenceX.OpenAI.Usage
Assembly IntelligenceX
Modifiers static

Helpers for reading and writing the local usage cache.

Inheritance

  • Object
  • ChatGptUsageCache

Methods

ResolveCachePath 2 overloads
public static String ResolveCachePath() #
Returns: String

Resolves the default cache path, honoring INTELLIGENCEX_USAGE_PATH when present.

public static String ResolveCachePath(String accountId) #
Returns: String

Resolves the usage cache path for a specific account id.

Parameters

accountId System.String requiredposition: 0
Optional ChatGPT account id.
public static Void Save(ChatGptUsageSnapshot snapshot, String path = null) #
Returns: Void

Saves a usage snapshot to the cache.

Parameters

snapshot IntelligenceX.OpenAI.Usage.ChatGptUsageSnapshot requiredposition: 0
Snapshot to persist.
path System.String = null optionalposition: 1
Optional override path.
public static Boolean TryLoad(out ChatGptUsageCacheEntry entry, String path = null) #
Returns: Boolean

Attempts to load a cached usage snapshot.

Parameters

entry IntelligenceX.OpenAI.Usage.ChatGptUsageCacheEntry@ requiredposition: 0
The cache entry when found.
path System.String = null optionalposition: 1
Optional override path.

Returns

true when a cache entry was loaded.