mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔍 feat: Add Google Search Grounding Toggle (#8174)
* ✨ feat: Add Google Search Grounding Feature and Update Agent Tool Initialization - Introduced a new grounding option in the Google configuration to enable real-time web search results. - Updated the agent initialization to concatenate additional tools from options. - Enhanced translation files to include descriptions for the new grounding feature. - Modified relevant schemas and parameter settings to support the grounding functionality. * 🔑 chore: Update @librechat/agents dependency to version 2.4.50 * ✅ fix: Ensure tools array is initialized before concatenation in initializeAgent function * chore: Update version of librechat-data-provider to 0.7.899 and add GOOGLE_TOOL_CONFLICT error type * fix: Adjust label class for better text wrapping in DynamicSwitch component * fix: Handle Google tool conflict error and update error messages in translation * fix: Restore grounding setting in googleCol2 configuration --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
8a5dbac0f9
commit
738d04fac4
13 changed files with 59 additions and 11 deletions
|
|
@ -140,6 +140,14 @@ const initializeAgent = async ({
|
|||
agent.provider = options.provider;
|
||||
}
|
||||
|
||||
if (
|
||||
(agent.provider === Providers.GOOGLE || agent.provider === Providers.VERTEXAI) &&
|
||||
options?.tools?.length &&
|
||||
tools?.length
|
||||
) {
|
||||
throw new Error(`{ "type": "${ErrorTypes.GOOGLE_TOOL_CONFLICT}"}`);
|
||||
}
|
||||
|
||||
/** @type {import('@librechat/agents').ClientOptions} */
|
||||
agent.model_parameters = { ...options.llmConfig };
|
||||
if (options.configOptions) {
|
||||
|
|
@ -162,10 +170,10 @@ const initializeAgent = async ({
|
|||
|
||||
return {
|
||||
...agent,
|
||||
tools,
|
||||
attachments,
|
||||
resendFiles,
|
||||
toolContextMap,
|
||||
tools: options.tools ?? tools,
|
||||
maxContextTokens: (agentMaxContextTokens - maxTokens) * 0.9,
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue