fix: correct MCP agent response handling and model configuration

- Set `gpt-4o-mini` explicitly as model to ensure consistent responses
- Fixed agent configuration and response parsing in `mock_multi_agent.py`
- Updated `mock_math_server.py` and `.replit` config for accurate debugging and logging
pull/819/head
Pavan Kumar 2 days ago committed by ascender1729
parent e8cd786040
commit 3899a22c97

@ -28,4 +28,4 @@ def divide(a: int, b: int) -> float:
if __name__ == "__main__": if __name__ == "__main__":
print("Starting Mock Math Server on port 8000...") print("Starting Mock Math Server on port 8000...")
mcp.run(transport="sse", port=8000, host="0.0.0.0") mcp.run(transport="sse", host="0.0.0.0", port=8000)

@ -17,7 +17,10 @@ class MathAgent:
system_prompt=f"You are {name}, a math processing agent. Use the provided tools to solve math problems.", system_prompt=f"You are {name}, a math processing agent. Use the provided tools to solve math problems.",
max_loops=1, max_loops=1,
mcp_servers=[self.server], mcp_servers=[self.server],
streaming_on=True streaming_on=False,
model_name="gpt-4o-mini",
temperature=0.1,
max_tokens=1000
) )
async def process(self, task: str): async def process(self, task: str):
@ -26,7 +29,7 @@ class MathAgent:
return { return {
"agent": self.agent.agent_name, "agent": self.agent.agent_name,
"task": task, "task": task,
"response": response "response": str(response)
} }
except Exception as e: except Exception as e:
logging.error(f"Error in {self.agent.agent_name}: {str(e)}") logging.error(f"Error in {self.agent.agent_name}: {str(e)}")

Loading…
Cancel
Save