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 MediaToolsConfig
- type MemorySearchCacheConfig
- type MemorySearchChunkingConfig
- type MemorySearchConfig
- type MemorySearchHybridConfig
- type MemorySearchQueryConfig
- type MemorySearchRemoteConfig
- type MemorySearchStoreConfig
- type MemorySearchSyncConfig
- type MemorySearchVectorStoreConfig
- type SkillsRegistryConfig
- type SkillsToolsConfig
- 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" DefaultOpenAICodexBaseURL = "https://chatgpt.com/backend-api" DefaultOpenRouterBaseURL = "https://openrouter.ai/api/v1" DefaultAnthropicBaseURL = "https://api.anthropic.com" DefaultGeminiBaseURL = "https://generativelanguage.googleapis.com/v1beta" DefaultOllamaBaseURL = "http://localhost:11434/v1" DefaultWebFetchMaxResponseBytes = int64(500_000) DefaultWebFetchTimeoutSec = 30 DefaultSkillsMaxResults = 5 DefaultSkillsRegistryBaseURL = "https://clawhub.ai" DefaultSkillsRegistrySearchPath = "/api/v1/search" DefaultSkillsRegistrySkillsPath = "/api/v1/skills" DefaultSkillsRegistryDownloadPath = "/api/v1/download" DefaultSkillsRegistryTimeoutSec = 30 DefaultSkillsRegistryMaxZipBytes = int64(50 << 20) DefaultSkillsRegistryMaxResponseBytes = int64(2 << 20) DefaultMediaMaxAttachments = 4 DefaultMediaMaxFileBytes = int64(20 << 20) DefaultMediaMaxInlineImageBytes = int64(5 << 20) DefaultMediaMaxTextChars = 12000 DefaultMediaDownloadTimeoutSec = 20 )
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).
// Default: "127.0.0.1:18790"
Listen string `json:"listen"`
// Allow binding gateway to non-localhost addresses.
// Keep false unless you intentionally expose it behind a trusted tunnel/proxy.
AllowPublicBind bool `json:"allowPublicBind,omitempty"`
}
type HeartbeatConfig ¶
func (HeartbeatConfig) EnabledValue ¶
func (c HeartbeatConfig) EnabledValue() bool
type MediaToolsConfig ¶ added in v0.2.7
type MediaToolsConfig struct {
Enabled *bool `json:"enabled,omitempty"`
AudioEnabled *bool `json:"audioEnabled,omitempty"`
ImageEnabled *bool `json:"imageEnabled,omitempty"`
AttachmentEnabled *bool `json:"attachmentEnabled,omitempty"`
MaxAttachments int `json:"maxAttachments,omitempty"`
MaxFileBytes int64 `json:"maxFileBytes,omitempty"`
MaxInlineImageBytes int64 `json:"maxInlineImageBytes,omitempty"`
MaxTextChars int `json:"maxTextChars,omitempty"`
DownloadTimeoutSec int `json:"downloadTimeoutSec,omitempty"`
}
func (MediaToolsConfig) AttachmentEnabledValue ¶ added in v0.2.7
func (c MediaToolsConfig) AttachmentEnabledValue() bool
func (MediaToolsConfig) AudioEnabledValue ¶ added in v0.2.7
func (c MediaToolsConfig) AudioEnabledValue() bool
func (MediaToolsConfig) EnabledValue ¶ added in v0.2.7
func (c MediaToolsConfig) EnabledValue() bool
func (MediaToolsConfig) ImageEnabledValue ¶ added in v0.2.7
func (c MediaToolsConfig) ImageEnabledValue() 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 SkillsRegistryConfig ¶ added in v0.2.9
type SkillsRegistryConfig struct {
BaseURL string `json:"baseURL,omitempty"`
AuthToken string `json:"authToken,omitempty"`
SearchPath string `json:"searchPath,omitempty"`
SkillsPath string `json:"skillsPath,omitempty"`
DownloadPath string `json:"downloadPath,omitempty"`
TimeoutSec int `json:"timeoutSec,omitempty"`
MaxZipBytes int64 `json:"maxZipBytes,omitempty"`
MaxResponseBytes int64 `json:"maxResponseBytes,omitempty"`
}
type SkillsToolsConfig ¶ added in v0.2.9
type SkillsToolsConfig struct {
Enabled *bool `json:"enabled,omitempty"`
MaxResults int `json:"maxResults,omitempty"`
Registry SkillsRegistryConfig `json:"registry"`
}
func (SkillsToolsConfig) EnabledValue ¶ added in v0.2.9
func (c SkillsToolsConfig) 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"`
Skills SkillsToolsConfig `json:"skills"`
Media MediaToolsConfig `json:"media"`
}
func (ToolsConfig) RestrictToWorkspaceValue ¶
func (c ToolsConfig) RestrictToWorkspaceValue() bool
type WebToolsConfig ¶
type WebToolsConfig struct {
BraveAPIKey string `json:"braveApiKey"`
AllowedDomains []string `json:"allowedDomains,omitempty"`
BlockedDomains []string `json:"blockedDomains,omitempty"`
MaxResponseBytes int64 `json:"maxResponseBytes,omitempty"`
FetchTimeoutSec int `json:"fetchTimeoutSec,omitempty"`
}
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.