Files
agent-bounty-protocol/packages/agent-sdk-python/test_python_sdk.py
OG T 745ff300b5
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
feat: harden A2A funnel and paid proposal intake
2026-06-11 11:28:08 +08:00

51 lines
1.5 KiB
Python

import os
from vibework_agent_sdk import VibeWorkAgentSDK
from vibework_agent_sdk.models import AgentCard
api_key = (os.getenv("MCP_API_KEY") or os.getenv("API_KEY") or "").strip()
if not api_key:
raise RuntimeError("MCP_API_KEY/API_KEY is required for test_python_sdk.py")
sdk = VibeWorkAgentSDK(
base_url="https://agent.wooo.work",
api_key=api_key,
)
agent_id = "test-hunter-bot-py-001"
wallet = "0x9999999999abcdef1234567890abcdef12345678"
# 1. Register Agent
card = AgentCard(
agent_id=agent_id,
name="HunterBot-Py-Test",
description="Python SDK test agent",
skills=["python"],
x402_wallet_address=wallet
)
print("Registering...")
print(sdk.identity.register_agent(card))
# 2. List Tasks
print("\nListing bounties...")
bounties = sdk.a2a.list_open_bounties(limit=5)
print(f"Found {len(bounties.tasks)} tasks.")
if bounties.tasks:
task = bounties.tasks[0]
print(f"Claiming {task.task_id}...")
claim = sdk.tasks.claim_bounty(
task_id=task.task_id,
agent_id=agent_id,
developer_wallet=wallet
)
print(f"Claim status: {claim.status}, token: {claim.claim_token[:10]}...")
print("\nSubmitting solution...")
submit = sdk.tasks.submit_solution(
task_id=task.task_id,
claim_token=claim.claim_token,
deliverables={"test.py": "print('hello from python')"},
github_pr_url="https://github.com/agent-bounty-protocol/pr/py"
)
print(f"Submit status: {submit.status}")