MomentoChatMessageHistory(
self,
session_id: str,
cache_client: momento.CacheClient,
cache_name: str,
*,| Name | Type | Description |
|---|---|---|
session_id* | str | The session ID to use for this chat session. |
cache_client* | CacheClient | The Momento cache client. |
cache_name* | str | The name of the cache to use to store the messages. |
key_prefix | str | Default: 'message_store:'The prefix to apply to the cache key. Defaults to "message_store:". |
ttl | Optional[timedelta] | Default: None |
ensure_cache_exists | bool | Default: True |
Chat message history cache that uses Momento as a backend.
The TTL to use for the messages. Defaults to None, ie the default TTL of the cache will be used.
Create the cache if it doesn't exist. Defaults to True.