Bug: Handling Streaming with SupervisorAgent and TeamMember
Expected Behaviour
I have created an AWS Lambda function using Node.js to enable native streaming responses. The Lambda function leverages an AgentSupervisor composed of multiple BedrockLLMAgent instances.
- The AgentSupervisor is built using BedrockLLMAgent (Claude 3.5 Sonnet).
- It manages a team of BedrockLLMAgents (Claude 3 Haiku).
- Streaming is explicitly set to true for all agents.
The SupervisorAgent should return a streaming response as its underlying agents are all configured for streaming.
Current Behaviour
Despite enabling streaming for all agents, I expect the SupervisorAgent to return a streaming response, but it does not appear to work as expected.
"error": "Error getting stream from Bedrock model: this.toolConfig.useToolHandler is not a function", "stack": "Error: Error getting stream from Bedrock model: this.toolConfig.useToolHandler is not a function\n at MultiAgentOrchestrator.processStreamInBackground (/opt/nodejs/node_modules/multi-agent-orchestrator/dist/orchestrator.js:222:46)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)"
Code snippet
// Create orchestrator
const orchestrator = new MultiAgentOrchestrator();
// Create supervisor (lead agent)
const supervisor = new BedrockLLMAgent({
name: "Team Lead",
description: "Coordinates specialized team members",
modelId: "anthropic.claude-3-5-sonnet-20240620-v1:0",
streaming: true
});
// Create team members
const techAgent = new BedrockLLMAgent({
name: "Tech Support",
description: "Handles technical issues",
modelId: "anthropic.claude-3-haiku-20240307-v1:0",
streaming: true
});
const billingAgent = new BedrockLLMAgent({
name: "Billing Expert",
description: "Handles billing and payment queries",
modelId: "anthropic.claude-3-haiku-20240307-v1:0",
streaming: true
});
// Create SupervisorAgent
const supervisorAgent = new SupervisorAgent({
leadAgent: supervisor,
team: [techAgent, billingAgent],
});
// Add supervisor agent to orchestrator
orchestrator.addAgent(supervisorAgent);
Possible Solution
No response
Steps to Reproduce
- Create an AWS Lambda function using Node.js.
- Implement an AgentSupervisor composed of BedrockLLMAgent agents.
- Set the streaming configuration to true for all agents.
- Invoke the SupervisorAgent and observe the response behavior.
Thanks for your issue. This is going to be fixed in #278
Any update on this? i am still getting the same error in Typescript package