UNPKG

@convo-lang/convo-lang

Version:
22 lines (21 loc) 1.12 kB
import { ConvoHashCacheBase } from "./ConvoHashCacheBase"; import { ConvoLocalStorageCacheOptions } from "./ConvoLocalStorageCache"; import { ConvoVfsCacheOptions } from "./ConvoVfsCache"; import { ConvoCompletionMessage } from "./convo-types"; export interface ConvoUserVfsCacheOptions { vfsOptions?: ConvoVfsCacheOptions; localStorageOptions?: ConvoLocalStorageCacheOptions; } /** * Uses a combination of local storage and the virtual file system to cache. Read attempts will * first try the vfs then fallback to local storage. Writing to the vfs will only occur if a user * is signed in. This cache type is good for applications that want user to be able to always read * from the vfs cache but don't want unauthorized user to write to the cache. */ export declare class ConvoUserVfsCache extends ConvoHashCacheBase { private localStorageCache; private vfsCache; constructor(options?: ConvoUserVfsCacheOptions); getMessagesByKey(key: string): Promise<ConvoCompletionMessage[] | null | undefined>; cacheMessagesByKey(key: string, messages: ConvoCompletionMessage[]): Promise<void>; }