mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-17 07:55:32 +01:00
🔍 feat: Anthropic Web Search (#8281)
* chore: bump @librechat/agents to ^2.4.54 for anthropic web search support * WIP: hardcoded web search tool usage * feat: Implement web search functionality in Anthropic integration - Updated parameters panel to include web search for anthropic models. - Updated necessary schemas to accomodate toggle functionality * chore: Set default web search option to false in anthropicSettings * refactor: Rename webSearch to web_search for consistency across settings and schemas * chore: bump @librechat/agents to v2.4.55 --------- Co-authored-by: Dustin Healy <dustinhealy1@gmail.com>
This commit is contained in:
parent
5b392f9cb0
commit
e60c0cf201
9 changed files with 59 additions and 17 deletions
|
|
@ -381,6 +381,19 @@ const anthropic: Record<string, SettingDefinition> = {
|
|||
optionType: 'conversation',
|
||||
columnSpan: 2,
|
||||
},
|
||||
web_search: {
|
||||
key: 'web_search',
|
||||
label: 'com_ui_web_search',
|
||||
labelCode: true,
|
||||
description: 'com_endpoint_anthropic_use_web_search',
|
||||
descriptionCode: true,
|
||||
type: 'boolean',
|
||||
default: anthropicSettings.web_search.default,
|
||||
component: 'switch',
|
||||
optionType: 'conversation',
|
||||
showDefault: false,
|
||||
columnSpan: 2,
|
||||
},
|
||||
};
|
||||
|
||||
const bedrock: Record<string, SettingDefinition> = {
|
||||
|
|
@ -649,6 +662,7 @@ const anthropicConfig: SettingsConfiguration = [
|
|||
anthropic.promptCache,
|
||||
anthropic.thinking,
|
||||
anthropic.thinkingBudget,
|
||||
anthropic.web_search,
|
||||
];
|
||||
|
||||
const anthropicCol1: SettingsConfiguration = [
|
||||
|
|
@ -667,6 +681,7 @@ const anthropicCol2: SettingsConfiguration = [
|
|||
anthropic.promptCache,
|
||||
anthropic.thinking,
|
||||
anthropic.thinkingBudget,
|
||||
anthropic.web_search,
|
||||
];
|
||||
|
||||
const bedrockAnthropic: SettingsConfiguration = [
|
||||
|
|
|
|||
|
|
@ -352,6 +352,9 @@ export const anthropicSettings = {
|
|||
default: LEGACY_ANTHROPIC_MAX_OUTPUT,
|
||||
},
|
||||
},
|
||||
web_search: {
|
||||
default: false as const,
|
||||
},
|
||||
};
|
||||
|
||||
export const agentsSettings = {
|
||||
|
|
@ -634,7 +637,7 @@ export const tConversationSchema = z.object({
|
|||
reasoning_summary: eReasoningSummarySchema.optional().nullable(),
|
||||
/* OpenAI: use Responses API */
|
||||
useResponsesApi: z.boolean().optional(),
|
||||
/* OpenAI: use Responses API with Web Search */
|
||||
/* OpenAI Responses API / Anthropic API */
|
||||
web_search: z.boolean().optional(),
|
||||
/* Google: use Search Grounding */
|
||||
grounding: z.boolean().optional(),
|
||||
|
|
@ -742,6 +745,8 @@ export const tQueryParamsSchema = tConversationSchema
|
|||
useResponsesApi: true,
|
||||
/** @endpoints google */
|
||||
grounding: true,
|
||||
/** @endpoints openAI, anthropic */
|
||||
web_search: true,
|
||||
/** @endpoints google, anthropic, bedrock */
|
||||
topP: true,
|
||||
/** @endpoints google, anthropic */
|
||||
|
|
@ -1117,6 +1122,7 @@ export const anthropicBaseSchema = tConversationSchema.pick({
|
|||
greeting: true,
|
||||
spec: true,
|
||||
maxContextTokens: true,
|
||||
web_search: true,
|
||||
});
|
||||
|
||||
export const anthropicSchema = anthropicBaseSchema
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue