Documentation
¶
Index ¶
- func ClearSession() error
- func ConfigDir() string
- func ConfigPath() string
- func SaveSession(s *Session) error
- func SessionPath() string
- type AuthMethod
- type Config
- type ConsensusConfig
- type MetadataConfig
- type ProviderConfig
- type ProviderType
- type RolesConfig
- type RoutingConfig
- type Session
- type SessionExchange
- type SessionMessage
- type TUIConfig
- type ToolCallRecord
- type ToolResultRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearSession ¶ added in v0.2.0
func ClearSession() error
ClearSession removes the saved session file.
func ConfigPath ¶
func ConfigPath() string
func SaveSession ¶ added in v0.2.0
SaveSession writes the session to disk.
func SessionPath ¶ added in v0.2.0
func SessionPath() string
SessionPath returns the path to the session file.
Types ¶
type AuthMethod ¶
type AuthMethod string
const ( AuthMethodAPIKey AuthMethod = "api_key" AuthMethodOAuth AuthMethod = "oauth" AuthMethodNone AuthMethod = "none" )
type Config ¶
type Config struct {
Providers []ProviderConfig `yaml:"providers"`
Consensus ConsensusConfig `yaml:"consensus"`
TUI TUIConfig `yaml:"tui"`
Metadata MetadataConfig `yaml:"metadata,omitempty"`
Roles RolesConfig `yaml:"roles,omitempty"`
Routing RoutingConfig `yaml:"routing,omitempty"`
DefaultMode string `yaml:"mode,omitempty"`
}
func DefaultConfig ¶
func DefaultConfig() Config
func (*Config) PrimaryProvider ¶
func (c *Config) PrimaryProvider() *ProviderConfig
type ConsensusConfig ¶
type MetadataConfig ¶
type ProviderConfig ¶
type ProviderConfig struct {
Name string `yaml:"name"`
Type ProviderType `yaml:"type"`
Auth AuthMethod `yaml:"auth"`
Model string `yaml:"model"`
Primary bool `yaml:"primary,omitempty"`
BaseURL string `yaml:"base_url,omitempty"`
MaxContext int `yaml:"max_context,omitempty"`
OAuthClientID string `yaml:"oauth_client_id,omitempty"`
OAuthDeviceURL string `yaml:"oauth_device_url,omitempty"`
OAuthTokenURL string `yaml:"oauth_token_url,omitempty"`
}
type ProviderType ¶
type ProviderType string
const ( ProviderTypeAnthropic ProviderType = "anthropic" ProviderTypeOpenAI ProviderType = "openai" ProviderTypeGoogle ProviderType = "google" ProviderTypeOpenAICompatible ProviderType = "openai_compatible" )
type RolesConfig ¶ added in v0.2.0
type RoutingConfig ¶ added in v0.2.0
type RoutingConfig struct {
CalibrationInterval int `yaml:"calibration_interval,omitempty"` // default 10
}
type Session ¶ added in v0.2.0
type Session struct {
Messages []SessionMessage `json:"messages"`
Exchanges []SessionExchange `json:"exchanges"`
UpdatedAt time.Time `json:"updated_at"`
}
Session holds the full conversation state for persistence.
func LoadSession ¶ added in v0.2.0
LoadSession reads a saved session from disk. Returns nil (no error) if no session file exists.
type SessionExchange ¶ added in v0.2.0
type SessionExchange struct {
Prompt string `json:"prompt"`
ConsensusResponse string `json:"consensus_response"`
Individual map[string]string `json:"individual,omitempty"`
}
SessionExchange is a serializable prompt/response pair for display history.
type SessionMessage ¶ added in v0.2.0
type SessionMessage struct {
Role string `json:"role"`
Content string `json:"content"`
ToolCalls []ToolCallRecord `json:"tool_calls,omitempty"`
ToolResult *ToolResultRecord `json:"tool_result,omitempty"`
}
SessionMessage is a serializable conversation message.
type ToolCallRecord ¶ added in v0.2.0
type ToolCallRecord struct {
ID string `json:"id"`
Name string `json:"name"`
Arguments string `json:"arguments"`
}
ToolCallRecord is a serializable tool call.
type ToolResultRecord ¶ added in v0.2.0
type ToolResultRecord struct {
ToolCallID string `json:"tool_call_id"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
}
ToolResultRecord is a serializable tool result.
Click to show internal directories.
Click to hide internal directories.