| Name | Type | Description |
|---|---|---|
- session_id* | unknown | The ID of the chat session |
- client* | unknown | The RocksetClient object to use to query |
- collection* | unknown | The name of the collection to use to store chat messages. If a collection with the given name does not exist in the workspace, it is created. |
- workspace* | unknown | The workspace containing |
- messages_key* | unknown | The DB column containing message history.
Defaults to |
- sync* | unknown | Whether to wait for messages to be added. Defaults
to |
- message_uuid_method* | unknown |
Uses Rockset to store chat messages.
To use, ensure that the rockset python package installed.
Example:
.. code-block:: python
from langchain_community.chat_message_histories import ( RocksetChatMessageHistory ) from rockset import RocksetClient
history = RocksetChatMessageHistory( session_id="MySession", client=RocksetClient(), collection="langchain_demo", sync=True )
history.add_user_message("hi!") history.add_ai_message("whats up?")
print(history.messages) # noqa: T201
The method that generates message IDs.
If set, all messages will have an id field within the
additional_kwargs property. If this param is not set
and sync is False, message IDs will not be created.
If this param is not set and sync is True, the
uuid.uuid4 method will be used to create message IDs.