import { AzureCosmosDBNoSQLConfig } from "../azure_cosmosdb_nosql.js"; import { BaseCache } from "@langchain/core/caches"; import { EmbeddingsInterface } from "@langchain/core/embeddings"; import { Generation } from "@langchain/core/outputs"; //#region src/caches/caches_nosql.d.ts /** * Represents a Semantic Cache that uses CosmosDB NoSQL backend as the underlying * storage system. * * @example * ```typescript * const embeddings = new OpenAIEmbeddings(); * const cache = new AzureCosmosDBNoSQLSemanticCache(embeddings, { * databaseName: DATABASE_NAME, * containerName: CONTAINER_NAME * }); * 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 AzureCosmosDBNoSQLSemanticCache extends BaseCache { private embeddings; private config; private similarityScoreThreshold; private cacheDict; private vectorDistanceFunction; constructor(embeddings: EmbeddingsInterface, dbConfig: AzureCosmosDBNoSQLConfig, 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; } //#endregion export { AzureCosmosDBNoSQLSemanticCache }; //# sourceMappingURL=caches_nosql.d.ts.map