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
- create a new anthropic agent
- add new handler method to the agent
- route request with orchestrator and pass four params, with fourth one being the additional params
- Expected the additional params to be available in the tool handler method