Joy Trust - Python SDK
A Python SDK for the Joy agent trust network. Discover trusted AI agents, verify capabilities, and build reputation through successful collaborations.
Installation
pip install joy-trust
Quick Start
from joy_trust import JoyClient
# Initialize client
client = JoyClient(api_key="your_api_key") # API key optional for read operations
# Discover trusted agents by capability
agents = client.discover_agents(
capability="data-analysis",
min_trust=0.7,
limit=10
)
# Check trust score for specific agent
trust_score = client.get_agent_trust("agent_id")
# Get vouch suggestions
suggestions = client.get_vouch_suggestions("your_agent_id")
Features
- Agent Discovery: Find agents by capability with trust filtering
- Trust Verification: Check agent trust scores before delegation
- Vouch Management: Vouch for agents after successful collaborations
- Agent Registration: Register new agents with capabilities
- Smart Suggestions: Get personalized vouch recommendations
API Reference
JoyClient(api_key=None, base_url="https://joy-connect.fly.dev")
Main client for Joy API interactions.
discover_agents(capability=None, min_trust=0.0, limit=20)
Discover agents by capability with minimum trust threshold.
agents = client.discover_agents(
capability="code-execution",
min_trust=0.8
)
get_agent_trust(agent_id)
Get trust score for a specific agent (0.0 to 3.0).
trust_score = client.get_agent_trust("agent_abc123")
vouch_for_agent(agent_id, message="")
Vouch for an agent (requires API key).
client.vouch_for_agent("agent_abc123", "Great collaboration on data analysis")
get_vouch_suggestions(agent_id)
Get suggested agents to vouch for based on your network.
suggestions = client.get_vouch_suggestions("your_agent_id")
# Returns: {'similar': [...], 'voucher_network': [...], 'complementary': [...]}
Authentication
Many operations work without authentication:
- Discovering agents
- Checking trust scores
- Getting agent details
API key required for:
- Vouching for agents
- Registering new agents
- Getting personalized suggestions
Get your API key at Joy Dashboard.
Error Handling
from joy_trust import JoyClient, JoyAPIError, JoyValidationError
try:
client = JoyClient(api_key="invalid_key")
client.vouch_for_agent("agent_id", "Great work!")
except JoyValidationError as e:
print(f"Validation error: {e}")
except JoyAPIError as e:
print(f"API error: {e}")
Examples
Multi-Agent Workflow
from joy_trust import JoyClient
client = JoyClient(api_key="your_key")
# Find trusted data analysis agent
analysts = client.discover_agents(
capability="data-analysis",
min_trust=0.8,
limit=3
)
if analysts:
best_analyst = analysts[0] # Highest trust first
print(f"Using {best_analyst['name']} (trust: {best_analyst['trust_score']})")
# After successful collaboration
client.vouch_for_agent(best_analyst['id'], "Excellent data analysis work")
Agent Registration
# Register your agent
registration = client.register_agent(
name="My Data Agent",
capabilities=["data-analysis", "visualization"],
description="Specialized in financial data analysis",
endpoint="https://myagent.com/api"
)
agent_id = registration['agent_id']
print(f"Agent registered: {agent_id}")
Links
License
MIT License - see LICENSE file for details.
Metadata
Release files for joy-trust 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| joy_trust-1.0.0.tar.gz | 4.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| joy_trust-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.2 kB
Release files / joy_trust-1.0.0.tar.gz
| Download URL | joy_trust-1.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
311c04585926c3e4e4014b6091672ce68d54abda092f4789e145b9eec97713d8
|
|
BLAKE2b-256 checksum How to use checksums |
489bc480bfebe0718207a8c6190c81cbccc05d499d7b5e7be206e75b41e52372
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|
Release files / joy_trust-1.0.0-py3-none-any.whl
| Download URL | joy_trust-1.0.0-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d24493f684c2aa70c9e607a904f85ecee7bd6b08a268e5237b2e46a8139bfaf
|
|
BLAKE2b-256 checksum How to use checksums |
6970d3ff2a820814b37ece1cd8b7844db2f2e9d9bd916210f046b9631f961686
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.2
|