ChatHistoryFetch
Python template · sinapsis_chat_history.templates.chat_history_fetch
Overview
Template for loading chat history messages from a storage backend.
Capabilities
Capabilities: not setInstallation
Install the published package using pip or uv.
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.
Optional
Default: null
Optional
Default: "sqlite"
Optional
Default: null
Query options used when loading chat history messages.
Optional
Default: null
Maximum number of messages to fetch. Use `-1` to fetch all matching messages.
Optional
Default: 100
Sort direction for the returned messages.
Optional
Default: "asc"
Number of matching messages to skip before returning results.
Optional
Default: 0
Optional message-level filters applied in addition to packet identity scope.
Optional
Default: null
Optional
Default: null
Optional
Default: null
Optional
Default: null
Field used to order the returned messages.
Optional
Default: "created_at"
Configuration example
Example from the Python docstring:
agent:
name: my_test_agent
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: ChatHistoryFetch
class_name: ChatHistoryFetch
template_input: InputTemplate
attributes:
provider: sqlite
db_config:
db_path: "chat_history.sqlite3"
table: "chat"
fetch_args:
limit: 10
offset: 0
order: asc
order_by: created_atShow schema-based configuration skeleton
templates:
- template_name: "ChatHistoryFetch"
class_name: "ChatHistoryFetch"
attributes:
provider: "sqlite"
db_config: null
fetch_args:
limit: 100
order: "asc"
offset: 0
filters:
id: null
role: null
content: null
order_by: "created_at"
Inheritance
sinapsis_chat_history.templates.chat_history_base.ChatHistoryBaseEnvironment variables
Environment definitions belong to their canonical Python modules.
No directly related environment variables listed.