Updated the agent's response to clarify how to ask for prices and added more robust handling of price-related requests. Specifically, modified `mock_multi_agent.py` to improve the agent's understanding of price inquiries and its responses. The `.replit` file was also updated to rename the run button to "Run MCP Demo".
Replit-Commit-Author: Assistant
agent_description=f"{'Calculator'ifname=='Calculator'else'Stock Analyst'} agent specializing in {'mathematical calculations'ifname=='Calculator'else'stock market analysis'}. For Calculator: use add, multiply, divide operations. For Stock Analyst: use moving averages and percentage change calculations.",
system_prompt=f"You are {name}, a math processing agent. You have access to these mathematical operations ONLY: addition, multiplication, and division. Only suggest calculations using these available tools. Do not attempt to solve problems requiring other operations like percentages, square roots, or advanced math. When users ask about capabilities, list only the basic operations you can perform.",
agent_description=
f"{'Calculator'ifname=='Calculator'else'Stock Analyst'} agent specializing in {'mathematical calculations'ifname=='Calculator'else'stock market analysis'}. For Calculator: use add, multiply, divide operations. For Stock Analyst: use moving averages and percentage change calculations.",
system_prompt=
f"You are {name}, a math processing agent. You have access to these mathematical operations ONLY: addition, multiplication, and division. Only suggest calculations using these available tools. Do not attempt to solve problems requiring other operations like percentages, square roots, or advanced math. When users ask about capabilities, list only the basic operations you can perform.",
"response":"I can perform basic mathematical operations: addition (use '+' or 'plus'), multiplication (use '*' or 'times'), and division (use '/' or 'divide by'). For example: '5 plus 3' or '10 divide by 2'"
"agent":
self.agent.agent_name,
"task":
task,
"response":
"I can perform basic mathematical operations: addition (use '+' or 'plus'), multiplication (use '*' or 'times'), and division (use '/' or 'divide by'). For example: '5 plus 3' or '10 divide by 2'"
}
else:# StockAnalyst
return{
"agent":self.agent.agent_name,
"task":task,
"response":"I can analyze stock data using moving averages and calculate percentage changes. For example: 'calculate moving average of [10,20,30,40,50] over 3 periods'"
"agent":
self.agent.agent_name,
"task":
task,
"response":
"I can analyze stock data using moving averages and calculate percentage changes. For example: 'calculate moving average of [10,20,30,40,50] over 3 periods'"
}
# Only process if task is relevant to this agent
@ -54,11 +66,13 @@ class MathAgent:
return{
"agent":self.agent.agent_name,
"task":task,
"response":None# Indicate this agent should not handle this task
"response":
None# Indicate this agent should not handle this task
}
# Check if input is stock-related (for StockAnalyst)