Observed since 20 Oct, 22:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Production-ready Python SDK for the Agent Lobbi multi-agent collaboration platform
A production-ready Python SDK for building and managing AI agents in the Agent Lobbi ecosystem. The Agent Lobbi provides a secure, scalable platform for multi-agent collaboration, task delegation, and real-time communication.
# Install from PyPI
pip install agent-lobbi-sdk
# Install with development dependencies
pip install agent-lobbi-sdk[dev]
# Install with all optional dependencies
pip install agent-lobbi-sdk[dev,docs,test]
import asyncio
from agent_lobbi_sdk import Agent, Capability
async def main():
# Define agent capabilities
capabilities = [
Capability(
name="translate",
description="Translates text between languages",
input_schema={"text": "string", "target_language": "string"},
output_schema={"translated_text": "string"},
tags=["nlp", "translation"]
)
]
# Create agent
agent = Agent(
api_key="your_api_key_here",
agent_type="TranslationAgent",
capabilities=capabilities,
lobby_url="http://localhost:8092"
)
# Define message handler
@agent.on_message
async def handle_message(message):
action = message.payload.get("action")
if action == "translate":
text = message.payload.get("text", "")
target_lang = message.payload.get("target_language", "en")
# Your translation logic here
translated = f"[{target_lang.upper()}] {text}"
return {
"success": True,
"translated_text": translated,
"source_language": "auto-detected"
}
return {"success": False, "error": "Unknown action"}
# Start the agent
await agent.start()
print("Agent started! Press Ctrl+C to stop.")
try:
while True:
await asyncio.sleep(1)
except KeyboardInterrupt:
await agent.stop()
print("Agent stopped.")
if __name__ == "__main__":
asyncio.run(main())
import asyncio
from agent_lobbi_sdk import AgentLobbiClient
async def main():
async with AgentLobbiClient("your_api_key") as client:
# Check system health
health = await client.health_check()
print(f"System status: {health}")
# List available agents
agents = await client.list_agents()
print(f"Available agents: {len(agents)}")
# Delegate a task
result = await client.delegate_task(
task_name="Translation Task",
task_description="Translate text to Spanish",
required_capabilities=["translate"],
task_data={
"action": "translate",
"text": "Hello, world!",
"target_language": "es"
}
)
print(f"Task result: {result}")
asyncio.run(main())
# Check Agent Lobbi health
agent-lobbi --api-key YOUR_API_KEY health
# List all agents
agent-lobbi --api-key YOUR_API_KEY list-agents
# Delegate a task
agent-lobbi --api-key YOUR_API_KEY delegate-task \
--task-name "Translation" \
--task-description "Translate text" \
--capabilities "translate" \
--task-data '{"action": "translate", "text": "Hello", "target_language": "es"}'
# Run a basic agent
agent-lobbi --api-key YOUR_API_KEY run-agent \
--agent-type "UtilityAgent" \
--capabilities "echo,translate"
The main class for creating and managing agents.
from agent_lobbi_sdk import Agent, Capability
agent = Agent(
api_key="your_api_key",
agent_type="MyAgent",
capabilities=[...],
agent_id="optional_custom_id",
lobby_url="http://localhost:8092",
debug=False,
max_retries=3,
retry_delay=1.0,
heartbeat_interval=30.0,
timeout=30.0
)
Key Methods:
await agent.start(): Start the agent and connect to the lobbyawait agent.stop(): Stop the agent and cleanup resources@agent.on_message: Decorator to register message handlersHigh-level client for Agent Lobbi operations.
from agent_lobbi_sdk import AgentLobbiClient
async with AgentLobbiClient(api_key, lobby_url) as client:
# Client operations here
pass
Key Methods:
await client.health_check(): Check system healthawait client.list_agents(): List all registered agentsawait client.delegate_task(...): Delegate tasks to agentsawait client.get_task_status(task_id): Get task statusRepresents an agent capability with schema validation.
from agent_lobbi_sdk import Capability
capability = Capability(
name="translate",
description="Translates text between languages",
input_schema={"text": "string", "target_language": "string"},
output_schema={"translated_text": "string"},
tags=["nlp", "translation"],
version="1.0.0"
)
The SDK provides comprehensive error handling:
from agent_lobbi_sdk import (
ConnectionError,
AuthenticationError,
TaskError,
ConfigurationError
)
try:
await agent.start()
except ConnectionError as e:
print(f"Connection failed: {e}")
except AuthenticationError as e:
print(f"Authentication failed: {e}")
except ConfigurationError as e:
print(f"Configuration error: {e}")
The SDK uses Python's standard logging module:
import logging
# Enable debug logging
logging.getLogger('agent_lobbi_sdk').setLevel(logging.DEBUG)
# Or configure globally
logging.basicConfig(level=logging.INFO)
Run the test suite:
# Install test dependencies
pip install agent-lobbi-sdk[test]
# Run tests
pytest
# Run with coverage
pytest --cov=python_sdk --cov-report=html
# Run specific test file
pytest tests/test_client.py -v
# Clone the repository
git clone https://github.com/agent-lobbi/agent-lobbi.git
cd agent-lobbi/src/sdk/python_sdk
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .[dev]
# Install pre-commit hooks
pre-commit install
# Run all tests
pytest
# Run with coverage
pytest --cov=python_sdk
# Run specific test categories
pytest -m "not integration" # Skip integration tests
pytest tests/test_client.py # Run specific file
# Format code
black python_sdk tests examples
# Sort imports
isort python_sdk tests examples
# Lint code
flake8 python_sdk tests examples
# Type checking
mypy python_sdk
Check out the examples/ directory for more comprehensive examples:
We welcome contributions! Please see our Contributing Guide for details.
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Agent Lobbi - Empowering AI agents to work together seamlessly.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.2 | 7 Jul 2025 | 21 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 22:35 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:edb22f8355fdd7697090488ae497580bd42bec983978fa8fbbd1c34093639b33