Skip to content

Bug: Additional Parameters are not being passed on to agent handler method #207

Open
@shabin5785

Description

Expected Behaviour

Orchestrator routeRequest() method has four parameters: _userInput: string, userId: string, sessionId: string, additionalParams?: Record<string, string>_

But in the toolHandler method invoked by inbuilt agents, only two arguments are being passed: The below snippet is from Anthropic agent.

Process request method of the agent signature:
_async processRequest(inputText, userId, sessionId, chatHistory, _additionalParams) {_

And tool invocation is being done as given below:

const toolResponse = await this.toolConfig.useToolHandler(response, messages);

AdditionalParams passed on to processRequest method is not being passed on to the toolHandler. This should be passedon, to allow additional logic to be executed in the handler

Current Behaviour

AdditionalParams are not being passed on the tool handler by the agent.

Code snippet

await orchestrator.routeRequest(request.query, request.user, request.user ,request);
Create new Anthropic Agent:
export const MasterAgent = new AnthropicAgent({...,
toolConfig: {
        useToolHandler: createAgentHandler,
        tool: createAgentToolDescription,
        toolMaxRecursions: 5
    },})

And handler method:
async function createAgentlHandler(response, conversation){}
Fourth param passed on to routerequest method got dropped in between

Possible Solution

Pass the additionalParams as well, as extra parameter to the tool handler method

const toolResponse = await this.toolConfig.useToolHandler(response, messages,_additionalParams );

Steps to Reproduce

  1. create a new anthropic agent
  2. add new handler method to the agent
  3. route request with orchestrator and pass four params, with fourth one being the additional params
  4. Expected the additional params to be available in the tool handler method

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions