diff --git a/examples/guides/x402_examples/agent_integration/x402_agent_buying.py b/examples/guides/x402_examples/agent_integration/x402_agent_buying.py index e61f4466..4993125a 100644 --- a/examples/guides/x402_examples/agent_integration/x402_agent_buying.py +++ b/examples/guides/x402_examples/agent_integration/x402_agent_buying.py @@ -1,4 +1,3 @@ -from x402.client import X402Client from eth_account import Account from x402.clients.httpx import x402HttpxClient @@ -10,8 +9,7 @@ load_dotenv() async def buy_x402_service( - base_url: str = None, - endpoint: str = None + base_url: str = None, endpoint: str = None ): """ Purchase a service from the X402 bazaar using the provided affordable_service details. @@ -31,20 +29,22 @@ async def buy_x402_service( ```python affordable_service = {"id": "service123", "price": 90000} response = await buy_x402_service( - affordable_service, - base_url="https://api.cdp.coinbase.com", + affordable_service, + base_url="https://api.cdp.coinbase.com", endpoint="/x402/v1/bazaar/services/service123" ) print(await response.aread()) ``` """ - key = os.getenv('X402_PRIVATE_KEY') - + key = os.getenv("X402_PRIVATE_KEY") + # Set up your payment account from private key account = Account.from_key(key) - async with x402HttpxClient(account=account, base_url=base_url) as client: + async with x402HttpxClient( + account=account, base_url=base_url + ) as client: response = await client.get(endpoint) print(await response.aread()) - - return response \ No newline at end of file + + return response diff --git a/examples/guides/x402_examples/agent_integration/x402_discovery_query.py b/examples/guides/x402_examples/agent_integration/x402_discovery_query.py index c9424172..3664718f 100644 --- a/examples/guides/x402_examples/agent_integration/x402_discovery_query.py +++ b/examples/guides/x402_examples/agent_integration/x402_discovery_query.py @@ -4,7 +4,6 @@ from swarms import Agent import httpx - async def query_x402_services( limit: Optional[int] = None, max_price: Optional[int] = None, @@ -207,7 +206,6 @@ def get_x402_services_sync( return str(services) - agent = Agent( agent_name="X402-Discovery-Agent", agent_description="A agent that queries the x402 discovery services from the Coinbase CDP API.", @@ -228,4 +226,4 @@ if __name__ == "__main__": out = agent.run( task="Summarize the first 10 services under 100000 atomic units (e.g., $0.10 USDC)" ) - print(out) \ No newline at end of file + print(out) diff --git a/agent_mcp.py b/examples/single_agent/agent_mcp.py similarity index 100% rename from agent_mcp.py rename to examples/single_agent/agent_mcp.py diff --git a/pyproject.toml b/pyproject.toml index c9f3627a..d1d2e088 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "8.6.1" +version = "8.6.2" description = "Swarms - TGSC" license = "MIT" authors = ["Kye Gomez "]