From bf0a84e45ae7bc61eb87de626af45a511e0a13f3 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 3 Jan 2025 16:50:00 -0500 Subject: [PATCH] =?UTF-8?q?=C2=AE=EF=B8=8F=20feat:=20Support=20Rscript=20f?= =?UTF-8?q?or=20Code=20Interpreter=20&=20`recursionLimit`=20for=20Agents?= =?UTF-8?q?=20(#5170)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: bump @librechat/agents to v1.9.8 for rscript support * chore: fix @langchain/google-genai dep., match agents * chore: fix @langchain/google-vertexai to v0.1.5, match with agents * chore: bump @librechat/agents to v1.9.9 * chore: update @librechat/agents to v1.9.91 and @langchain/google-vertexai to v0.1.6 * chore: increase MAX_FILE_SIZE to 150MB for file uploads * chore: bump @librechat/agents to v1.9.92 * feat: support `recursionLimit` for agents * chore: update configuration version to 1.2.1 in librechat.yaml and config.ts * feat: add R language SVG icon to the assets and include it in ApiKeyDialog * feat: add support for new vision model 'o1' and exclude 'o1-mini' --- api/package.json | 6 +- api/server/controllers/agents/client.js | 1 + api/server/services/Files/Code/crud.js | 2 +- client/public/assets/r.svg | 1 + .../SidePanel/Agents/Code/ApiKeyDialog.tsx | 1 + librechat.example.yaml | 5 +- package-lock.json | 103 +++++------------- packages/data-provider/package.json | 2 +- packages/data-provider/src/config.ts | 6 +- 9 files changed, 46 insertions(+), 81 deletions(-) create mode 100644 client/public/assets/r.svg diff --git a/api/package.json b/api/package.json index 5ff68951ad..c0bf78e08e 100644 --- a/api/package.json +++ b/api/package.json @@ -41,10 +41,10 @@ "@keyv/redis": "^2.8.1", "@langchain/community": "^0.3.14", "@langchain/core": "^0.3.18", - "@langchain/google-genai": "^0.1.4", - "@langchain/google-vertexai": "^0.1.4", + "@langchain/google-genai": "^0.1.6", + "@langchain/google-vertexai": "^0.1.6", "@langchain/textsplitters": "^0.1.0", - "@librechat/agents": "^1.9.7", + "@librechat/agents": "^1.9.92", "axios": "^1.7.7", "bcryptjs": "^2.4.3", "cheerio": "^1.0.0-rc.12", diff --git a/api/server/controllers/agents/client.js b/api/server/controllers/agents/client.js index 450accb8ae..32e2b91c3e 100644 --- a/api/server/controllers/agents/client.js +++ b/api/server/controllers/agents/client.js @@ -494,6 +494,7 @@ class AgentClient extends BaseClient { last_agent_index: this.agentConfigs?.size ?? 0, hide_sequential_outputs: this.options.agent.hide_sequential_outputs, }, + recursionLimit: this.options.req.app.locals[EModelEndpoint.agents]?.recursionLimit, signal: abortController.signal, streamMode: 'values', version: 'v2', diff --git a/api/server/services/Files/Code/crud.js b/api/server/services/Files/Code/crud.js index 07d09548ab..076a4d9f13 100644 --- a/api/server/services/Files/Code/crud.js +++ b/api/server/services/Files/Code/crud.js @@ -3,7 +3,7 @@ const axios = require('axios'); const FormData = require('form-data'); const { getCodeBaseURL } = require('@librechat/agents'); -const MAX_FILE_SIZE = 25 * 1024 * 1024; +const MAX_FILE_SIZE = 150 * 1024 * 1024; /** * Retrieves a download stream for a specified file. diff --git a/client/public/assets/r.svg b/client/public/assets/r.svg new file mode 100644 index 0000000000..39c03e1b33 --- /dev/null +++ b/client/public/assets/r.svg @@ -0,0 +1 @@ +R \ No newline at end of file diff --git a/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx b/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx index ae0e76c324..9e199c3cb5 100644 --- a/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx +++ b/client/src/components/SidePanel/Agents/Code/ApiKeyDialog.tsx @@ -34,6 +34,7 @@ export default function ApiKeyDialog({ 'cplusplus.svg', 'php.svg', 'fortran.svg', + 'r.svg', ]; return ( diff --git a/librechat.example.yaml b/librechat.example.yaml index a864c7bc8a..505208e5e5 100644 --- a/librechat.example.yaml +++ b/librechat.example.yaml @@ -2,7 +2,7 @@ # https://www.librechat.ai/docs/configuration/librechat_yaml # Configuration version (required) -version: 1.2.0 +version: 1.2.1 # Cache settings: Set to true to enable caching cache: true @@ -149,6 +149,9 @@ endpoints: # # (optional) Assistant Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below. # capabilities: ["code_interpreter", "retrieval", "actions", "tools", "image_vision"] # agents: + # (optional) Maximum recursion depth for agents, defaults to 25 + # recursionLimit: 50 + # (optional) Disable the builder interface for agents # disableBuilder: false # (optional) Agent Capabilities available to all users. Omit the ones you wish to exclude. Defaults to list below. # capabilities: ["execute_code", "file_search", "actions", "tools"] diff --git a/package-lock.json b/package-lock.json index f9a9e32b27..25dbb76784 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,10 +50,10 @@ "@keyv/redis": "^2.8.1", "@langchain/community": "^0.3.14", "@langchain/core": "^0.3.18", - "@langchain/google-genai": "^0.1.4", - "@langchain/google-vertexai": "^0.1.4", + "@langchain/google-genai": "^0.1.6", + "@langchain/google-vertexai": "^0.1.6", "@langchain/textsplitters": "^0.1.0", - "@librechat/agents": "^1.9.7", + "@librechat/agents": "^1.9.92", "axios": "^1.7.7", "bcryptjs": "^2.4.3", "cheerio": "^1.0.0-rc.12", @@ -628,35 +628,6 @@ } } }, - "api/node_modules/@langchain/google-genai": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@langchain/google-genai/-/google-genai-0.1.4.tgz", - "integrity": "sha512-b8qrqnHYbNseaAikrWyxuDTww6CUIse82F5/BmF2GtWVR25yJrNUWETfTp7o7iIMxhFR0PuQag4gEZOL74F5Tw==", - "dependencies": { - "@google/generative-ai": "^0.21.0", - "zod-to-json-schema": "^3.22.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@langchain/core": ">=0.3.17 <0.4.0" - } - }, - "api/node_modules/@langchain/google-vertexai": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/@langchain/google-vertexai/-/google-vertexai-0.1.4.tgz", - "integrity": "sha512-x78wezYBOxmiMOPSatlCk4UOQd6RPxz2YVfGKLOzNV89xxHrEVX9JcyRUCx4L568S4kqZYkLvnqzZA9AF/TCaA==", - "dependencies": { - "@langchain/google-gauth": "~0.1.4" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "@langchain/core": ">=0.2.21 <0.4.0" - } - }, "api/node_modules/@langchain/textsplitters": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@langchain/textsplitters/-/textsplitters-0.1.0.tgz", @@ -672,19 +643,19 @@ } }, "api/node_modules/@librechat/agents": { - "version": "1.9.7", - "resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-1.9.7.tgz", - "integrity": "sha512-FprbiuQrjV3ULOmvOl2HpMnWJhV6BC0TqyUt6/mkpqBZVhPxjzzTBAiE/X3tIOOKAHcjORNaZVibGwV3s0U4Mw==", + "version": "1.9.92", + "resolved": "https://registry.npmjs.org/@librechat/agents/-/agents-1.9.92.tgz", + "integrity": "sha512-kWkUf3/ZVKbrg/BlFH5XJzafyzuUSC2JVBRdI7WJUGmbto1Wxx+LdMy0A8k665gReRjg3ebqbZxo7NqUH9uxlw==", "dependencies": { "@aws-crypto/sha256-js": "^5.2.0", "@aws-sdk/credential-provider-node": "^3.613.0", "@aws-sdk/types": "^3.609.0", "@langchain/anthropic": "^0.3.11", - "@langchain/aws": "^0.1.2", + "@langchain/aws": "^0.1.3", "@langchain/community": "^0.3.14", "@langchain/core": "^0.3.26", "@langchain/google-genai": "^0.1.6", - "@langchain/google-vertexai": "^0.1.5", + "@langchain/google-vertexai": "^0.1.6", "@langchain/langgraph": "^0.2.34", "@langchain/mistralai": "^0.0.26", "@langchain/ollama": "^0.1.1", @@ -9222,9 +9193,9 @@ } }, "node_modules/@langchain/aws": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@langchain/aws/-/aws-0.1.2.tgz", - "integrity": "sha512-1cQvv8XSbaZXceAbYexSm/8WLqfEJ4VF6qbf/XLwkpUKMFGqpSBA00+Bn5p8K/Ms+PyMguZrxVNqd6daqxhDBQ==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@langchain/aws/-/aws-0.1.3.tgz", + "integrity": "sha512-OjS6V/virzRvOX1D2xgTyyHkYzdepjes77dU2bBS53jt4mp0DT8vzgclZQ/16DA20YgNFtMKYiFbOfMI+RTHyg==", "dependencies": { "@aws-sdk/client-bedrock-agent-runtime": "^3.616.0", "@aws-sdk/client-bedrock-runtime": "^3.602.0", @@ -9811,10 +9782,9 @@ } }, "node_modules/@langchain/google-common": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@langchain/google-common/-/google-common-0.1.5.tgz", - "integrity": "sha512-VgTghTTROBPez8TgAD+GWKzfoJ24EaWMjdo3dB69QCVt23ZyNGM8Hk4rm6LgjMxmLFNnXi6UnhQuoece3ffmAA==", - "license": "MIT", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@langchain/google-common/-/google-common-0.1.6.tgz", + "integrity": "sha512-egGLnZ/OYu3hd37cIh7jx+Hx9kdrFpe6ADoLCwOnmRYZHoJ/nV1L+wNRAHVBgWzO5gIt4xL13nlZARTinjTTlA==", "dependencies": { "uuid": "^10.0.0", "zod-to-json-schema": "^3.22.4" @@ -9834,18 +9804,16 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], - "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/@langchain/google-gauth": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@langchain/google-gauth/-/google-gauth-0.1.5.tgz", - "integrity": "sha512-FYqHtW06gRJdImzlh1nyNHtIgp1F4nf1SiOBN5/ynblze2ho523BruFeKprDRR3Iv+CEJm+3v8fRf0QKf9esPw==", - "license": "MIT", + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@langchain/google-gauth/-/google-gauth-0.1.6.tgz", + "integrity": "sha512-3Gg4OK/5rNHwjfJrlnWNAUwfPzx90my4mvF1NPeUMIYOIVa9Rd3ROG/Ep18iimq3ZBjxceoKKNTeyQBvJ71csw==", "dependencies": { - "@langchain/google-common": "~0.1.5", + "@langchain/google-common": "~0.1.6", "google-auth-library": "^8.9.0" }, "engines": { @@ -9859,9 +9827,6 @@ "version": "0.1.6", "resolved": "https://registry.npmjs.org/@langchain/google-genai/-/google-genai-0.1.6.tgz", "integrity": "sha512-LF3fan9pvgFa1vw2/IYGhi5KjppE0OvPFX3QQBUshBLpXWERP+BSpSD7jcXyqm9Kf7DcFj7w5/2knKeEwih8Xg==", - "license": "MIT", - "optional": true, - "peer": true, "dependencies": { "@google/generative-ai": "^0.21.0", "zod-to-json-schema": "^3.22.4" @@ -9874,14 +9839,11 @@ } }, "node_modules/@langchain/google-vertexai": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/@langchain/google-vertexai/-/google-vertexai-0.1.5.tgz", - "integrity": "sha512-wd9mjrQRdlFAnwhCGtHIsOTtuF6Oto8+F8nthU3guU7T/gfuICvg26+MaOpdUmuTVFuIDqVMc0l7kf3ZK4DFlA==", - "license": "MIT", - "optional": true, - "peer": true, + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@langchain/google-vertexai/-/google-vertexai-0.1.6.tgz", + "integrity": "sha512-MU97EPpg+JX9S9zEVxHogkpnE2cxqtDD2NsvK0b8sPER75BTkQkhVprjJy5YWyN7x6I4IkLzQ1EAS8r8GzZiXQ==", "dependencies": { - "@langchain/google-gauth": "~0.1.5" + "@langchain/google-gauth": "~0.1.6" }, "engines": { "node": ">=18" @@ -9891,13 +9853,12 @@ } }, "node_modules/@langchain/langgraph": { - "version": "0.2.36", - "resolved": "https://registry.npmjs.org/@langchain/langgraph/-/langgraph-0.2.36.tgz", - "integrity": "sha512-zxk7ZCVxP0/Ut9785EiXCS7BE7sXd8cu943mcZUF2aNFUaQRTBbbiKpNdR3nb1+xO/B+HVktrJT2VFdkAywnng==", - "license": "MIT", + "version": "0.2.38", + "resolved": "https://registry.npmjs.org/@langchain/langgraph/-/langgraph-0.2.38.tgz", + "integrity": "sha512-mVy99pMftBGgUTBTCepSyzTovWCvpgdNcXsAjxTiMrMX6lzueNiBz0ljkY7UFoIoHYwurQbyl2WmMPFuxkSIAw==", "dependencies": { "@langchain/langgraph-checkpoint": "~0.0.13", - "@langchain/langgraph-sdk": "~0.0.21", + "@langchain/langgraph-sdk": "~0.0.32", "uuid": "^10.0.0", "zod": "^3.23.8" }, @@ -9912,7 +9873,6 @@ "version": "0.0.13", "resolved": "https://registry.npmjs.org/@langchain/langgraph-checkpoint/-/langgraph-checkpoint-0.0.13.tgz", "integrity": "sha512-amdmBcNT8a9xP2VwcEWxqArng4gtRDcnVyVI4DsQIo1Aaz8e8+hH17zSwrUF3pt1pIYztngIfYnBOim31mtKMg==", - "license": "MIT", "dependencies": { "uuid": "^10.0.0" }, @@ -9931,16 +9891,14 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], - "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/@langchain/langgraph-sdk": { - "version": "0.0.32", - "resolved": "https://registry.npmjs.org/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.32.tgz", - "integrity": "sha512-KQyM9kLO7T6AxwNrceajH7JOybP3pYpvUPnhiI2rrVndI1WyZUJ1eVC1e722BVRAPi6o+WcoTT4uMSZVinPOtA==", - "license": "MIT", + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@langchain/langgraph-sdk/-/langgraph-sdk-0.0.33.tgz", + "integrity": "sha512-l/hRbI6roLzplBXy2VyDUwqY1TkK7RcjPmrMUuVdvCCH4LTwLfIXh/G1kHatNiN7VUTskw0FkfBbgq6gtj0ang==", "dependencies": { "@types/json-schema": "^7.0.15", "p-queue": "^6.6.2", @@ -9956,7 +9914,6 @@ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], - "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } @@ -36335,7 +36292,7 @@ }, "packages/data-provider": { "name": "librechat-data-provider", - "version": "0.7.67", + "version": "0.7.68", "license": "ISC", "dependencies": { "axios": "^1.7.7", diff --git a/packages/data-provider/package.json b/packages/data-provider/package.json index d916473ca2..d0573fa8e0 100644 --- a/packages/data-provider/package.json +++ b/packages/data-provider/package.json @@ -1,6 +1,6 @@ { "name": "librechat-data-provider", - "version": "0.7.67", + "version": "0.7.68", "description": "data services for librechat apps", "main": "dist/index.js", "module": "dist/index.es.js", diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.ts index 7a52468274..e879dadf48 100644 --- a/packages/data-provider/src/config.ts +++ b/packages/data-provider/src/config.ts @@ -210,6 +210,7 @@ export type TAssistantEndpoint = z.infer; export const agentsEndpointSChema = baseEndpointSchema.merge( z.object({ /* agents specific */ + recursionLimit: z.number().optional(), disableBuilder: z.boolean().optional(), capabilities: z .array(z.nativeEnum(AgentCapabilities)) @@ -739,6 +740,7 @@ export const supportsBalanceCheck = { }; export const visionModels = [ + 'o1', 'gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', @@ -775,7 +777,7 @@ export function validateVisionModel({ return false; } - if (model === 'gpt-4-turbo-preview') { + if (model.includes('gpt-4-turbo-preview') || model.includes('o1-mini')) { return false; } @@ -1088,7 +1090,7 @@ export enum Constants { /** Key for the app's version. */ VERSION = 'v0.7.6', /** Key for the Custom Config's version (librechat.yaml). */ - CONFIG_VERSION = '1.2.0', + CONFIG_VERSION = '1.2.1', /** Standard value for the first message's `parentMessageId` value, to indicate no parent exists. */ NO_PARENT = '00000000-0000-0000-0000-000000000000', /** Standard value for the initial conversationId before a request is sent */