Interact with Asteroid Agents using Python
Installation
Create your Python file (run_agent.py)
Run the agent
Method | Purpose | Returns |
---|---|---|
execute_agent() | Start agent execution | execution_id |
wait_for_execution_result() | Wait for completion | result |
get_execution_status() | Check current status | status_info |
get_execution_result() | Get final result | result |
upload_execution_files() | Upload files | upload_response |
get_browser_session_recording() | Get recording URL | url |
get_agent_profiles() | Get list of agent profiles | list |
get_agent_profile() | Get agent profile by ID | profile |
create_agent_profile() | Create new agent profile | profile |
update_agent_profile() | Update existing agent profile | profile |
delete_agent_profile() | Delete agent profile | string |
execute_agent() - Execute an agent with the provided parameters
agent_id
: The ID of the agent to executeexecution_data
: The execution parametersagent_profile_id
: Optional ID of the agent profileget_execution_status() - Get the current status for an execution
execution_id
: The execution identifierget_execution_result() - Get the final result of an execution
execution_id
: The execution identifierwait_for_execution_result() - Wait for an execution to reach a terminal state and return the result
execution_id
: The execution identifierinterval
: Polling interval in seconds (default is 1.0)timeout
: Maximum wait time in seconds (default is 3600 - 1 hour)upload_execution_files() - Upload files to an execution
execution_id
: The execution identifierfiles
: List of files to upload. Each file can be:default_filename
: Default filename to use when file is provided as bytesget_browser_session_recording() - Get the browser session recording URL for a completed execution
execution_id
: The execution identifierget_agent_profiles() - Get a list of agent profiles for a specific organization
organization_id
: The organization identifier (required)get_agent_profile() - Get an agent profile by ID
profile_id
: The ID of the agent profilecreate_agent_profile() - Create an agent profile
request
: The request objectupdate_agent_profile() - Update an agent profile with the provided request
profile_id
: The ID of the agent profilerequest
: The request objectdelete_agent_profile() - Delete an agent profile
profile_id
: The ID of the agent profileformat_agent_profile() - Format an agent profile for nice display
profile
: No description availableformat_agent_profiles_list() - Format a list of agent profiles for nice display
profiles
: No description available