🐛 fix: Prevent Default Values in OpenAI/Custom Endpoint Agents (#5180)

* fix: prevent OpenAI/custom-endpoint agents from using default values

* fix: order of assigning client options

* chore: typing for runnable config
This commit is contained in:
Danny Avila 2025-01-04 09:41:59 -05:00 committed by GitHub
parent c26b54c74d
commit 7c61115a88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -44,7 +44,7 @@
"@langchain/google-genai": "^0.1.6", "@langchain/google-genai": "^0.1.6",
"@langchain/google-vertexai": "^0.1.6", "@langchain/google-vertexai": "^0.1.6",
"@langchain/textsplitters": "^0.1.0", "@langchain/textsplitters": "^0.1.0",
"@librechat/agents": "^1.9.92", "@librechat/agents": "^1.9.94",
"axios": "^1.7.7", "axios": "^1.7.7",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"cheerio": "^1.0.0-rc.12", "cheerio": "^1.0.0-rc.12",

View file

@ -40,6 +40,7 @@ const { createRun } = require('./run');
const { logger } = require('~/config'); const { logger } = require('~/config');
/** @typedef {import('@librechat/agents').MessageContentComplex} MessageContentComplex */ /** @typedef {import('@librechat/agents').MessageContentComplex} MessageContentComplex */
/** @typedef {import('@langchain/core/runnables').RunnableConfig} RunnableConfig */
const providerParsers = { const providerParsers = {
[EModelEndpoint.openAI]: openAISchema, [EModelEndpoint.openAI]: openAISchema,
@ -488,6 +489,7 @@ class AgentClient extends BaseClient {
// }); // });
// } // }
/** @type {Partial<RunnableConfig> & { version: 'v1' | 'v2'; run_id?: string; streamMode: string }} */
const config = { const config = {
configurable: { configurable: {
thread_id: this.conversationId, thread_id: this.conversationId,

8
package-lock.json generated
View file

@ -53,7 +53,7 @@
"@langchain/google-genai": "^0.1.6", "@langchain/google-genai": "^0.1.6",
"@langchain/google-vertexai": "^0.1.6", "@langchain/google-vertexai": "^0.1.6",
"@langchain/textsplitters": "^0.1.0", "@langchain/textsplitters": "^0.1.0",
"@librechat/agents": "^1.9.92", "@librechat/agents": "^1.9.94",
"axios": "^1.7.7", "axios": "^1.7.7",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"cheerio": "^1.0.0-rc.12", "cheerio": "^1.0.0-rc.12",
@ -643,9 +643,9 @@
} }
}, },
"api/node_modules/@librechat/agents": { "api/node_modules/@librechat/agents": {
"version": "1.9.92", "version": "1.9.94",
"resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-1.9.92.tgz", "resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-1.9.94.tgz",
"integrity": "sha512-kWkUf3/ZVKbrg/BlFH5XJzafyzuUSC2JVBRdI7WJUGmbto1Wxx+LdMy0A8k665gReRjg3ebqbZxo7NqUH9uxlw==", "integrity": "sha512-v/f2WmBKfP7PcMeKQn0BuzdxLkgZ5BXi3dx1jXLwWTM/1Qmtjrb1dGdZ+z3jIdsq9f86tSCbgCyO5dzTI9H4Hw==",
"dependencies": { "dependencies": {
"@aws-crypto/sha256-js": "^5.2.0", "@aws-crypto/sha256-js": "^5.2.0",
"@aws-sdk/credential-provider-node": "^3.613.0", "@aws-sdk/credential-provider-node": "^3.613.0",