-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathquickstart.py
More file actions
43 lines (32 loc) · 1.17 KB
/
quickstart.py
File metadata and controls
43 lines (32 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"""
AVP SDK Quickstart — 5 lines to get an agent registered.
Prerequisites:
1. AVP server running: uvicorn app.main:app --port 8000
2. Docker running: docker compose up -d
3. Database ready: alembic upgrade head
Usage:
python examples/quickstart.py
"""
from agentveil import AVPAgent
AVP_URL = "http://localhost:8000"
def main():
# === 1. Create, register, and publish card in one call ===
agent = AVPAgent.create(AVP_URL, name="quickstart_agent")
agent.register(
display_name="Quickstart Agent",
capabilities=["code_review", "testing", "documentation"],
provider="anthropic",
)
print(f"Agent registered: {agent.did}")
print("Card published and onboarding started automatically.")
# === 3. Check reputation ===
rep = agent.get_reputation()
print(f"Reputation: score={rep['score']}, confidence={rep['confidence']}")
# === 4. Search for other agents ===
agents = agent.search_agents(capability="code_review")
print(f"Found {len(agents)} agents with code_review capability")
# === 5. Health check ===
health = agent.health()
print(f"Server: {health}")
if __name__ == "__main__":
main()