From 599515e52eee3d730eaf942894b0d495432df633 Mon Sep 17 00:00:00 2001 From: AnotiaWang Date: Wed, 19 Feb 2025 13:45:41 +0800 Subject: [PATCH] fix: config validation for Firecrawl --- stores/config.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stores/config.ts b/stores/config.ts index 2481a34..cf30f37 100644 --- a/stores/config.ts +++ b/stores/config.ts @@ -39,7 +39,9 @@ function validateConfig(config: Config) { if (typeof ai.contextSize !== 'undefined' && ai.contextSize < 0) return false const ws = config.webSearch - if (!ws.apiKey) return false + if (ws.provider === 'tavily' && !ws.apiKey) return false + // Either apiBase or apiKey is required for firecrawl + if (ws.provider === 'firecrawl' && !ws.apiBase && !ws.apiKey) return false if (typeof ws.concurrencyLimit !== 'undefined' && ws.concurrencyLimit! < 1) return false return true