import { MongoClient } from "mongodb"; import { BaseListChatMessageHistory } from "@langchain/core/chat_history"; import { BaseMessage } from "@langchain/core/messages"; //#region src/chat_histories/documentdb.d.ts interface AzureDocumentDBChatHistoryDBConfig { readonly client?: MongoClient; readonly connectionString?: string; readonly databaseName?: string; readonly collectionName?: string; } type ChatSessionDocumentDB = { id: string; user_id: string; context: Record; }; /** * Azure DocumentDB Chat Message History. * Stores chat message history in an Azure DocumentDB collection. */ declare class AzureDocumentDBChatMessageHistory extends BaseListChatMessageHistory { lc_namespace: string[]; get lc_secrets(): { [key: string]: string; }; private initPromise?; private context; private readonly client; private database; private collection; private sessionId; private userId; initialize: () => Promise; constructor(dbConfig: AzureDocumentDBChatHistoryDBConfig, sessionId: string, userId: string); private init; /** * Retrieves the messages stored in the history. * @returns A promise that resolves with the messages stored in the history. */ getMessages(): Promise; /** * Adds a message to the history. * @param message The message to add to the history. * @returns A promise that resolves when the message has been added to the history. */ addMessage(message: BaseMessage): Promise; /** * Adds multiple messages to the history. * @param messages The messages to add to the history. * @returns A promise that resolves when the messages have been added to the history. */ addMessages(messages: BaseMessage[]): Promise; /** * Clear the history. * @returns A promise that resolves when the history has been cleared. */ clear(): Promise; getAllSessions(): Promise; clearAllSessions(): Promise; getContext(): Promise>; setContext(context: Record): Promise; } /** * @deprecated Use `AzureDocumentDBChatHistoryDBConfig` instead. This alias will be removed in a future version. */ type AzureCosmosDBMongoChatHistoryDBConfig = AzureDocumentDBChatHistoryDBConfig; /** * @deprecated Use `ChatSessionDocumentDB` instead. This alias will be removed in a future version. */ type ChatSessionMongo = ChatSessionDocumentDB; /** * @deprecated Use `AzureDocumentDBChatMessageHistory` instead. This alias will be removed in a future version. */ declare const AzureCosmosDBMongoChatMessageHistory: typeof AzureDocumentDBChatMessageHistory; /** * @deprecated Use `AzureDocumentDBChatMessageHistory` instead. This alias will be removed in a future version. */ type AzureCosmosDBMongoChatMessageHistory = AzureDocumentDBChatMessageHistory; //#endregion export { AzureCosmosDBMongoChatHistoryDBConfig, AzureCosmosDBMongoChatMessageHistory, AzureDocumentDBChatHistoryDBConfig, AzureDocumentDBChatMessageHistory, ChatSessionDocumentDB, ChatSessionMongo }; //# sourceMappingURL=documentdb.d.ts.map