Documentation
¶
Index ¶
- Constants
- func Save(path string, cfg *Config) error
- type AgentDefaultsConfig
- type AgentsConfig
- type ChannelsConfig
- type Config
- type CronConfig
- type DiscordConfig
- type ExecToolConfig
- type GatewayConfig
- type HeartbeatConfig
- type LLMConfig
- type MemorySearchCacheConfig
- type MemorySearchChunkingConfig
- type MemorySearchConfig
- type MemorySearchHybridConfig
- type MemorySearchQueryConfig
- type MemorySearchRemoteConfig
- type MemorySearchStoreConfig
- type MemorySearchSyncConfig
- type MemorySearchVectorStoreConfig
- type SlackConfig
- type SlackDMConfig
- type TelegramConfig
- type ToolsConfig
- type WebToolsConfig
- type WhatsAppConfig
Constants ¶
View Source
const ( DefaultAgentMaxTokens = 8192 DefaultAgentTemperature = 0.7 DefaultAgentMemoryWindow = 50 DefaultMemorySearchChunkTokens = 400 DefaultMemorySearchChunkOverlap = 80 DefaultMemorySearchMaxResults = 6 DefaultMemorySearchMinScore = 0.35 DefaultMemorySearchHybridVectorWeight = 0.7 DefaultMemorySearchHybridTextWeight = 0.3 DefaultMemorySearchCandidateMultiplier = 4 DefaultOpenAIBaseURL = "https://api.openai.com/v1" DefaultOpenRouterBaseURL = "https://openrouter.ai/api/v1" DefaultAnthropicBaseURL = "https://api.anthropic.com" DefaultGeminiBaseURL = "https://generativelanguage.googleapis.com/v1beta" DefaultOllamaBaseURL = "http://localhost:11434/v1" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentDefaultsConfig ¶
type AgentDefaultsConfig struct {
Model string `json:"model"`
MaxTokens int `json:"maxTokens,omitempty"`
Temperature *float64 `json:"temperature,omitempty"`
MemoryWindow int `json:"memoryWindow,omitempty"`
MemorySearch MemorySearchConfig `json:"memorySearch"`
}
func (AgentDefaultsConfig) MaxTokensValue ¶
func (c AgentDefaultsConfig) MaxTokensValue() int
func (AgentDefaultsConfig) MemoryWindowValue ¶ added in v0.2.3
func (c AgentDefaultsConfig) MemoryWindowValue() int
func (AgentDefaultsConfig) TemperatureValue ¶
func (c AgentDefaultsConfig) TemperatureValue() float64
type AgentsConfig ¶
type AgentsConfig struct {
Defaults AgentDefaultsConfig `json:"defaults"`
}
type ChannelsConfig ¶
type ChannelsConfig struct {
Discord DiscordConfig `json:"discord"`
Slack SlackConfig `json:"slack"`
Telegram TelegramConfig `json:"telegram"`
WhatsApp WhatsAppConfig `json:"whatsapp"`
}
type Config ¶
type Config struct {
Env map[string]string `json:"env"`
// Agent configuration (model, iterations, etc.). Kept small on purpose.
Agents AgentsConfig `json:"agents"`
LLM LLMConfig `json:"llm"`
Tools ToolsConfig `json:"tools"`
Cron CronConfig `json:"cron"`
Heartbeat HeartbeatConfig `json:"heartbeat"`
Gateway GatewayConfig `json:"gateway"`
// Channels are optional; enable what you need.
Channels ChannelsConfig `json:"channels"`
}
func (*Config) ApplyLLMRouting ¶
ApplyLLMRouting resolves the effective LLM endpoint and API key from: - agents.defaults.model (preferred) or llm.model - env keys OPENAI_API_KEY / OPENROUTER_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEY / GOOGLE_API_KEY It mutates cfg.LLM to the effective values used at runtime.
type CronConfig ¶
type CronConfig struct {
Enabled *bool `json:"enabled"`
}
func (CronConfig) EnabledValue ¶
func (c CronConfig) EnabledValue() bool
type DiscordConfig ¶
type ExecToolConfig ¶
type ExecToolConfig struct {
TimeoutSec int `json:"timeoutSec"`
}
type GatewayConfig ¶
type GatewayConfig struct {
// Listen address for HTTP endpoints needed by channels (reserved for future use).
// Example: "0.0.0.0:18790"
Listen string `json:"listen"`
}
type HeartbeatConfig ¶
func (HeartbeatConfig) EnabledValue ¶
func (c HeartbeatConfig) EnabledValue() bool
type MemorySearchCacheConfig ¶ added in v0.2.4
type MemorySearchCacheConfig struct {
Enabled *bool `json:"enabled,omitempty"`
MaxEntries int `json:"maxEntries,omitempty"`
}
func (MemorySearchCacheConfig) EnabledValue ¶ added in v0.2.4
func (c MemorySearchCacheConfig) EnabledValue() bool
type MemorySearchChunkingConfig ¶ added in v0.2.4
type MemorySearchConfig ¶ added in v0.2.4
type MemorySearchConfig struct {
Enabled *bool `json:"enabled,omitempty"`
Provider string `json:"provider,omitempty"` // currently openai-compatible
Model string `json:"model,omitempty"`
Remote MemorySearchRemoteConfig `json:"remote"`
Store MemorySearchStoreConfig `json:"store"`
Chunking MemorySearchChunkingConfig `json:"chunking"`
Query MemorySearchQueryConfig `json:"query"`
Cache MemorySearchCacheConfig `json:"cache"`
Sync MemorySearchSyncConfig `json:"sync"`
}
func (MemorySearchConfig) EnabledValue ¶ added in v0.2.4
func (c MemorySearchConfig) EnabledValue() bool
type MemorySearchHybridConfig ¶ added in v0.2.4
type MemorySearchQueryConfig ¶ added in v0.2.4
type MemorySearchQueryConfig struct {
MaxResults int `json:"maxResults,omitempty"`
MinScore *float64 `json:"minScore,omitempty"`
Hybrid MemorySearchHybridConfig `json:"hybrid"`
}
type MemorySearchRemoteConfig ¶ added in v0.2.4
type MemorySearchStoreConfig ¶ added in v0.2.4
type MemorySearchStoreConfig struct {
Path string `json:"path,omitempty"`
Vector MemorySearchVectorStoreConfig `json:"vector"`
}
type MemorySearchSyncConfig ¶ added in v0.2.4
type MemorySearchSyncConfig struct {
OnSearch *bool `json:"onSearch,omitempty"`
}
func (MemorySearchSyncConfig) OnSearchValue ¶ added in v0.2.4
func (c MemorySearchSyncConfig) OnSearchValue() bool
type MemorySearchVectorStoreConfig ¶ added in v0.2.4
type MemorySearchVectorStoreConfig struct {
Enabled *bool `json:"enabled,omitempty"`
}
func (MemorySearchVectorStoreConfig) EnabledValue ¶ added in v0.2.4
func (c MemorySearchVectorStoreConfig) EnabledValue() bool
type SlackConfig ¶
type SlackConfig struct {
Enabled bool `json:"enabled"`
AllowFrom []string `json:"allowFrom"`
BotToken string `json:"botToken"` // xoxb-...
AppToken string `json:"appToken"` // xapp-... (Socket Mode)
// GroupPolicy controls whether the bot responds to non-DM messages.
// Supported: "mention" (default), "open", "allowlist".
GroupPolicy string `json:"groupPolicy,omitempty"`
GroupAllowFrom []string `json:"groupAllowFrom,omitempty"` // channel IDs allowed when groupPolicy="allowlist"
DM *SlackDMConfig `json:"dm,omitempty"`
}
Slack (Socket Mode). Inbound via Socket Mode, outbound via Web API (chat.postMessage).
type SlackDMConfig ¶
type SlackDMConfig struct {
Enabled bool `json:"enabled"`
}
type TelegramConfig ¶ added in v0.2.2
type TelegramConfig struct {
Enabled bool `json:"enabled"`
Token string `json:"token"`
AllowFrom []string `json:"allowFrom"`
BaseURL string `json:"baseURL,omitempty"` // optional: custom Bot API server URL
PollTimeoutSec int `json:"pollTimeoutSec,omitempty"`
Workers int `json:"workers,omitempty"`
}
Telegram (Bot API via long polling).
type ToolsConfig ¶
type ToolsConfig struct {
RestrictToWorkspace *bool `json:"restrictToWorkspace"`
Exec ExecToolConfig `json:"exec"`
Web WebToolsConfig `json:"web"`
}
func (ToolsConfig) RestrictToWorkspaceValue ¶
func (c ToolsConfig) RestrictToWorkspaceValue() bool
type WebToolsConfig ¶
type WebToolsConfig struct {
BraveAPIKey string `json:"braveApiKey"`
}
type WhatsAppConfig ¶ added in v0.2.2
type WhatsAppConfig struct {
Enabled bool `json:"enabled"`
AllowFrom []string `json:"allowFrom"`
SessionStorePath string `json:"sessionStorePath,omitempty"` // optional: sqlite store path for persistent login
}
WhatsApp (whatsmeow / WhatsApp Web Multi-Device).
Click to show internal directories.
Click to hide internal directories.