ChatHistorySave
Python template · sinapsis_chat_history.templates.chat_history_save
Overview
Template for saving chat messages into a storage backend.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
Terminalbash
pip install sinapsis-chat-history==1.0.0uv pip install sinapsis-chat-history==1.0.0uv add sinapsis-chat-history==1.0.0Configuration
Effective fields from the inspector schema, including nested Pydantic model fields.
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
Optional
Default: null
provider
typing.Literal['postgres', 'sqlite', 'supabase']
Optional
Default: "sqlite"
Optional
Default: "sqlite"
db_config
dict[str, typing.Any]
Optional
Default: null
Optional
Default: null
save_args
Save-time options for message persistence.
ChatHistorySaveArgs
Optional
Default: null
Optional
Default: null
include_packet_metadata
Whether packet-level metadata such as provider info, usage, performance, and termination should be merged into the stored message metadata.
bool
Optional
Default: false
Optional
Default: false
Configuration example
Example from the Python docstring:
yaml
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: ChatHistorySave
class_name: ChatHistorySave
template_input: InputTemplate
attributes:
provider: sqlite
db_config:
db_path: "chat_history.sqlite3"
table: "chat"Show schema-based configuration skeleton
yaml
templates:
- template_name: "ChatHistorySave"
class_name: "ChatHistorySave"
attributes:
provider: "sqlite"
db_config: null
save_args:
include_packet_metadata: false
Inheritance
Immediate parent:
sinapsis_chat_history.templates.chat_history_base.ChatHistoryBaseEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.