Move Firecrawl API key from top-level config into Agents.Tools
Firecrawl is a tool used by agents (tracker mapping, third-party assessor), so its configuration belongs under AgentsConfig rather than as a standalone Config field. Adds AgentToolsConfig to hold agent tool credentials and updates all config propagation consumers. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -176,9 +176,6 @@ func (b *Builder) Build() (*probodconfig.FullConfig, error) {
|
||||
CacheTTL: b.getEnvIntOrDefault("WEBHOOK_CACHE_TTL", 86400),
|
||||
},
|
||||
},
|
||||
Firecrawl: probodconfig.FirecrawlConfig{
|
||||
APIKey: b.getEnv("FIRECRAWL_API_KEY"),
|
||||
},
|
||||
Agents: probodconfig.AgentsConfig{
|
||||
Providers: map[string]probodconfig.LLMProviderConfig{
|
||||
"openai": {
|
||||
@@ -214,6 +211,9 @@ func (b *Builder) Build() (*probodconfig.FullConfig, error) {
|
||||
Temperature: b.getEnvFloatPtr("AGENT_TRACKER_MAPPING_TEMPERATURE"),
|
||||
MaxTokens: b.getEnvIntPtr("AGENT_TRACKER_MAPPING_MAX_TOKENS"),
|
||||
},
|
||||
Tools: probodconfig.AgentToolsConfig{
|
||||
FirecrawlAPIKey: b.getEnv("FIRECRAWL_API_KEY"),
|
||||
},
|
||||
},
|
||||
CustomDomains: probodconfig.CustomDomainsConfig{
|
||||
RenewalInterval: b.getEnvIntOrDefault("CUSTOM_DOMAINS_RENEWAL_INTERVAL", 3600),
|
||||
|
||||
@@ -197,8 +197,8 @@ func TestBuilder_Build_Defaults(t *testing.T) {
|
||||
assert.Equal(t, 5, cfg.Probod.Notifications.Webhook.SenderInterval)
|
||||
assert.Equal(t, 86400, cfg.Probod.Notifications.Webhook.CacheTTL)
|
||||
|
||||
// Firecrawl — empty by default
|
||||
assert.Empty(t, cfg.Probod.Firecrawl.APIKey)
|
||||
// Agents tools — Firecrawl empty by default
|
||||
assert.Empty(t, cfg.Probod.Agents.Tools.FirecrawlAPIKey)
|
||||
|
||||
// Agents config — default
|
||||
assert.Equal(t, "openai", cfg.Probod.Agents.Default.Provider)
|
||||
@@ -378,8 +378,8 @@ func TestBuilder_Build_CustomValues(t *testing.T) {
|
||||
assert.Equal(t, "slack-signing-secret", cfg.Probod.Notifications.Slack.SigningSecret)
|
||||
assert.Equal(t, 10, cfg.Probod.Notifications.Webhook.SenderInterval)
|
||||
assert.Equal(t, 3600, cfg.Probod.Notifications.Webhook.CacheTTL)
|
||||
// Firecrawl
|
||||
assert.Equal(t, "fc-test-key", cfg.Probod.Firecrawl.APIKey)
|
||||
// Agents tools — Firecrawl
|
||||
assert.Equal(t, "fc-test-key", cfg.Probod.Agents.Tools.FirecrawlAPIKey)
|
||||
// Agents — providers
|
||||
assert.Equal(t, "openai", cfg.Probod.Agents.Providers["openai"].Type)
|
||||
assert.Equal(t, "sk-test-key", cfg.Probod.Agents.Providers["openai"].APIKey)
|
||||
|
||||
Reference in New Issue
Block a user