From 725f3044488b753e7337713c660f2a5f629ebef7 Mon Sep 17 00:00:00 2001 From: Pavan Kumar <66913595+ascender1729@users.noreply.github.com> Date: Sun, 20 Apr 2025 09:28:11 +0000 Subject: [PATCH] fix(agent_prompts): remove duplicate MATH_AGENT_PROMPT definition and fix server transport config --- examples/mcp_example/mock_math_server.py | 2 +- swarms/prompts/agent_prompts.py | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/examples/mcp_example/mock_math_server.py b/examples/mcp_example/mock_math_server.py index 07803d84..f8d85e3c 100644 --- a/examples/mcp_example/mock_math_server.py +++ b/examples/mcp_example/mock_math_server.py @@ -22,4 +22,4 @@ def divide(a: int, b: int) -> float: if __name__ == "__main__": print("Starting Mock Math Server on port 8000...") - mcp.run(transport="sse", port=8000) + mcp.run(transport="sse", transport_kwargs={"port": 8000, "host": "0.0.0.0"}) diff --git a/swarms/prompts/agent_prompts.py b/swarms/prompts/agent_prompts.py index 3a921a14..594e7530 100644 --- a/swarms/prompts/agent_prompts.py +++ b/swarms/prompts/agent_prompts.py @@ -10,15 +10,6 @@ Key responsibilities: Remember to use the available MCP tools for calculations rather than doing them directly.""" -MATH_AGENT_PROMPT = """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 - -Remember to use the available MCP tools for calculations rather than doing them directly.""" - FINANCE_AGENT_PROMPT = """You are a financial analysis agent with access to stock market data services. Key responsibilities: 1. Interpret financial queries and determine required data @@ -64,7 +55,6 @@ def generate_agent_role_prompt(agent): return prompts.get(agent, "No such agent") - def generate_report_prompt(question, research_summary): """Generates the report prompt for the given question and research summary. Args: question (str): The question to generate the report prompt for @@ -83,7 +73,6 @@ def generate_report_prompt(question, research_summary): " format" ) - def generate_search_queries_prompt(question): """Generates the search queries prompt for the given question. Args: question (str): The question to generate the search queries prompt for @@ -97,7 +86,6 @@ def generate_search_queries_prompt(question): ' ["query 1", "query 2", "query 3", "query 4"]' ) - def generate_resource_report_prompt(question, research_summary): """Generates the resource report prompt for the given question and research summary. @@ -122,7 +110,6 @@ def generate_resource_report_prompt(question, research_summary): " should have a minimum length of 1,200 words." ) - def generate_outline_report_prompt(question, research_summary): """Generates the outline report prompt for the given question and research summary. Args: question (str): The question to generate the outline report prompt for @@ -142,7 +129,6 @@ def generate_outline_report_prompt(question, research_summary): " format the outline and ensure readability." ) - def generate_concepts_prompt(question, research_summary): """Generates the concepts prompt for the given question. Args: question (str): The question to generate the concepts prompt for @@ -160,7 +146,6 @@ def generate_concepts_prompt(question, research_summary): ' "concepts 4, concepts 5"]' ) - def generate_lesson_prompt(concept): """ Generates the lesson prompt for the given question. @@ -180,7 +165,6 @@ def generate_lesson_prompt(concept): return prompt - def get_report_by_type(report_type): report_type_mapping = { "research_report": generate_report_prompt,