🔧 refactor: Optimize Agent Tool Loading and Fix Bedrock Tool Handling (#4641)

* fix: bedrock tool name regex

* fix: pass args as single input, attempt json first.

* refactor: remove toolMap from agent tool load as is not used

* fix: update formatAgentMessages test to use strictEqual for args comparison, testing new behavior
This commit is contained in:
Danny Avila 2024-11-05 11:24:26 -05:00 committed by GitHub
parent 3428c3c647
commit 0c2a583df8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 11 additions and 18 deletions

View file

@ -461,7 +461,6 @@ class AgentClient extends BaseClient {
req: this.options.req,
agent: this.options.agent,
tools: this.options.tools,
toolMap: this.options.toolMap,
runId: this.responseMessageId,
modelOptions: this.modelOptions,
customHandlers: this.options.eventHandlers,

View file

@ -18,7 +18,6 @@ const { providerEndpointMap } = require('librechat-data-provider');
* @param {string | undefined} [options.runId] - Optional run ID; otherwise, a new run ID will be generated.
* @param {Agent} options.agent - The agent for this run.
* @param {StructuredTool[] | undefined} [options.tools] - The tools to use in the run.
* @param {Record<string, StructuredTool[]> | undefined} [options.toolMap] - The tool map for the run.
* @param {Record<GraphEvents, EventHandler> | undefined} [options.customHandlers] - Custom event handlers.
* @param {ClientOptions} [options.modelOptions] - Optional model to use; if not provided, it will use the default from modelMap.
* @param {boolean} [options.streaming=true] - Whether to use streaming.
@ -29,7 +28,6 @@ async function createRun({
runId,
tools,
agent,
toolMap,
modelOptions,
customHandlers,
streaming = true,
@ -47,7 +45,6 @@ async function createRun({
const graphConfig = {
tools,
toolMap,
llmConfig,
instructions: agent.instructions,
additional_instructions: agent.additional_instructions,