diff --git a/examples/chat-demo-app/lambda/multi-agent/index.ts b/examples/chat-demo-app/lambda/multi-agent/index.ts index 09103be..e3d6d4b 100644 --- a/examples/chat-demo-app/lambda/multi-agent/index.ts +++ b/examples/chat-demo-app/lambda/multi-agent/index.ts @@ -5,8 +5,9 @@ import { DynamoDbChatStorage, LexBotAgent, AmazonBedrockAgent, - LambdaAgent - } from "@aws/multi-agent-orchestrator"; + LambdaAgent, + BedrockClassifier, +} from "multi-agent-orchestrator"; import { weatherToolDescription, WEATHER_PROMPT, weatherToolHanlder } from './weather_tool' import { mathToolHanlder, mathAgentToolDefinition, MATH_AGENT_PROMPT } from './math_tool'; import { APIGatewayProxyEventV2, Handler, Context } from "aws-lambda"; @@ -69,6 +70,12 @@ const orchestrator = new MultiAgentOrchestrator({ logger: logger, }); + orchestrator.setClassifier(new BedrockClassifier( + { + modelId: "anthropic.claude-3-5-sonnet-20240620-v1:0", + } + )); + orchestrator.addAgent( new BedrockLLMAgent({ name: "Tech Agent", @@ -197,10 +204,7 @@ async function eventHandler( // Send metadata immediately logger.info(` > Agent ID: ${response.metadata.agentId}`); logger.info(` > Agent Name: ${response.metadata.agentName}`); - logger.info(`> Language: ${response.metadata.language}`); - logger.info( - `> Language Confidence: ${response.metadata.languageConfidence}` - ); + logger.info(`> User Input: ${response.metadata.userInput}`); logger.info(`> User ID: ${response.metadata.userId}`); logger.info(`> Session ID: ${response.metadata.sessionId}`); @@ -231,10 +235,6 @@ async function eventHandler( logger.info("\n** RESPONSE ** \n"); logger.info(` > Agent ID: ${response.metadata.agentId}`); logger.info(` > Agent Name: ${response.metadata.agentName}`); - logger.info(`> Language: ${response.metadata.language}`); - logger.info( - `> Language Confidence: ${response.metadata.languageConfidence}` - ); logger.info(`> User Input: ${response.metadata.userInput}`); logger.info(`> User ID: ${response.metadata.userId}`); logger.info(`> Session ID: ${response.metadata.sessionId}`); diff --git a/examples/chat-demo-app/lambda/multi-agent/math_tool.ts b/examples/chat-demo-app/lambda/multi-agent/math_tool.ts index a5643cb..8f1689b 100644 --- a/examples/chat-demo-app/lambda/multi-agent/math_tool.ts +++ b/examples/chat-demo-app/lambda/multi-agent/math_tool.ts @@ -1,5 +1,5 @@ -import { ConversationMessage, ParticipantRole } from "@aws/multi-agent-orchestrator"; -import { Logger } from "@aws/multi-agent-orchestrator"; +import { ConversationMessage, ParticipantRole } from "multi-agent-orchestrator"; +import { Logger } from "multi-agent-orchestrator"; export const MATH_AGENT_PROMPT = ` You are a mathematical assistant capable of performing various mathematical operations and statistical calculations. diff --git a/examples/chat-demo-app/lambda/multi-agent/weather_tool.ts b/examples/chat-demo-app/lambda/multi-agent/weather_tool.ts index ca3a8bc..6ea165d 100644 --- a/examples/chat-demo-app/lambda/multi-agent/weather_tool.ts +++ b/examples/chat-demo-app/lambda/multi-agent/weather_tool.ts @@ -1,4 +1,4 @@ -import { ConversationMessage, ParticipantRole } from "@aws/multi-agent-orchestrator"; +import { ConversationMessage, ParticipantRole } from "multi-agent-orchestrator"; export const weatherToolDescription = [ { @@ -63,7 +63,7 @@ export async function weatherToolHanlder(response:ConversationMessage, conversat if (!responseContentBlocks) { throw new Error("No content blocks in response"); } - for (const contentBlock of response.content) { + for (const contentBlock of responseContentBlocks) { if ("text" in contentBlock) { } if ("toolUse" in contentBlock) {