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.",
agent_description=
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.",
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'"
"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
else:# StockAnalyst
return{
return{
"agent":self.agent.agent_name,
"agent":
"task":task,
self.agent.agent_name,
"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'"
"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
# Only process if task is relevant to this agent
@ -54,17 +66,19 @@ class MathAgent:
return{
return{
"agent":self.agent.agent_name,
"agent":self.agent.agent_name,
"task":task,
"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)
# Check if input is stock-related (for StockAnalyst)