AzureCosmosNoSqlChatStore
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:61
Extends
BaseChatStore
<AdditionalMessageOptions
>
Type Parameters
• AdditionalMessageOptions extends object
= object
Constructors
new AzureCosmosNoSqlChatStore()
new AzureCosmosNoSqlChatStore<
AdditionalMessageOptions
>(__namedParameters
):AzureCosmosNoSqlChatStore
<AdditionalMessageOptions
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:77
Parameters
__namedParameters
AzureCosmosNoSqlChatStoreConfig
Returns
AzureCosmosNoSqlChatStore
<AdditionalMessageOptions
>
Overrides
BaseChatStore<AdditionalMessageOptions>.constructor
Methods
client()
client():
CosmosClient
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:112
Returns
CosmosClient
fromConnectionString()
static
fromConnectionString(config
):AzureCosmosNoSqlChatStore
<object
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:148
Static method for creating an instance using a connection string.
If no connection string is provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_CONNECTION_STRING
as connection string.
Parameters
config
object
& AzureCosmosNoSqlChatStoreConfig
= {}
Returns
AzureCosmosNoSqlChatStore
<object
>
Instance of AzureCosmosNoSqlKVStore
fromAccountAndKey()
static
fromAccountAndKey(config
):AzureCosmosNoSqlChatStore
<object
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:176
Static method for creating an instance using a account endpoint and key.
If no endpoint and key is provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_ACCOUNT_ENDPOINT
as enpoint and AZURE_COSMOSDB_NOSQL_ACCOUNT_KEY
as key.
Parameters
config
object
& AzureCosmosNoSqlChatStoreConfig
= {}
Returns
AzureCosmosNoSqlChatStore
<object
>
Instance of AzureCosmosNoSqlKVStore
fromAadToken()
static
fromAadToken(config
):AzureCosmosNoSqlChatStore
<object
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:209
Static method for creating an instance using AAD token.
If no endpoint and credentials are provided, it will attempt to use the env variable AZURE_COSMOSDB_NOSQL_ACCOUNT_ENDPOINT
as endpoint and use DefaultAzureCredential() as credentials.
Parameters
config
object
& AzureCosmosNoSqlChatStoreConfig
= {}
Returns
AzureCosmosNoSqlChatStore
<object
>
Instance of AzureCosmosNoSqlKVStore
setMessages()
setMessages(
key
,messages
):Promise
<void
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:259
Set messages for a given key.
Parameters
key
string
messages
ChatMessage
<AdditionalMessageOptions
>[]
Returns
Promise
<void
>
Overrides
BaseChatStore.setMessages
getMessages()
getMessages(
key
):Promise
<ChatMessage
<AdditionalMessageOptions
>[]>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:275
Get messages for a given key.
Parameters
key
string
Returns
Promise
<ChatMessage
<AdditionalMessageOptions
>[]>
Overrides
BaseChatStore.getMessages
addMessage()
addMessage(
key
,message
,idx
?):Promise
<void
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:288
Add a message for a given key.
Parameters
key
string
message
ChatMessage
<AdditionalMessageOptions
>
idx?
number
Returns
Promise
<void
>
Overrides
BaseChatStore.addMessage
deleteMessages()
deleteMessages(
key
):Promise
<void
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:307
Deletes all messages for a given key.
Parameters
key
string
Returns
Promise
<void
>
Overrides
BaseChatStore.deleteMessages
deleteMessage()
deleteMessage(
key
,idx
):Promise
<void
>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:318
Deletes one message at idx index for a given key.
Parameters
key
string
idx
number
Returns
Promise
<void
>
Overrides
BaseChatStore.deleteMessage
getKeys()
getKeys():
Promise
<IterableIterator
<string
,any
,any
>>
Defined in: providers/storage/azure/src/chatStore/AzureCosmosNoSqlChatStore.ts:331
Get all keys.
Returns
Promise
<IterableIterator
<string
, any
, any
>>
Overrides
BaseChatStore.getKeys