mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
🔍 feat: Add Serper as Scraper Provider and Firecrawl Version Support (#9984)
* 🔧 chore: Update @librechat/agents to v2.4.84 in package.json and package-lock.json
* feat: Serper as new scraperProvider for Web Search and add firecrawlVersion support
* fix: TWebSearchKeys and ensure unique API keys extraction
* chore: Add build:packages script to streamline package builds
This commit is contained in:
parent
857c054a9a
commit
31a283a4fe
14 changed files with 247 additions and 47 deletions
|
|
@ -2,10 +2,10 @@ import { useState } from 'react';
|
|||
import { Button, OGDialog, OGDialogTemplate } from '@librechat/client';
|
||||
import {
|
||||
AuthType,
|
||||
SearchCategories,
|
||||
RerankerTypes,
|
||||
SearchProviders,
|
||||
ScraperTypes,
|
||||
ScraperProviders,
|
||||
SearchCategories,
|
||||
} from 'librechat-data-provider';
|
||||
import type { SearchApiKeyFormData } from '~/hooks/Plugins/useAuthSearchTool';
|
||||
import type { UseFormRegister, UseFormHandleSubmit } from 'react-hook-form';
|
||||
|
|
@ -45,7 +45,9 @@ export default function ApiKeyDialog({
|
|||
const [selectedReranker, setSelectedReranker] = useState(
|
||||
config?.webSearch?.rerankerType || RerankerTypes.JINA,
|
||||
);
|
||||
const [selectedScraper, setSelectedScraper] = useState(ScraperTypes.FIRECRAWL);
|
||||
const [selectedScraper, setSelectedScraper] = useState(
|
||||
config?.webSearch?.scraperProvider || ScraperProviders.FIRECRAWL,
|
||||
);
|
||||
|
||||
const providerOptions: DropdownOption[] = [
|
||||
{
|
||||
|
|
@ -119,7 +121,7 @@ export default function ApiKeyDialog({
|
|||
|
||||
const scraperOptions: DropdownOption[] = [
|
||||
{
|
||||
key: ScraperTypes.FIRECRAWL,
|
||||
key: ScraperProviders.FIRECRAWL,
|
||||
label: localize('com_ui_web_search_scraper_firecrawl'),
|
||||
inputs: {
|
||||
firecrawlApiUrl: {
|
||||
|
|
@ -136,6 +138,20 @@ export default function ApiKeyDialog({
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
key: ScraperProviders.SERPER,
|
||||
label: localize('com_ui_web_search_scraper_serper'),
|
||||
inputs: {
|
||||
serperApiKey: {
|
||||
placeholder: localize('com_ui_enter_api_key'),
|
||||
type: 'password' as const,
|
||||
link: {
|
||||
url: 'https://serper.dev/api-keys',
|
||||
text: localize('com_ui_web_search_scraper_serper_key'),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const [dropdownOpen, setDropdownOpen] = useState({
|
||||
|
|
@ -157,7 +173,7 @@ export default function ApiKeyDialog({
|
|||
};
|
||||
|
||||
const handleScraperChange = (key: string) => {
|
||||
setSelectedScraper(key as ScraperTypes);
|
||||
setSelectedScraper(key as ScraperProviders);
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -198,7 +214,7 @@ export default function ApiKeyDialog({
|
|||
selectedKey={selectedScraper}
|
||||
onSelectionChange={handleScraperChange}
|
||||
dropdownOptions={scraperOptions}
|
||||
showDropdown={!config?.webSearch?.scraperType}
|
||||
showDropdown={!config?.webSearch?.scraperProvider}
|
||||
register={register}
|
||||
dropdownOpen={dropdownOpen.scraper}
|
||||
setDropdownOpen={(open) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue