feat: support custon endpint for Firecrawl

This commit is contained in:
AnotiaWang
2025-02-18 14:36:59 +08:00
parent f593546864
commit daf65889b3
5 changed files with 58 additions and 11 deletions

View File

@ -19,12 +19,13 @@ type WebSearchFunction = (
) => Promise<WebSearchResult[]>
export const useWebSearch = (): WebSearchFunction => {
const { config } = useConfigStore()
const { config, webSearchApiBase } = useConfigStore()
switch (config.webSearch.provider) {
case 'firecrawl': {
const fc = new Firecrawl({
apiKey: config.webSearch.apiKey,
apiUrl: webSearchApiBase,
})
return async (q: string, o: WebSearchOptions) => {
const results = await fc.search(q, o)