[NEW][SCRIPT][For python3.14t setup]

pull/1133/head
Kye Gomez 2 months ago
parent 524b8a5e6c
commit 28aa8ef4f0

@ -0,0 +1,31 @@
#!/bin/bash
# Python 3.14t Free-Threaded Setup Script
# This script automates the installation of Python 3.14 free-threaded build with uv
set -e # Exit on error
# Check if uv is installed
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
exit 1
fi
uv self update
uv python install 3.14t
uv venv --python 3.14t
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
:
else
:
fi
uv pip install swarms
echo "To run Python 3.14t directly without activating:"
echo " uvx python@3.14t your_script.py"
echo ""
echo "=========================================="

@ -2319,6 +2319,15 @@ class AOP:
class AOPCluster: class AOPCluster:
"""
AOPCluster manages a cluster of MCP servers, allowing for the retrieval and searching
of tools (agents) across multiple endpoints.
Attributes:
urls (List[str]): List of MCP server URLs to connect to.
transport (str): The transport protocol to use (default: "streamable-http").
"""
def __init__( def __init__(
self, self,
urls: List[str], urls: List[str],
@ -2326,12 +2335,31 @@ class AOPCluster:
*args, *args,
**kwargs, **kwargs,
): ):
"""
Initialize the AOPCluster.
Args:
urls (List[str]): List of MCP server URLs.
transport (str, optional): Transport protocol to use. Defaults to "streamable-http".
*args: Additional positional arguments.
**kwargs: Additional keyword arguments.
"""
self.urls = urls self.urls = urls
self.transport = transport self.transport = transport
def get_tools( def get_tools(
self, output_type: Literal["json", "dict", "str"] = "dict" self, output_type: Literal["json", "dict", "str"] = "dict"
) -> List[Dict[str, Any]]: ) -> List[Dict[str, Any]]:
"""
Retrieve the list of tools (agents) from all MCP servers in the cluster.
Args:
output_type (Literal["json", "dict", "str"], optional): The format of the output.
Can be "json", "dict", or "str". Defaults to "dict".
Returns:
List[Dict[str, Any]]: A list of tool information dictionaries.
"""
return get_tools_for_multiple_mcp_servers( return get_tools_for_multiple_mcp_servers(
urls=self.urls, urls=self.urls,
format="openai", format="openai",
@ -2346,12 +2374,13 @@ class AOPCluster:
Find a tool by its server name (function name). Find a tool by its server name (function name).
Args: Args:
server_name: The name of the tool/function to find server_name (str): The name of the tool/function to find.
Returns: Returns:
Dict containing the tool information, or None if not found Dict[str, Any]: Dictionary containing the tool information, or None if not found.
""" """
for tool in self.get_tools(output_type="dict"): for tool in self.get_tools(output_type="dict"):
if tool.get("function", {}).get("name") == server_name: if tool.get("function", {}).get("name") == server_name:
return tool return tool
return None return None

Loading…
Cancel
Save