Skip to content

Bug: Handling Streaming with SupervisorAgent and TeamMember #252

@pierrehanne

Description

@pierrehanne

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

  1. Create an AWS Lambda function using Node.js.
  2. Implement an AgentSupervisor composed of BedrockLLMAgent agents.
  3. Set the streaming configuration to true for all agents.
  4. Invoke the SupervisorAgent and observe the response behavior.

Metadata

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