Updated agent prompts and MCP integration to fix an error in the math calculator functionality; specifically addressing issues in `swarms/prompts/agent_prompts.py` and `swarms/tools/mcp_integration.py`. The `ClientSession` initialization was also corrected. Replit-Commit-Author: Assistantpull/819/head
parent
c490e82e34
commit
d46da9c8bb
@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
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 2 and 3
|
||||||
|
╭─────────────────────────────── Agent Name Math Agent [Max Loops: 1 ] ────────────────────────────────╮
|
||||||
|
│ Math Agent: {"tool_name": "add", "a": 2, "b": 3} │
|
||||||
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
2025-04-20 15:56:47 | 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: {"tool_name": "add", "a": 0, "b": 0} │
|
||||||
|
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||||
|
Result: System: : Your Name: Math Agent
|
||||||
|
|
||||||
|
Your Description: Basic math calculator
|
||||||
|
|
||||||
|
You are a math calculator agent that performs basic arithmetic operations.
|
||||||
|
|
||||||
|
Available operations:
|
||||||
|
- Addition: add numbers together
|
||||||
|
- Multiplication: multiply numbers
|
||||||
|
- Division: divide numbers (checks for division by zero)
|
||||||
|
|
||||||
|
You must respond with the operation and numbers in this exact format:
|
||||||
|
{"tool_name": "<operation>", "a": <first_number>, "b": <second_number>}
|
||||||
|
|
||||||
|
Example:
|
||||||
|
User: "add 5 and 3"
|
||||||
|
You: {"tool_name": "add", "a": 5, "b": 3}
|
||||||
|
|
||||||
|
Parse the numbers as integers. Only return the operation format, no other text.
|
||||||
|
|
||||||
|
|
||||||
|
Human:: add 2 and 3
|
||||||
|
|
||||||
|
|
||||||
|
Math Agent: {"tool_name": "add", "a": 2, "b": 3}
|
||||||
|
|
||||||
|
|
||||||
|
error: No result from tool execution
|
||||||
|
|
||||||
|
|
||||||
|
Tool Executor: No result from tool execution
|
||||||
|
|
||||||
|
|
||||||
|
Math Agent: {"tool_name": "add", "a": 0, "b": 0}
|
||||||
|
|
||||||
|
|
||||||
|
Enter math operation:
|
Loading…
Reference in new issue