Docs /Templates/ sinapsis-chat-history

ChatHistoryDelete

sinapsis-chat-historyChat Historychatbotschat_historycontext

Python template · sinapsis_chat_history.templates.chat_history_delete

Overview

Template for deleting chat history records from a storage backend.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-chat-history==1.0.0
uv pip install sinapsis-chat-history==1.0.0
uv add sinapsis-chat-history==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
provider
typing.Literal['postgres', 'sqlite', 'supabase']
Optional
Default: "sqlite"
db_config
dict[str, typing.Any]
Optional
Default: null
delete_argsRequired

Scope and filter options used when deleting stored messages.

ChatHistoryDeleteArgs
Required
Default: null
filters

Optional message-level filters applied in addition to the resolved scope.

ChatHistoryFilters
Optional
Default: null
id
str | None
Optional
Default: null
role
typing.Optional[typing.Literal['system', 'user', 'assistant', 'tool', 'developer']]
Optional
Default: null
content
str | None
Optional
Default: null
user_idRequired

Required explicit user scope for deletion.

str
Required
Default: null
session_id

Optional explicit session scope for deletion.

str | None
Optional
Default: null

Configuration example

Example from the Python docstring:

yaml
agent:
  name: my_test_agent
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: ChatHistoryDelete
  class_name: ChatHistoryDelete
  template_input: InputTemplate
  attributes:
    provider: sqlite
    db_config:
      db_path: "chat_history.sqlite3"
      table: "chat"
    delete_args:
      user_id: "Sarah"
      session_id: "conv_1234"
      filters:
        role: assistant
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "ChatHistoryDelete"
    class_name: "ChatHistoryDelete"
    attributes:
      provider: "sqlite"
      db_config: null
      delete_args:
        filters:
          id: null
          role: null
          content: null
        user_id: "<required>"
        session_id: null

Inheritance

Immediate parent: sinapsis_chat_history.templates.chat_history_base.ChatHistoryBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.