Welcome to the Agent Orbit Python SDK! This SDK offers a streamlined interface to interact with the Agent Orbit REST API, enabling you to create, execute, and manage agents effortlessly.
Usage
Installation
You can install the SDK using pip:
bashCopycodepipinstallagentorbit
Example Code
After installation, use the following code to interact with the Agent Orbit API:
pythonCopy codeimport agentorbit# Set your API keyagentorbit.api_key ="API_ORBIT_123456789"# Replace with your actual API key# Retrieve an agent by IDagent = agentorbit.Agent.retrieve(id="abc12345-xyz67890-test98765")# Execute the agentexecution = agent.execute()
Resources Overview
The following resources provide a fundamental understanding of Agent Orbit SDK capabilities:
1. BuilderJob
Purpose:
Automatically created whenever an Agent is created or when its python_version or dependencies attribute is updated.
Output:
Produces a Build Instance.
Note:BuilderJob and Build Instances cannot be manually created. They are automatically generated by Agent Orbit and available only for listing or retrieval.
2. ExecutorJob
Purpose:
Executes an Agent for a single task.
Output:
Produces an Execution Instance.
Creation:
Automatically initiated in the following cases:
When an Agent is executed via the Agent Orbit UI.
When the execute method is invoked in Python:
3. Agent
Purpose:
The central entity in Agent Orbit, representing programmable logic that can be executed via an ExecutorJob.
4. Build Instance
Purpose:
Represents a single successful build of an Agent.
Creation:
Automatically generated by a BuilderJob.
5. Execution Instance
Purpose:
Represents a single task execution by an Agent.
Creation:
Generated by an ExecutorJob.
6. DataStore
Purpose:
A key-value database that can be associated with multiple Agents during their creation.
Usage:
Accessed via the datastore argument in the main function of an Agent.
Example:
Conceptual API Details
Here’s an example of how the API endpoints might look for Agent Orbit:
Base URL:https://api.agentorbit.ai/v1
Endpoints:
Retrieve Agent:
GET /agents/{agent_id}
Execute Agent:
POST /agents/{agent_id}/execute
DataStore Access:
GET /datastore/{store_id}
Headers:
This conceptual display illustrates how Agent Orbit could be structured for users to integrate seamlessly with the API. Even though this is just a concept, the design emulates a realistic and intuitive interface for developers. Let me know if further refinements are needed!
pythonCopy codedef main(request, datastore):
# Set a value in the datastore
datastore["username"] = "AgentOrbitUser"
# Retrieve the value
return datastore["username"]