From 35f548a94d391b8dc06db1889d6bc7b98c2ac2cc Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Sun, 6 Jul 2025 21:41:51 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=84=20refactor:=20Google=20`grounding`?= =?UTF-8?q?=20field=20to=20`web=5Fsearch`=20for=20Consistency=20(#8285)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated the Google configuration and related schemas to replace 'grounding' with 'web_search' for consistency. - Adjusted the logic in the getGoogleConfig function to reflect the new naming convention. - Ensured all references in parameter settings and conversation schemas are updated accordingly. --- packages/api/src/endpoints/google/llm.ts | 4 ++-- packages/data-provider/src/parameterSettings.ts | 8 ++++---- packages/data-provider/src/schemas.ts | 12 ++++-------- packages/data-schemas/src/types/convo.ts | 1 - 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/packages/api/src/endpoints/google/llm.ts b/packages/api/src/endpoints/google/llm.ts index e76075f44..0f82ce042 100644 --- a/packages/api/src/endpoints/google/llm.ts +++ b/packages/api/src/endpoints/google/llm.ts @@ -106,7 +106,7 @@ export function getGoogleConfig( const authHeader = options.authHeader; const { - grounding, + web_search, thinking = googleSettings.thinking.default, thinkingBudget = googleSettings.thinkingBudget.default, ...modelOptions @@ -191,7 +191,7 @@ export function getGoogleConfig( const tools: GoogleAIToolType[] = []; - if (grounding) { + if (web_search) { tools.push({ googleSearch: {} }); } diff --git a/packages/data-provider/src/parameterSettings.ts b/packages/data-provider/src/parameterSettings.ts index 545e29c78..f01ad6139 100644 --- a/packages/data-provider/src/parameterSettings.ts +++ b/packages/data-provider/src/parameterSettings.ts @@ -563,8 +563,8 @@ const google: Record = { optionType: 'conversation', columnSpan: 2, }, - grounding: { - key: 'grounding', + web_search: { + key: 'web_search', label: 'com_endpoint_use_search_grounding', labelCode: true, description: 'com_endpoint_google_use_search_grounding', @@ -589,7 +589,7 @@ const googleConfig: SettingsConfiguration = [ librechat.resendFiles, google.thinking, google.thinkingBudget, - google.grounding, + google.web_search, ]; const googleCol1: SettingsConfiguration = [ @@ -607,7 +607,7 @@ const googleCol2: SettingsConfiguration = [ librechat.resendFiles, google.thinking, google.thinkingBudget, - google.grounding, + google.web_search, ]; const openAI: SettingsConfiguration = [ diff --git a/packages/data-provider/src/schemas.ts b/packages/data-provider/src/schemas.ts index 1ebac7238..3ea250f4a 100644 --- a/packages/data-provider/src/schemas.ts +++ b/packages/data-provider/src/schemas.ts @@ -637,10 +637,8 @@ export const tConversationSchema = z.object({ reasoning_summary: eReasoningSummarySchema.optional().nullable(), /* OpenAI: use Responses API */ useResponsesApi: z.boolean().optional(), - /* OpenAI Responses API / Anthropic API */ + /* OpenAI Responses API / Anthropic API / Google API */ web_search: z.boolean().optional(), - /* Google: use Search Grounding */ - grounding: z.boolean().optional(), /* assistant */ assistant_id: z.string().optional(), /* agents */ @@ -743,9 +741,7 @@ export const tQueryParamsSchema = tConversationSchema reasoning_summary: true, /** @endpoints openAI, custom, azureOpenAI */ useResponsesApi: true, - /** @endpoints google */ - grounding: true, - /** @endpoints openAI, anthropic */ + /** @endpoints openAI, anthropic, google */ web_search: true, /** @endpoints google, anthropic, bedrock */ topP: true, @@ -829,7 +825,7 @@ export const googleBaseSchema = tConversationSchema.pick({ topK: true, thinking: true, thinkingBudget: true, - grounding: true, + web_search: true, iconURL: true, greeting: true, spec: true, @@ -861,7 +857,7 @@ export const googleGenConfigSchema = z thinkingBudget: coerceNumber.optional(), }) .optional(), - grounding: z.boolean().optional(), + web_search: z.boolean().optional(), }) .strip() .optional(); diff --git a/packages/data-schemas/src/types/convo.ts b/packages/data-schemas/src/types/convo.ts index 177c140fb..f7e58508f 100644 --- a/packages/data-schemas/src/types/convo.ts +++ b/packages/data-schemas/src/types/convo.ts @@ -48,7 +48,6 @@ export interface IConversation extends Document { reasoning_summary?: string; useResponsesApi?: boolean; web_search?: boolean; - grounding?: boolean; // Additional fields files?: string[]; expiredAt?: Date;