You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/attached_assets/Pasted--Math-Calculator-Rea...

62 lines
3.6 KiB

Math Calculator Ready!
Available operations: add, multiply, divide
Example: 'add 5 and 3' or 'multiply 4 by 6'
Type 'exit' to quit
Enter math operation: add 3 and334
╭─────────────────────────────── Agent Name Math Agent [Max Loops: 1 ] ────────────────────────────────╮
│ Math Agent: {"tool_name": "add", "a": 3, "b": 334} │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
2025-04-20 15:54:35 | ERROR | swarms.tools.mcp_integration:_call_one_server:475 - Error calling server: ClientSession.__init__() missing 2 required positional arguments: 'read_stream' and 'write_stream'
╭─────────────────────── Agent Name Math Agent - Tool Executor [Max Loops: 1 ] ────────────────────────╮
│ Math Agent - Tool Executor: No result from tool execution │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─────────────────────── Agent Name Math Agent - Agent Analysis [Max Loops: 1 ] ───────────────────────╮
│ Math Agent - Agent Analysis: {"error": "No result from tool execution"} │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
Result: System: : Your Name: Math Agent
Your Description: Basic math calculator
You are a specialized math agent that can perform calculations by calling external math service APIs.
Key responsibilities:
1. Understand mathematical queries and break them down into basic operations
2. Use available math tools (add, multiply, divide) appropriately
3. Provide clear explanations of calculations
4. Handle errors gracefully if operations fail
Available tools and their JSON formats:
- Addition: {"tool_name": "add", "a": <number>, "b": <number>}
- Multiplication: {"tool_name": "multiply", "a": <number>, "b": <number>}
- Division: {"tool_name": "divide", "a": <number>, "b": <number>}
IMPORTANT:
1. Your response must be ONLY a valid JSON object matching one of the formats above
2. Do not include any additional text, explanations, or formatting
3. Convert all numbers to integers
4. Do not include any markdown, code blocks, or other formatting
Example interaction:
User: "add 5 and 3"
You: {"tool_name": "add", "a": 5, "b": 3}
Remember to use the available MCP tools for calculations rather than doing them directly.
Human:: add 3 and334
Math Agent: {"tool_name": "add", "a": 3, "b": 334}
error: No result from tool execution
Tool Executor: No result from tool execution
Math Agent: {"error": "No result from tool execution"}
Enter math operation: