asteroid-odyssey 0.1.21__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- asteroid_odyssey-1.0.0/PKG-INFO +208 -0
- asteroid_odyssey-1.0.0/README.md +176 -0
- asteroid_odyssey-1.0.0/pyproject.toml +68 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/__init__.py +21 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/client.py +444 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/__init__.py +73 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/api/__init__.py +7 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/api/api_api.py +516 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/api/execution_api.py +335 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/api/sdk_api.py +1434 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/api_client.py +801 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/api_response.py +21 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/configuration.py +606 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/exceptions.py +216 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/__init__.py +27 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/browser_session_recording_response.py +87 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/error_response.py +87 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/execution_response.py +87 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/execution_result.py +101 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/execution_result_response.py +100 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/execution_status_response.py +95 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/health_check200_response.py +87 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/health_check500_response.py +87 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/status.py +43 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/structured_agent_execution_request.py +89 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/models/upload_execution_files200_response.py +89 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/rest.py +258 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey.egg-info/PKG-INFO +208 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey.egg-info/SOURCES.txt +47 -0
- asteroid_odyssey-1.0.0/src/asteroid_odyssey.egg-info/requires.txt +14 -0
- asteroid_odyssey-1.0.0/test/test_api_api.py +45 -0
- asteroid_odyssey-1.0.0/test/test_browser_session_recording_response.py +52 -0
- asteroid_odyssey-1.0.0/test/test_client.py +698 -0
- asteroid_odyssey-1.0.0/test/test_error_response.py +52 -0
- asteroid_odyssey-1.0.0/test/test_execution_api.py +38 -0
- asteroid_odyssey-1.0.0/test/test_execution_response.py +52 -0
- asteroid_odyssey-1.0.0/test/test_execution_result.py +53 -0
- asteroid_odyssey-1.0.0/test/test_execution_result_response.py +60 -0
- asteroid_odyssey-1.0.0/test/test_execution_status_response.py +56 -0
- asteroid_odyssey-1.0.0/test/test_health_check200_response.py +51 -0
- asteroid_odyssey-1.0.0/test/test_health_check500_response.py +51 -0
- asteroid_odyssey-1.0.0/test/test_sdk_api.py +59 -0
- asteroid_odyssey-1.0.0/test/test_status.py +33 -0
- asteroid_odyssey-1.0.0/test/test_structured_agent_execution_request.py +52 -0
- asteroid_odyssey-1.0.0/test/test_upload_execution_files200_response.py +54 -0
- asteroid_odyssey-0.1.21/PKG-INFO +0 -31
- asteroid_odyssey-0.1.21/README.md +0 -17
- asteroid_odyssey-0.1.21/pyproject.toml +0 -33
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/__init__.py +0 -35
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/__init__.py +0 -8
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/__init__.py +0 -1
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/agent/get_agents.py +0 -127
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/__init__.py +0 -0
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/get_open_api.py +0 -79
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/health_check.py +0 -131
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/credentials/__init__.py +0 -0
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/credentials/get_credentials_public_key.py +0 -127
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/__init__.py +0 -0
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/delete_execution.py +0 -156
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_browser_session.py +0 -154
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution.py +0 -154
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution_files.py +0 -159
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution_progress.py +0 -159
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_executions_for_workflow.py +0 -156
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/update_execution_status.py +0 -115
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/notifications/__init__.py +0 -0
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/notifications/set_slack_channel.py +0 -107
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/optimiser/__init__.py +0 -0
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/optimiser/queue_optimisation_job.py +0 -103
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/__init__.py +0 -0
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/add_workflow_credential.py +0 -111
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/create_workflow.py +0 -174
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/delete_workflow.py +0 -156
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/delete_workflow_credentials.py +0 -96
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/execute_workflow.py +0 -179
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_agent_workflow_executions.py +0 -155
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow.py +0 -154
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_credentials.py +0 -154
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_versions.py +0 -159
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/client.py +0 -268
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/errors.py +0 -16
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/__init__.py +0 -61
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/agent.py +0 -90
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/browser_session.py +0 -136
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request.py +0 -126
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request_fields.py +0 -48
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request_provider.py +0 -9
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credential.py +0 -66
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credentials_request.py +0 -72
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credentials_response.py +0 -80
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_execution_response_200.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_execution_response_404.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_workflow_response_200.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_workflow_response_404.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution.py +0 -147
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_dynamic_data.py +0 -48
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_result.py +0 -43
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_status.py +0 -89
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/file.py +0 -127
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/health_check_response_200.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/health_check_response_500.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/optimisation_request.py +0 -59
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/progress_update.py +0 -77
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/result_schema.py +0 -51
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/slack_channel_request.py +0 -58
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/status.py +0 -13
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow.py +0 -152
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_execution.py +0 -82
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_execution_request.py +0 -48
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_fields.py +0 -48
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/py.typed +0 -1
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/types.py +0 -45
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/client.py +0 -394
- asteroid_odyssey-0.1.21/src/asteroid_odyssey/exceptions.py +0 -15
- asteroid_odyssey-0.1.21/src/asteroid_odyssey.egg-info/PKG-INFO +0 -31
- asteroid_odyssey-0.1.21/src/asteroid_odyssey.egg-info/SOURCES.txt +0 -75
- asteroid_odyssey-0.1.21/src/asteroid_odyssey.egg-info/entry_points.txt +0 -2
- asteroid_odyssey-0.1.21/src/asteroid_odyssey.egg-info/requires.txt +0 -3
- {asteroid_odyssey-0.1.21 → asteroid_odyssey-1.0.0}/setup.cfg +0 -0
- /asteroid_odyssey-0.1.21/src/asteroid_odyssey/api/generated/asteroid_agents_api_client/api/agent/__init__.py → /asteroid_odyssey-1.0.0/src/asteroid_odyssey/openapi_client/py.typed +0 -0
- {asteroid_odyssey-0.1.21 → asteroid_odyssey-1.0.0}/src/asteroid_odyssey.egg-info/dependency_links.txt +0 -0
- {asteroid_odyssey-0.1.21 → asteroid_odyssey-1.0.0}/src/asteroid_odyssey.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: asteroid-odyssey
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A Python SDK for browser automation using Asteroid platform.
|
|
5
|
+
Author-email: David Mlcoch <founders@asteroid.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/asteroid/asteroid-odyssey-py
|
|
8
|
+
Project-URL: Homepage, https://asteroid.ai
|
|
9
|
+
Project-URL: Documentation, https://docs.asteroid.ai
|
|
10
|
+
Keywords: OpenAPI,OpenAPI-Generator,Asteroid Agents API,browser automation,AI agents
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Requires-Dist: urllib3<3.0.0,>=2.1.0
|
|
20
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
21
|
+
Requires-Dist: pydantic>=2
|
|
22
|
+
Requires-Dist: typing-extensions>=4.7.1
|
|
23
|
+
Requires-Dist: requests>=2.28.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=7.2.1; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=2.8.1; extra == "dev"
|
|
27
|
+
Requires-Dist: tox>=3.9.0; extra == "dev"
|
|
28
|
+
Requires-Dist: flake8>=4.0.0; extra == "dev"
|
|
29
|
+
Requires-Dist: types-python-dateutil>=2.8.19.14; extra == "dev"
|
|
30
|
+
Requires-Dist: mypy>=1.5; extra == "dev"
|
|
31
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
32
|
+
|
|
33
|
+
# Asteroid Odyssey
|
|
34
|
+
|
|
35
|
+
The official Python SDK for interacting with the Asteroid Agents API.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install asteroid-odyssey
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
Please head to our documentation at https://docs.asteroid.ai/sdk/python
|
|
46
|
+
|
|
47
|
+
## License
|
|
48
|
+
|
|
49
|
+
The Asteroid Odyssey SDK is available under the MIT License.
|
|
50
|
+
|
|
51
|
+
### Tests
|
|
52
|
+
|
|
53
|
+
Execute `pytest` to run the tests.
|
|
54
|
+
|
|
55
|
+
## Getting Started
|
|
56
|
+
|
|
57
|
+
The SDK provides a high-level `AsteroidClient` class that makes it easy to interact with the Asteroid Agents API:
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from asteroid_odyssey import AsteroidClient
|
|
61
|
+
|
|
62
|
+
# Create a client with your API key
|
|
63
|
+
client = AsteroidClient('your-api-key')
|
|
64
|
+
|
|
65
|
+
# Execute an agent
|
|
66
|
+
execution_id = client.execute_agent('my-agent-id', {'input': 'some dynamic value'})
|
|
67
|
+
|
|
68
|
+
# Wait for the execution to complete and get the result
|
|
69
|
+
result = client.wait_for_execution_result(execution_id)
|
|
70
|
+
print(result)
|
|
71
|
+
|
|
72
|
+
# Or check status manually
|
|
73
|
+
status = client.get_execution_status(execution_id)
|
|
74
|
+
print(f"Status: {status.status}")
|
|
75
|
+
|
|
76
|
+
# Upload files to an execution
|
|
77
|
+
hello_content = "Hello World!".encode()
|
|
78
|
+
response = client.upload_execution_files(execution_id, [hello_content])
|
|
79
|
+
print(f"Uploaded files: {response.file_ids}")
|
|
80
|
+
|
|
81
|
+
# Get browser session recording (for completed executions)
|
|
82
|
+
recording_url = client.get_browser_session_recording(execution_id)
|
|
83
|
+
print(f"Recording available at: {recording_url}")
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Context Manager Usage
|
|
87
|
+
|
|
88
|
+
The client can also be used as a context manager:
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
from asteroid_odyssey import AsteroidClient
|
|
92
|
+
|
|
93
|
+
with AsteroidClient('your-api-key') as client:
|
|
94
|
+
execution_id = client.execute_agent('my-agent-id', {'input': 'test'})
|
|
95
|
+
result = client.wait_for_execution_result(execution_id)
|
|
96
|
+
print(result)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Convenience Functions
|
|
100
|
+
|
|
101
|
+
The SDK also provides convenience functions:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from asteroid_odyssey import create_client, execute_agent, wait_for_execution_result
|
|
105
|
+
|
|
106
|
+
client = create_client('your-api-key')
|
|
107
|
+
execution_id = execute_agent(client, 'my-agent-id', {'input': 'test'})
|
|
108
|
+
result = wait_for_execution_result(client, execution_id)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## API Reference
|
|
112
|
+
|
|
113
|
+
### AsteroidClient
|
|
114
|
+
|
|
115
|
+
The main client class provides the following methods:
|
|
116
|
+
|
|
117
|
+
- `execute_agent(agent_id, agent_profile_id, execution_data)` - Execute an agent and return execution ID
|
|
118
|
+
- `get_execution_status(execution_id)` - Get current execution status
|
|
119
|
+
- `get_execution_result(execution_id)` - Get final execution result
|
|
120
|
+
- `wait_for_execution_result(execution_id, interval=1.0, timeout=3600.0)` - Wait for completion
|
|
121
|
+
- `upload_execution_files(execution_id, files, default_filename="file.txt")` - Upload files
|
|
122
|
+
- `get_browser_session_recording(execution_id)` - Get browser recording URL
|
|
123
|
+
|
|
124
|
+
### Low-Level API Access
|
|
125
|
+
|
|
126
|
+
If you need direct access to the generated OpenAPI client, you can still use it:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
import openapi_client
|
|
130
|
+
from openapi_client.rest import ApiException
|
|
131
|
+
from pprint import pprint
|
|
132
|
+
|
|
133
|
+
# Defining the host is optional and defaults to https://odyssey.asteroid.ai/api/v1
|
|
134
|
+
configuration = openapi_client.Configuration(
|
|
135
|
+
host = "https://odyssey.asteroid.ai/api/v1"
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
# Enter a context with an instance of the API client
|
|
139
|
+
with openapi_client.ApiClient(configuration) as api_client:
|
|
140
|
+
# Create an instance of the API class
|
|
141
|
+
api_instance = openapi_client.APIApi(api_client)
|
|
142
|
+
|
|
143
|
+
try:
|
|
144
|
+
# Get the OpenAPI schema
|
|
145
|
+
api_instance.get_open_api()
|
|
146
|
+
except ApiException as e:
|
|
147
|
+
print("Exception when calling APIApi->get_open_api: %s\n" % e)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Documentation for API Endpoints
|
|
151
|
+
|
|
152
|
+
All URIs are relative to *https://odyssey.asteroid.ai/api/v1*
|
|
153
|
+
|
|
154
|
+
Class | Method | HTTP request | Description
|
|
155
|
+
------------ | ------------- | ------------- | -------------
|
|
156
|
+
*APIApi* | [**get_open_api**](docs/APIApi.md#get_open_api) | **GET** /openapi.yaml | Get the OpenAPI schema
|
|
157
|
+
*APIApi* | [**health_check**](docs/APIApi.md#health_check) | **GET** /health | Check the health of the API
|
|
158
|
+
*ExecutionApi* | [**upload_execution_files**](docs/ExecutionApi.md#upload_execution_files) | **POST** /execution/{id}/files | Upload files to an execution
|
|
159
|
+
*SDKApi* | [**execute_agent**](docs/SDKApi.md#execute_structured_agent) | **POST** /agent/{id} | Execute an agent
|
|
160
|
+
*SDKApi* | [**get_browser_session_recording**](docs/SDKApi.md#get_browser_session_recording) | **GET** /execution/{id}/browser_session/recording | Get browser session recording
|
|
161
|
+
*SDKApi* | [**get_execution_result**](docs/SDKApi.md#get_execution_result) | **GET** /execution/{id}/result | Get execution result
|
|
162
|
+
*SDKApi* | [**get_execution_status**](docs/SDKApi.md#get_execution_status) | **GET** /execution/{id}/status | Get execution status
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
## Documentation For Models
|
|
166
|
+
|
|
167
|
+
- [BrowserSessionRecordingResponse](docs/BrowserSessionRecordingResponse.md)
|
|
168
|
+
- [ErrorResponse](docs/ErrorResponse.md)
|
|
169
|
+
- [ExecutionResponse](docs/ExecutionResponse.md)
|
|
170
|
+
- [ExecutionResult](docs/ExecutionResult.md)
|
|
171
|
+
- [ExecutionResultResponse](docs/ExecutionResultResponse.md)
|
|
172
|
+
- [ExecutionStatusResponse](docs/ExecutionStatusResponse.md)
|
|
173
|
+
- [HealthCheck200Response](docs/HealthCheck200Response.md)
|
|
174
|
+
- [HealthCheck500Response](docs/HealthCheck500Response.md)
|
|
175
|
+
- [Status](docs/Status.md)
|
|
176
|
+
- [UploadExecutionFiles200Response](docs/UploadExecutionFiles200Response.md)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<a id="documentation-for-authorization"></a>
|
|
180
|
+
## Documentation For Authorization
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
Authentication schemes defined for the API:
|
|
184
|
+
<a id="ApiKeyAuth"></a>
|
|
185
|
+
### ApiKeyAuth
|
|
186
|
+
|
|
187
|
+
- **Type**: API key
|
|
188
|
+
- **API key parameter name**: X-Asteroid-Agents-Api-Key
|
|
189
|
+
- **Location**: HTTP header
|
|
190
|
+
|
|
191
|
+
## Regenerating the SDK
|
|
192
|
+
|
|
193
|
+
To update the SDK, regenerate the code by running
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
197
|
+
-i https://odyssey.asteroid.ai/api/v1/openapi.yaml \
|
|
198
|
+
-g python \
|
|
199
|
+
-o .
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
After generation, ensure `pyproject.toml` is configured correctly and that files are modified correctly. Check for new files and if they are needed.
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Asteroid Odyssey
|
|
2
|
+
|
|
3
|
+
The official Python SDK for interacting with the Asteroid Agents API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install asteroid-odyssey
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
Please head to our documentation at https://docs.asteroid.ai/sdk/python
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
The Asteroid Odyssey SDK is available under the MIT License.
|
|
18
|
+
|
|
19
|
+
### Tests
|
|
20
|
+
|
|
21
|
+
Execute `pytest` to run the tests.
|
|
22
|
+
|
|
23
|
+
## Getting Started
|
|
24
|
+
|
|
25
|
+
The SDK provides a high-level `AsteroidClient` class that makes it easy to interact with the Asteroid Agents API:
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from asteroid_odyssey import AsteroidClient
|
|
29
|
+
|
|
30
|
+
# Create a client with your API key
|
|
31
|
+
client = AsteroidClient('your-api-key')
|
|
32
|
+
|
|
33
|
+
# Execute an agent
|
|
34
|
+
execution_id = client.execute_agent('my-agent-id', {'input': 'some dynamic value'})
|
|
35
|
+
|
|
36
|
+
# Wait for the execution to complete and get the result
|
|
37
|
+
result = client.wait_for_execution_result(execution_id)
|
|
38
|
+
print(result)
|
|
39
|
+
|
|
40
|
+
# Or check status manually
|
|
41
|
+
status = client.get_execution_status(execution_id)
|
|
42
|
+
print(f"Status: {status.status}")
|
|
43
|
+
|
|
44
|
+
# Upload files to an execution
|
|
45
|
+
hello_content = "Hello World!".encode()
|
|
46
|
+
response = client.upload_execution_files(execution_id, [hello_content])
|
|
47
|
+
print(f"Uploaded files: {response.file_ids}")
|
|
48
|
+
|
|
49
|
+
# Get browser session recording (for completed executions)
|
|
50
|
+
recording_url = client.get_browser_session_recording(execution_id)
|
|
51
|
+
print(f"Recording available at: {recording_url}")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Context Manager Usage
|
|
55
|
+
|
|
56
|
+
The client can also be used as a context manager:
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from asteroid_odyssey import AsteroidClient
|
|
60
|
+
|
|
61
|
+
with AsteroidClient('your-api-key') as client:
|
|
62
|
+
execution_id = client.execute_agent('my-agent-id', {'input': 'test'})
|
|
63
|
+
result = client.wait_for_execution_result(execution_id)
|
|
64
|
+
print(result)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Convenience Functions
|
|
68
|
+
|
|
69
|
+
The SDK also provides convenience functions:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
from asteroid_odyssey import create_client, execute_agent, wait_for_execution_result
|
|
73
|
+
|
|
74
|
+
client = create_client('your-api-key')
|
|
75
|
+
execution_id = execute_agent(client, 'my-agent-id', {'input': 'test'})
|
|
76
|
+
result = wait_for_execution_result(client, execution_id)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## API Reference
|
|
80
|
+
|
|
81
|
+
### AsteroidClient
|
|
82
|
+
|
|
83
|
+
The main client class provides the following methods:
|
|
84
|
+
|
|
85
|
+
- `execute_agent(agent_id, agent_profile_id, execution_data)` - Execute an agent and return execution ID
|
|
86
|
+
- `get_execution_status(execution_id)` - Get current execution status
|
|
87
|
+
- `get_execution_result(execution_id)` - Get final execution result
|
|
88
|
+
- `wait_for_execution_result(execution_id, interval=1.0, timeout=3600.0)` - Wait for completion
|
|
89
|
+
- `upload_execution_files(execution_id, files, default_filename="file.txt")` - Upload files
|
|
90
|
+
- `get_browser_session_recording(execution_id)` - Get browser recording URL
|
|
91
|
+
|
|
92
|
+
### Low-Level API Access
|
|
93
|
+
|
|
94
|
+
If you need direct access to the generated OpenAPI client, you can still use it:
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
import openapi_client
|
|
98
|
+
from openapi_client.rest import ApiException
|
|
99
|
+
from pprint import pprint
|
|
100
|
+
|
|
101
|
+
# Defining the host is optional and defaults to https://odyssey.asteroid.ai/api/v1
|
|
102
|
+
configuration = openapi_client.Configuration(
|
|
103
|
+
host = "https://odyssey.asteroid.ai/api/v1"
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# Enter a context with an instance of the API client
|
|
107
|
+
with openapi_client.ApiClient(configuration) as api_client:
|
|
108
|
+
# Create an instance of the API class
|
|
109
|
+
api_instance = openapi_client.APIApi(api_client)
|
|
110
|
+
|
|
111
|
+
try:
|
|
112
|
+
# Get the OpenAPI schema
|
|
113
|
+
api_instance.get_open_api()
|
|
114
|
+
except ApiException as e:
|
|
115
|
+
print("Exception when calling APIApi->get_open_api: %s\n" % e)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Documentation for API Endpoints
|
|
119
|
+
|
|
120
|
+
All URIs are relative to *https://odyssey.asteroid.ai/api/v1*
|
|
121
|
+
|
|
122
|
+
Class | Method | HTTP request | Description
|
|
123
|
+
------------ | ------------- | ------------- | -------------
|
|
124
|
+
*APIApi* | [**get_open_api**](docs/APIApi.md#get_open_api) | **GET** /openapi.yaml | Get the OpenAPI schema
|
|
125
|
+
*APIApi* | [**health_check**](docs/APIApi.md#health_check) | **GET** /health | Check the health of the API
|
|
126
|
+
*ExecutionApi* | [**upload_execution_files**](docs/ExecutionApi.md#upload_execution_files) | **POST** /execution/{id}/files | Upload files to an execution
|
|
127
|
+
*SDKApi* | [**execute_agent**](docs/SDKApi.md#execute_structured_agent) | **POST** /agent/{id} | Execute an agent
|
|
128
|
+
*SDKApi* | [**get_browser_session_recording**](docs/SDKApi.md#get_browser_session_recording) | **GET** /execution/{id}/browser_session/recording | Get browser session recording
|
|
129
|
+
*SDKApi* | [**get_execution_result**](docs/SDKApi.md#get_execution_result) | **GET** /execution/{id}/result | Get execution result
|
|
130
|
+
*SDKApi* | [**get_execution_status**](docs/SDKApi.md#get_execution_status) | **GET** /execution/{id}/status | Get execution status
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## Documentation For Models
|
|
134
|
+
|
|
135
|
+
- [BrowserSessionRecordingResponse](docs/BrowserSessionRecordingResponse.md)
|
|
136
|
+
- [ErrorResponse](docs/ErrorResponse.md)
|
|
137
|
+
- [ExecutionResponse](docs/ExecutionResponse.md)
|
|
138
|
+
- [ExecutionResult](docs/ExecutionResult.md)
|
|
139
|
+
- [ExecutionResultResponse](docs/ExecutionResultResponse.md)
|
|
140
|
+
- [ExecutionStatusResponse](docs/ExecutionStatusResponse.md)
|
|
141
|
+
- [HealthCheck200Response](docs/HealthCheck200Response.md)
|
|
142
|
+
- [HealthCheck500Response](docs/HealthCheck500Response.md)
|
|
143
|
+
- [Status](docs/Status.md)
|
|
144
|
+
- [UploadExecutionFiles200Response](docs/UploadExecutionFiles200Response.md)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<a id="documentation-for-authorization"></a>
|
|
148
|
+
## Documentation For Authorization
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
Authentication schemes defined for the API:
|
|
152
|
+
<a id="ApiKeyAuth"></a>
|
|
153
|
+
### ApiKeyAuth
|
|
154
|
+
|
|
155
|
+
- **Type**: API key
|
|
156
|
+
- **API key parameter name**: X-Asteroid-Agents-Api-Key
|
|
157
|
+
- **Location**: HTTP header
|
|
158
|
+
|
|
159
|
+
## Regenerating the SDK
|
|
160
|
+
|
|
161
|
+
To update the SDK, regenerate the code by running
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npx @openapitools/openapi-generator-cli generate \
|
|
165
|
+
-i https://odyssey.asteroid.ai/api/v1/openapi.yaml \
|
|
166
|
+
-g python \
|
|
167
|
+
-o .
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
After generation, ensure `pyproject.toml` is configured correctly and that files are modified correctly. Check for new files and if they are needed.
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "asteroid-odyssey"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name = "David Mlcoch", email = "founders@asteroid.com" },
|
|
6
|
+
]
|
|
7
|
+
description = "A Python SDK for browser automation using Asteroid platform."
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.9"
|
|
10
|
+
keywords = ["OpenAPI", "OpenAPI-Generator", "Asteroid Agents API", "browser automation", "AI agents"]
|
|
11
|
+
license = "MIT"
|
|
12
|
+
|
|
13
|
+
dependencies = [
|
|
14
|
+
"urllib3>=2.1.0,<3.0.0",
|
|
15
|
+
"python-dateutil>=2.8.2",
|
|
16
|
+
"pydantic>=2",
|
|
17
|
+
"typing-extensions>=4.7.1",
|
|
18
|
+
"requests>=2.28.0"
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Development Status :: 4 - Beta",
|
|
24
|
+
"Intended Audience :: Developers",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
"Topic :: Internet :: WWW/HTTP :: Browsers",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Repository = "https://github.com/asteroid/asteroid-odyssey-py"
|
|
31
|
+
Homepage = "https://asteroid.ai"
|
|
32
|
+
Documentation = "https://docs.asteroid.ai"
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
dev = [
|
|
36
|
+
"pytest>=7.2.1",
|
|
37
|
+
"pytest-cov>=2.8.1",
|
|
38
|
+
"tox>=3.9.0",
|
|
39
|
+
"flake8>=4.0.0",
|
|
40
|
+
"types-python-dateutil>=2.8.19.14",
|
|
41
|
+
"mypy>=1.5",
|
|
42
|
+
"twine>=4.0.0"
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
[build-system]
|
|
46
|
+
requires = ["setuptools>=65", "wheel"]
|
|
47
|
+
build-backend = "setuptools.build_meta"
|
|
48
|
+
|
|
49
|
+
[tool.setuptools.packages.find]
|
|
50
|
+
where = ["src"]
|
|
51
|
+
include = ["asteroid_odyssey", "asteroid_odyssey.*"]
|
|
52
|
+
exclude = ["tests", "tests.*"]
|
|
53
|
+
|
|
54
|
+
[tool.pylint.'MESSAGES CONTROL']
|
|
55
|
+
extension-pkg-whitelist = "pydantic"
|
|
56
|
+
|
|
57
|
+
[tool.mypy]
|
|
58
|
+
files = ["src/asteroid_odyssey", "tests"]
|
|
59
|
+
strict = false
|
|
60
|
+
warn_unused_configs = true
|
|
61
|
+
warn_redundant_casts = true
|
|
62
|
+
warn_unused_ignores = true
|
|
63
|
+
strict_equality = true
|
|
64
|
+
extra_checks = true
|
|
65
|
+
check_untyped_defs = true
|
|
66
|
+
disallow_subclassing_any = true
|
|
67
|
+
disallow_untyped_decorators = true
|
|
68
|
+
disallow_any_generics = true
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from .client import (
|
|
2
|
+
AsteroidClient,
|
|
3
|
+
create_client,
|
|
4
|
+
execute_agent,
|
|
5
|
+
get_execution_status,
|
|
6
|
+
get_execution_result,
|
|
7
|
+
wait_for_execution_result,
|
|
8
|
+
upload_execution_files,
|
|
9
|
+
get_browser_session_recording
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
'AsteroidClient',
|
|
14
|
+
'create_client',
|
|
15
|
+
'execute_agent',
|
|
16
|
+
'get_execution_status',
|
|
17
|
+
'get_execution_result',
|
|
18
|
+
'wait_for_execution_result',
|
|
19
|
+
'upload_execution_files',
|
|
20
|
+
'get_browser_session_recording'
|
|
21
|
+
]
|