fix: config validation for Firecrawl

This commit is contained in:
AnotiaWang
2025-02-19 13:45:41 +08:00
parent e7ea6ffb19
commit 599515e52e

View File

@ -39,7 +39,9 @@ function validateConfig(config: Config) {
if (typeof ai.contextSize !== 'undefined' && ai.contextSize < 0) return false if (typeof ai.contextSize !== 'undefined' && ai.contextSize < 0) return false
const ws = config.webSearch 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) if (typeof ws.concurrencyLimit !== 'undefined' && ws.concurrencyLimit! < 1)
return false return false
return true return true