Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shabin5785 opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@shabin5785
Copy link

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
@shabin5785 shabin5785 added the bug Something isn't working label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant