Documentation
¶
Index ¶
- type Conversation
- func GetConversationByID(ctx context.Context, db bun.IDB, id uuid.UUID) (*Conversation, error)
- func GetConversationsBySpecID(ctx context.Context, db bun.IDB, agentSpecID uuid.UUID) ([]*Conversation, error)
- func NewConversation(agentSpec *Spec, messages []types.Message, metadata map[string]any) (*Conversation, error)
- func (c *Conversation) AfterScanRow(ctx context.Context) error
- func (c *Conversation) Clone(ctx context.Context, db bun.IDB, discardMessages bool) (*Conversation, error)
- func (c *Conversation) Delete(ctx context.Context, db bun.IDB) error
- func (c Conversation) GetCursor() string
- func (c Conversation) GetSortField() string
- func (c Conversation) GetSortValue() interface{}
- func (c Conversation) GetUniqueField() string
- func (c Conversation) GetUniqueValue() interface{}
- func (c *Conversation) Insert(ctx context.Context, db bun.IDB) error
- func (c *Conversation) Update(ctx context.Context, db bun.IDB) error
- func (c *Conversation) Validate() error
- type ConversationStatus
- type LLMProvider
- type Spec
- func (pt *Spec) AfterScanRow(ctx context.Context) error
- func (pt *Spec) Delete(ctx context.Context, db bun.IDB) error
- func (pt Spec) GetCursor() string
- func (pt Spec) GetSortField() string
- func (pt Spec) GetSortValue() interface{}
- func (pt Spec) GetUniqueField() string
- func (pt Spec) GetUniqueValue() interface{}
- func (pt *Spec) Insert(ctx context.Context, db bun.IDB) error
- func (pt *Spec) Update(ctx context.Context, db bun.IDB) error
- func (pt *Spec) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation struct {
bun.BaseModel `bun:"table:conversations"`
ID uuid.UUID `bun:",pk,type:uuid" json:"id"`
AgentSpecID uuid.UUID `bun:"type:uuid" json:"agent_spec_id"`
SessionID string `json:"session_id,omitempty"`
AgentName string `json:"agent_name"`
Provider LLMProvider `json:"provider"`
Model string `json:"model"`
ReasoningEffort types.ReasoningEffort `json:"reasoning_effort"`
Instructions string `json:"instructions"`
Tools []types.ToolDefinition `bun:"type:jsonb,nullzero" json:"-"`
Messages []types.Message `bun:"type:jsonb,nullzero" json:"messages"`
Metadata map[string]any `bun:"type:jsonb,nullzero" json:"metadata"`
Status ConversationStatus `json:"status"`
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CachedTokens int64 `json:"cached_tokens"`
Cost int64 `json:"cost"`
CreatedAt time.Time `json:"created_at"`
AutoCompact bool `json:"auto_compact"`
CompactAtPercent int `json:"compact_at_percent"`
CompactionPrompt string `json:"compaction_prompt"`
CompactCount int `json:"compact_count"`
ShellRoot string `json:"shell_root,omitempty"`
ShellAccess bool `json:"shell_access"`
WebSearch bool `json:"web_search"`
StructuredOutput bool `json:"structured_output"`
StructuredOutputSchema json.RawMessage `bun:"type:json,nullzero" json:"structured_output_schema"`
}
func GetConversationByID ¶
func NewConversation ¶
func (*Conversation) AfterScanRow ¶ added in v0.2.11
func (c *Conversation) AfterScanRow(ctx context.Context) error
func (*Conversation) Clone ¶ added in v0.2.4
func (c *Conversation) Clone(ctx context.Context, db bun.IDB, discardMessages bool) (*Conversation, error)
func (Conversation) GetCursor ¶
func (c Conversation) GetCursor() string
func (Conversation) GetSortField ¶
func (c Conversation) GetSortField() string
func (Conversation) GetSortValue ¶
func (c Conversation) GetSortValue() interface{}
func (Conversation) GetUniqueField ¶
func (c Conversation) GetUniqueField() string
func (Conversation) GetUniqueValue ¶
func (c Conversation) GetUniqueValue() interface{}
func (*Conversation) Validate ¶
func (c *Conversation) Validate() error
type ConversationStatus ¶
type ConversationStatus string
const ( ConversationStatusQueued ConversationStatus = "queued" ConversationStatusRunning ConversationStatus = "running" ConversationStatusSucceeded ConversationStatus = "succeeded" ConversationStatusFailed ConversationStatus = "failed" ConversationStatusCanceled ConversationStatus = "canceled" )
func (ConversationStatus) MarshalJSON ¶
func (s ConversationStatus) MarshalJSON() ([]byte, error)
func (*ConversationStatus) UnmarshalJSON ¶
func (s *ConversationStatus) UnmarshalJSON(b []byte) error
func (ConversationStatus) Validate ¶
func (s ConversationStatus) Validate() error
type LLMProvider ¶
type LLMProvider string
const (
LLMProviderOpenAI LLMProvider = "open_ai"
)
func (LLMProvider) MarshalJSON ¶
func (e LLMProvider) MarshalJSON() ([]byte, error)
func (*LLMProvider) UnmarshalJSON ¶
func (e *LLMProvider) UnmarshalJSON(b []byte) error
func (LLMProvider) Validate ¶
func (e LLMProvider) Validate() error
type Spec ¶
type Spec struct {
bun.BaseModel `bun:"table:agent_specs"`
ID uuid.UUID `bun:",pk,type:uuid" json:"id"`
Name string `json:"name"`
Provider LLMProvider `json:"provider"`
Model string `json:"model"`
ReasoningEffort runtimetypes.ReasoningEffort `json:"reasoning_effort"`
Instructions string `json:"instructions"`
AutoCompact bool `json:"auto_compact"`
CompactAtPercent int `json:"compact_at_percent"`
CompactionPrompt string `json:"compaction_prompt"`
ShellAccess bool `json:"shell_access"`
WebSearch bool `json:"web_search"`
StructuredOutput bool `json:"structured_output"`
StructuredOutputSchema json.RawMessage `bun:"type:json,nullzero" json:"structured_output_schema"`
Version int `json:"version"`
}
func GetAgentSpecByID ¶
func NewAgentSpec ¶
func NewAgentSpec(name string, prov LLMProvider, model, instructions string, reasoningEffort runtimetypes.ReasoningEffort, version int) (*Spec, error)
func (*Spec) AfterScanRow ¶ added in v0.2.11
func (Spec) GetSortField ¶
func (Spec) GetSortValue ¶
func (pt Spec) GetSortValue() interface{}
func (Spec) GetUniqueField ¶
func (Spec) GetUniqueValue ¶
func (pt Spec) GetUniqueValue() interface{}
Click to show internal directories.
Click to hide internal directories.