Expand description
Session and message storage helpers.
Structs§
- Message
Data - Message data returned to frontends.
- Session
Info - Session metadata returned to frontends.
- Tool
Call Info Data - Tool call info for storage in message.
Functions§
- delete_
session - Soft-delete a session.
- find_
session_ by_ chat_ id - Find an active session by its platform chat identifier.
- get_
messages - Get all messages for a session, ordered by creation time.
- get_
session - Get a single session by ID.
- init_db
- Initialize the database: create tables if needed, then run migrations.
- insert_
message - Insert a message into a session.
- insert_
session - Insert a new session.
- list_
sessions - List all active sessions, ordered by most recently updated.
- load_
chat_ messages - Load all messages for a session and convert to chat messages
- message_
to_ chat_ message - Convert stored MessageData to ChatCompletionRequestMessage
- resolve_
db_ path - Resolve the session database path for a working directory and storage scope.
- touch_
session - Update a session’s updated_at timestamp.
- update_
session_ title - Update a session’s title.
- update_
tool_ message - Update a tool message with result.