diff --git a/api/package.json b/api/package.json
index fd002d58ce..6621b37fd9 100644
--- a/api/package.json
+++ b/api/package.json
@@ -48,7 +48,7 @@
"@langchain/google-genai": "^0.2.13",
"@langchain/google-vertexai": "^0.2.13",
"@langchain/textsplitters": "^0.1.0",
- "@librechat/agents": "^2.4.49",
+ "@librechat/agents": "^2.4.50",
"@librechat/api": "*",
"@librechat/data-schemas": "*",
"@node-saml/passport-saml": "^5.0.0",
diff --git a/api/server/services/Endpoints/agents/agent.js b/api/server/services/Endpoints/agents/agent.js
index a3523605db..469cacd0e4 100644
--- a/api/server/services/Endpoints/agents/agent.js
+++ b/api/server/services/Endpoints/agents/agent.js
@@ -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,
};
};
diff --git a/client/src/components/Messages/Content/Error.tsx b/client/src/components/Messages/Content/Error.tsx
index 8a9391ccda..77580a3737 100644
--- a/client/src/components/Messages/Content/Error.tsx
+++ b/client/src/components/Messages/Content/Error.tsx
@@ -62,6 +62,7 @@ const errorMessages = {
const { info } = json;
return info;
},
+ [ErrorTypes.GOOGLE_TOOL_CONFLICT]: 'com_error_google_tool_conflict',
[ViolationTypes.BAN]:
'Your account has been temporarily banned due to violations of our service.',
invalid_api_key:
diff --git a/client/src/components/SidePanel/Parameters/DynamicSwitch.tsx b/client/src/components/SidePanel/Parameters/DynamicSwitch.tsx
index a603ffe89d..eff11f3453 100644
--- a/client/src/components/SidePanel/Parameters/DynamicSwitch.tsx
+++ b/client/src/components/SidePanel/Parameters/DynamicSwitch.tsx
@@ -50,7 +50,7 @@ function DynamicSwitch({