Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
MessageID int64 `json:"message_id" db:"message_id"`
SessionID int64 `json:"session_id" db:"session_id"`
Role string `json:"role" db:"role"`
// Name optionally identifies the producer of this message (e.g. an agent name).
Name string `json:"name" db:"name"`
Content string `json:"content" db:"content"`
// Parts holds multi-modal content parts (text, images, etc.) serialized as JSON.
Parts Parts `json:"parts" db:"parts"`
// ReasoningContent stores the model's chain-of-thought output when provided.
ReasoningContent string `json:"reasoning_content" db:"reasoning_content"`
ToolCalls ToolCalls `json:"tool_calls" db:"tool_calls"`
// ToolCallID links a tool-role message back to the assistant's ToolCall.ID it responds to.
ToolCallID string `json:"tool_call_id" db:"tool_call_id"`
// PromptTokens is the number of input tokens consumed by the LLM call that produced this message.
PromptTokens int64 `json:"prompt_tokens" db:"prompt_tokens"`
// CompletionTokens is the number of output tokens generated by the LLM call.
CompletionTokens int64 `json:"completion_tokens" db:"completion_tokens"`
// TotalTokens is the sum of PromptTokens and CompletionTokens.
TotalTokens int64 `json:"total_tokens" db:"total_tokens"`
CreatedAt int64 `json:"created_at" db:"created_at"`
UpdatedAt int64 `json:"updated_at" db:"updated_at"`
// CompactedAt is set when the message has been archived by a CompactMessages call.
// A non-zero value means the message is compacted and no longer part of the active history.
CompactedAt int64 `json:"compacted_at" db:"compacted_at"`
DeletedAt int64 `json:"deleted_at" db:"deleted_at"`
}
Message represents a persisted conversation message.
type Parts ¶ added in v0.0.5
type Parts []model.ContentPart
Parts is a slice of ContentPart that serializes to/from JSON for database storage.
type ToolCall ¶
type ToolCall struct {
// ID is the unique identifier of this tool call, matching model.ToolCall.ID.
ID string `json:"id" db:"id"`
Name string `json:"name" db:"name"`
Arguments string `json:"arguments" db:"arguments"`
}
ToolCall represents a persisted tool call within an assistant message.
Click to show internal directories.
Click to hide internal directories.