diff --git a/examples/mcp/agent_examples/agent_mcp_old.py b/examples/mcp/agent_examples/agent_mcp_old.py index 19538e1d..84391d9d 100644 --- a/examples/mcp/agent_examples/agent_mcp_old.py +++ b/examples/mcp/agent_examples/agent_mcp_old.py @@ -3,13 +3,13 @@ from swarms.schemas.mcp_schemas import MCPConnection mcp_config = MCPConnection( - url="http://0.0.0.0:8000/sse", + url="http://0.0.0.0:8000/mcp", # headers={"Authorization": "Bearer 1234567890"}, timeout=5, ) -mcp_url = "http://0.0.0.0:8000/sse" +mcp_url = "http://0.0.0.0:8000/mcp" # Initialize the agent agent = Agent( diff --git a/examples/mcp/agent_examples/agent_multi_mcp_connections.py b/examples/mcp/agent_examples/agent_multi_mcp_connections.py index 46e22cbc..3baffe7a 100644 --- a/examples/mcp/agent_examples/agent_multi_mcp_connections.py +++ b/examples/mcp/agent_examples/agent_multi_mcp_connections.py @@ -39,8 +39,8 @@ agent = Agent( dynamic_temperature_enabled=True, output_type="all", mcp_urls=[ - "http://0.0.0.0:8000/sse", - "http://0.0.0.0:8001/sse", + "http://0.0.0.0:8000/mcp", + "http://0.0.0.0:8001/mcp", ], ) diff --git a/examples/mcp/agent_examples/agent_tools_dict_example.py b/examples/mcp/agent_examples/agent_tools_dict_example.py index f1d02620..0140db32 100644 --- a/examples/mcp/agent_examples/agent_tools_dict_example.py +++ b/examples/mcp/agent_examples/agent_tools_dict_example.py @@ -40,7 +40,7 @@ agent = Agent( max_loops=2, tools_list_dictionary=tools, output_type="final", - mcp_url="http://0.0.0.0:8000/sse", + mcp_url="http://0.0.0.0:8000/mcp", ) out = agent.run( diff --git a/examples/mcp/mcp_utils/mcp_multiple_servers_example.py b/examples/mcp/mcp_utils/mcp_multiple_servers_example.py index e94de2ca..0c123949 100644 --- a/examples/mcp/mcp_utils/mcp_multiple_servers_example.py +++ b/examples/mcp/mcp_utils/mcp_multiple_servers_example.py @@ -21,25 +21,25 @@ def example_sync_execution(): # Example server URLs (replace with your actual MCP server URLs) urls = [ - "http://localhost:8000/sse", # Server 1 - "http://localhost:8001/sse", # Server 2 - "http://localhost:8002/sse", # Server 3 + "http://localhost:8000/mcp", # Server 1 + "http://localhost:8001/mcp", # Server 2 + "http://localhost:8002/mcp", # Server 3 ] # Optional: Create connection objects for each server connections = [ MCPConnection( - url="http://localhost:8000/sse", + url="http://localhost:8000/mcp", authorization_token="token1", # if needed timeout=10, ), MCPConnection( - url="http://localhost:8001/sse", + url="http://localhost:8001/mcp", authorization_token="token2", # if needed timeout=10, ), MCPConnection( - url="http://localhost:8002/sse", + url="http://localhost:8002/mcp", authorization_token="token3", # if needed timeout=10, ), @@ -111,9 +111,9 @@ async def example_async_execution(): # Example server URLs urls = [ - "http://localhost:8000/sse", - "http://localhost:8001/sse", - "http://localhost:8002/sse", + "http://localhost:8000/mcp", + "http://localhost:8001/mcp", + "http://localhost:8002/mcp", ] # Example responses with multiple tool calls in a single response @@ -190,9 +190,9 @@ def example_get_tools_from_multiple_servers(): """Example of getting tools from multiple servers.""" urls = [ - "http://localhost:8000/sse", - "http://localhost:8001/sse", - "http://localhost:8002/sse", + "http://localhost:8000/mcp", + "http://localhost:8001/mcp", + "http://localhost:8002/mcp", ] print("\n=== Getting Tools from Multiple Servers ===") diff --git a/examples/mcp/mcp_utils/singleagent_client.py b/examples/mcp/mcp_utils/singleagent_client.py index 41816048..cef32d6f 100644 --- a/examples/mcp/mcp_utils/singleagent_client.py +++ b/examples/mcp/mcp_utils/singleagent_client.py @@ -13,7 +13,7 @@ async def create_agent_via_mcp(): # Connect to the MCP server using streamable HTTP try: - async with http_client("http://localhost:8000/mcp") as ( + async with http_client("http://localhost:8001/mcp") as ( read, write, _, diff --git a/examples/mcp/mcp_utils/utils/find_tools_on_mcp.py b/examples/mcp/mcp_utils/utils/find_tools_on_mcp.py index 82301a0e..1705c2c2 100644 --- a/examples/mcp/mcp_utils/utils/find_tools_on_mcp.py +++ b/examples/mcp/mcp_utils/utils/find_tools_on_mcp.py @@ -7,10 +7,10 @@ import json if __name__ == "__main__": tools = get_mcp_tools_sync( - server_path="http://0.0.0.0:8000/sse", + server_path="http://0.0.0.0:8000/mcp", format="openai", connection=MCPConnection( - url="http://0.0.0.0:8000/sse", + url="http://0.0.0.0:8000/mcp", headers={"Authorization": "Bearer 1234567890"}, timeout=10, ), diff --git a/examples/mcp/mcp_utils/utils/mcp_execute_example.py b/examples/mcp/mcp_utils/utils/mcp_execute_example.py index 326f48a9..750c3eb6 100644 --- a/examples/mcp/mcp_utils/utils/mcp_execute_example.py +++ b/examples/mcp/mcp_utils/utils/mcp_execute_example.py @@ -13,12 +13,12 @@ response = { } connection = MCPConnection( - url="http://0.0.0.0:8000/sse", + url="http://0.0.0.0:8000/mcp", headers={"Authorization": "Bearer 1234567890"}, timeout=10, ) -url = "http://0.0.0.0:8000/sse" +url = "http://0.0.0.0:8000/mcp" if __name__ == "__main__": tools = asyncio.run( diff --git a/examples/mcp/mcp_utils/utils/mcp_load_tools_example.py b/examples/mcp/mcp_utils/utils/mcp_load_tools_example.py index 0847845c..1666301e 100644 --- a/examples/mcp/mcp_utils/utils/mcp_load_tools_example.py +++ b/examples/mcp/mcp_utils/utils/mcp_load_tools_example.py @@ -7,10 +7,10 @@ from swarms.tools.mcp_client_tools import ( if __name__ == "__main__": tools = get_mcp_tools_sync( - server_path="http://0.0.0.0:8000/sse", + server_path="http://0.0.0.0:8001/mcp", format="openai", connection=MCPConnection( - url="http://0.0.0.0:8000/sse", + url="http://0.0.0.0:8001/mcp", headers={"Authorization": "Bearer 1234567890"}, timeout=10, ), diff --git a/examples/mcp/mcp_utils/utils/mcp_multiserver_tool_fetch.py b/examples/mcp/mcp_utils/utils/mcp_multiserver_tool_fetch.py index ade0009f..a11a269f 100644 --- a/examples/mcp/mcp_utils/utils/mcp_multiserver_tool_fetch.py +++ b/examples/mcp/mcp_utils/utils/mcp_multiserver_tool_fetch.py @@ -5,12 +5,12 @@ from swarms.schemas.mcp_schemas import MCPConnection mcp_config = MCPConnection( - url="http://0.0.0.0:8000/sse", + url="http://0.0.0.0:8000/mcp", # headers={"Authorization": "Bearer 1234567890"}, timeout=5, ) -urls = ["http://0.0.0.0:8000/sse", "http://0.0.0.0:8001/sse"] +urls = ["http://0.0.0.0:8001/mcp", "http://0.0.0.0:8001/mcp"] out = get_tools_for_multiple_mcp_servers( urls=urls, diff --git a/examples/mcp/multi_mcp_guide/agent_mcp.py b/examples/mcp/multi_mcp_guide/agent_mcp.py index 1740f1ee..a9b9579e 100644 --- a/examples/mcp/multi_mcp_guide/agent_mcp.py +++ b/examples/mcp/multi_mcp_guide/agent_mcp.py @@ -3,24 +3,27 @@ from swarms.prompts.finance_agent_sys_prompt import ( FINANCIAL_AGENT_SYS_PROMPT, ) -# Initialize the agent +# Initialize the financial analysis agent with a system prompt and configuration. agent = Agent( - agent_name="Financial-Analysis-Agent", - agent_description="Personal finance advisor agent", - system_prompt=FINANCIAL_AGENT_SYS_PROMPT, - max_loops=1, + agent_name="Financial-Analysis-Agent", # Name of the agent + agent_description="Personal finance advisor agent", # Description of the agent's role + system_prompt=FINANCIAL_AGENT_SYS_PROMPT, # System prompt for financial tasks + max_loops=1, mcp_urls=[ - "http://0.0.0.0:8001/mcp", - "http://0.0.0.0:8000/mcp", + "http://0.0.0.0:8001/mcp", # URL for the OKX crypto price MCP server + "http://0.0.0.0:8000/mcp", # URL for the agent creation MCP server ], model_name="gpt-4o-mini", output_type="all", ) -# Create a markdown file with initial content +# Run the agent with a specific instruction to use the create_agent tool. +# The agent is asked to create a new agent specialized for accounting rules in crypto. out = agent.run( + # Example alternative prompt: # "Use the get_okx_crypto_price to get the price of solana just put the name of the coin", - "Use the create_agent tool that is specialized in creating agents" + "Use the create_agent tool that is specialized in creating agents and create an agent speecialized for accounting rules in crypto" ) +# Print the output from the agent's run method. print(out) diff --git a/examples/agent_judge_examples/example1_basic_evaluation.py b/examples/reasoning_agents/agent_judge_examples/example1_basic_evaluation.py similarity index 100% rename from examples/agent_judge_examples/example1_basic_evaluation.py rename to examples/reasoning_agents/agent_judge_examples/example1_basic_evaluation.py diff --git a/examples/agent_judge_examples/example2_technical_evaluation.py b/examples/reasoning_agents/agent_judge_examples/example2_technical_evaluation.py similarity index 100% rename from examples/agent_judge_examples/example2_technical_evaluation.py rename to examples/reasoning_agents/agent_judge_examples/example2_technical_evaluation.py diff --git a/examples/agent_judge_examples/example3_creative_evaluation.py b/examples/reasoning_agents/agent_judge_examples/example3_creative_evaluation.py similarity index 100% rename from examples/agent_judge_examples/example3_creative_evaluation.py rename to examples/reasoning_agents/agent_judge_examples/example3_creative_evaluation.py diff --git a/examples/api_examples/agent_overview.py b/examples/swarms_api_examples/agent_overview.py similarity index 100% rename from examples/api_examples/agent_overview.py rename to examples/swarms_api_examples/agent_overview.py diff --git a/examples/api_examples/batch_example.py b/examples/swarms_api_examples/batch_example.py similarity index 100% rename from examples/api_examples/batch_example.py rename to examples/swarms_api_examples/batch_example.py diff --git a/examples/api_examples/client_example.py b/examples/swarms_api_examples/client_example.py similarity index 100% rename from examples/api_examples/client_example.py rename to examples/swarms_api_examples/client_example.py diff --git a/examples/api_examples/hospital_team.py b/examples/swarms_api_examples/hospital_team.py similarity index 100% rename from examples/api_examples/hospital_team.py rename to examples/swarms_api_examples/hospital_team.py diff --git a/examples/api_examples/icd_ten_analysis.py b/examples/swarms_api_examples/icd_ten_analysis.py similarity index 100% rename from examples/api_examples/icd_ten_analysis.py rename to examples/swarms_api_examples/icd_ten_analysis.py diff --git a/examples/api_examples/legal_team.py b/examples/swarms_api_examples/legal_team.py similarity index 100% rename from examples/api_examples/legal_team.py rename to examples/swarms_api_examples/legal_team.py diff --git a/examples/api_examples/rate_limits.py b/examples/swarms_api_examples/rate_limits.py similarity index 100% rename from examples/api_examples/rate_limits.py rename to examples/swarms_api_examples/rate_limits.py diff --git a/requirements.txt b/requirements.txt index 5c59f3c3..6349346e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,3 +29,4 @@ numpy openai schedule uvloop +litellm \ No newline at end of file