Practical examples and use cases for the Asteroid Python SDK
This example demonstrates how to use the Asteroid Python SDK’s basic execution capabilities:
Copy
import osfrom asteroid_odyssey import AsteroidClient# Initialize client (use environment variable for security)client = AsteroidClient(os.getenv('ASTEROID_API_KEY'))try: # Execute agent with variables (or remove execution_data if no variables) execution_id = client.execute_agent( agent_id='your-agent-id', execution_data={ 'patient_name': 'john doe', 'patient_age': 45, 'reason_for_appointment': 'lower back pain' } ) # Check status manually status = client.get_execution_status(execution_id) print(f"Status: {status.status}") # Wait for the execution to complete and get the result result = client.wait_for_execution_result(execution_id) print(result)except Exception as e: print(f"Execution failed: {e}")