import { AzureDocumentDBConfig } from "../azure_documentdb.cjs"; import { EmbeddingsInterface } from "@langchain/core/embeddings"; import { BaseCache } from "@langchain/core/caches"; import { Generation } from "@langchain/core/outputs"; //#region src/caches/caches_documentdb.d.ts /** * Represents a Semantic Cache that uses Azure DocumentDB as the underlying * storage system. * * @example * ```typescript * const embeddings = new OpenAIEmbeddings(); * const cache = new AzureDocumentDBSemanticCache(embeddings, { * client?: MongoClient * }); * const model = new ChatOpenAI({ model: "gpt-4o-mini", cache }); * * // Invoke the model to perform an action * const response = await model.invoke("Do something random!"); * console.log(response); * ``` */ declare class AzureDocumentDBSemanticCache extends BaseCache { private embeddings; private config; private similarityScoreThreshold; private cacheDict; private readonly client; private vectorDistanceFunction; constructor(embeddings: EmbeddingsInterface, dbConfig: AzureDocumentDBConfig, similarityScoreThreshold?: number); private getLlmCache; /** * Retrieves data from the cache. * * @param prompt The prompt for lookup. * @param llmKey The LLM key used to construct the cache key. * @returns An array of Generations if found, null otherwise. */ lookup(prompt: string, llmKey: string): Promise; /** * Updates the cache with new data. * * @param prompt The prompt for update. * @param llmKey The LLM key used to construct the cache key. * @param value The value to be stored in the cache. */ update(prompt: string, llmKey: string, returnValue: Generation[]): Promise; /** * Deletes the semantic cache for a given llmKey. * @param llmKey */ clear(llmKey: string): Promise; } /** * @deprecated Use `AzureDocumentDBSemanticCache` instead. This alias will be removed in a future version. */ declare const AzureCosmosDBMongoDBSemanticCache: typeof AzureDocumentDBSemanticCache; /** * @deprecated Use `AzureDocumentDBSemanticCache` instead. This alias will be removed in a future version. */ type AzureCosmosDBMongoDBSemanticCache = AzureDocumentDBSemanticCache; //#endregion export { AzureCosmosDBMongoDBSemanticCache, AzureDocumentDBSemanticCache }; //# sourceMappingURL=caches_documentdb.d.cts.map