Open gazambuja opened 3 months ago
Hey @gazambuja! I'm here to help you with any questions or issues you have regarding the AzureChatStore. Feel free to ask me anything!
AzureChatStore explicitly makes asynchronous requests using the _atable_service_client
, which is an instance of AsyncTableServiceClient
from the azure.data.tables.aio
module. This client is designed to handle asynchronous operations.
The difference between _atable_service_client
and _table_service_client
is as follows:
_table_service_client
is an instance of TableServiceClient
from the azure.data.tables
module, which is used for synchronous operations._atable_service_client
is an instance of AsyncTableServiceClient
from the azure.data.tables.aio
module, which is used for asynchronous operations.This distinction allows AzureChatStore to support both synchronous and asynchronous interactions with Azure Table Storage or Cosmos DB. The AzureKVStore
class, for example, initializes these clients and provides methods like put
and aput
for synchronous and asynchronous operations, respectively [1][2].
For ensuring asynchronous operations, you should use methods provided by AsyncTableServiceClient
, such as create_table_if_not_exists
, upsert_entity
, submit_transaction
, get_entity
, list_entities
, delete_entity
, and query_entities
[1][2].
To continue talking to Dosu, mention @dosu.
Commenting here to follow this, Since I am also working on something similar.
Meanwhile If somebody can answer this or point me to the direction since I am unable to find anything in the documentation page.
I want to keep each user's chat history. For now I am been using SimpleChatStore but now I want to replace it with AzureChatStore.
Right now my functionality looks something like this;
I load the chatstore from the disk with.
chat_store = SimpleChatStore.from_persist_path(persist_path="chat_store.json")
It has all of the user's chat history and I can retrieve from it and displays it for the specific user when they log in to their session.
After they are done with their query, I run
chat_store.persist(persist_path="chat_store.json")
This stores the updated chat in the memory.
With AzureChatStore, LlamaIndex
Demo: Azure Table Storage as a ChatStore shows loading of chat_store from AzureChatStore. My question is how to persist the chat history on the Azure after each query, Do we explicitly call add_message
after processing of each query?
Question Validation
Question
I'm working on integrating AzureChatStore into my project and want to ensure that all requests to the store are made asynchronously to optimize performance. I've been reviewing the source code, but I'm having trouble understanding the following:
Any insights or guidance on these questions would be greatly appreciated. Thanks in advance for your help!