UNPKG

@langchain/community

Version:
1 lines • 2.22 kB
{"version":3,"file":"upstash_redis.d.ts","names":["Redis","RedisConfigNodejs","BaseListChatMessageHistory","BaseMessage","UpstashRedisChatMessageHistoryInput","UpstashRedisChatMessageHistory","Promise"],"sources":["../../../src/stores/message/upstash_redis.d.ts"],"sourcesContent":["import { Redis, type RedisConfigNodejs } from \"@upstash/redis\";\nimport { BaseListChatMessageHistory } from \"@langchain/core/chat_history\";\nimport { BaseMessage } from \"@langchain/core/messages\";\n/**\n * Type definition for the input parameters required to initialize an\n * instance of the UpstashRedisChatMessageHistory class.\n */\nexport type UpstashRedisChatMessageHistoryInput = {\n sessionId: string;\n sessionTTL?: number;\n config?: RedisConfigNodejs;\n client?: Redis;\n};\n/**\n * Class used to store chat message history in Redis. It provides methods\n * to add, get, and clear messages.\n */\nexport declare class UpstashRedisChatMessageHistory extends BaseListChatMessageHistory {\n lc_namespace: string[];\n get lc_secrets(): {\n \"config.url\": string;\n \"config.token\": string;\n };\n client: Redis;\n private sessionId;\n private sessionTTL?;\n constructor(fields: UpstashRedisChatMessageHistoryInput);\n /**\n * Retrieves the chat messages from the Redis database.\n * @returns An array of BaseMessage instances representing the chat history.\n */\n getMessages(): Promise<BaseMessage[]>;\n /**\n * Adds a new message to the chat history in the Redis database.\n * @param message The message to be added to the chat history.\n * @returns Promise resolving to void.\n */\n addMessage(message: BaseMessage): Promise<void>;\n /**\n * Deletes all messages from the chat history in the Redis database.\n * @returns Promise resolving to void.\n */\n clear(): Promise<void>;\n}\n//# sourceMappingURL=upstash_redis.d.ts.map"],"mappings":";;;;;;;;AAOA;AAUA;AAMYA,KAhBAI,mCAAAA,GAgBAJ;EAGYI,SAAAA,EAAAA,MAAAA;EAKGD,UAAAA,CAAAA,EAAAA,MAAAA;EAARG,MAAAA,CAAAA,EArBNL,iBAqBMK;EAMKH,MAAAA,CAAAA,EA1BXH,KA0BWG;CAAcG;;;AApBgD;;cAAjED,8BAAAA,SAAuCH,0BAAAA;;;;;;UAMhDF;;;sBAGYI;;;;;iBAKLE,QAAQH;;;;;;sBAMHA,cAAcG;;;;;WAKzBA"}