asteroid-odyssey 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl
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/client.py +29 -11
- asteroid_odyssey/openapi_client/__init__.py +23 -23
- asteroid_odyssey/openapi_client/api/__init__.py +3 -3
- asteroid_odyssey/openapi_client/api/api_api.py +4 -4
- asteroid_odyssey/openapi_client/api/execution_api.py +4 -4
- asteroid_odyssey/openapi_client/api/sdk_api.py +9 -9
- asteroid_odyssey/openapi_client/api_client.py +6 -6
- asteroid_odyssey/openapi_client/configuration.py +2 -2
- asteroid_odyssey/openapi_client/models/__init__.py +11 -11
- asteroid_odyssey/openapi_client/models/execution_result_response.py +2 -2
- asteroid_odyssey/openapi_client/models/execution_status_response.py +1 -1
- asteroid_odyssey/openapi_client/models/status.py +1 -1
- asteroid_odyssey/openapi_client/rest.py +1 -1
- {asteroid_odyssey-1.0.1.dist-info → asteroid_odyssey-1.0.3.dist-info}/METADATA +37 -33
- {asteroid_odyssey-1.0.1.dist-info → asteroid_odyssey-1.0.3.dist-info}/RECORD +17 -17
- {asteroid_odyssey-1.0.1.dist-info → asteroid_odyssey-1.0.3.dist-info}/WHEEL +0 -0
- {asteroid_odyssey-1.0.1.dist-info → asteroid_odyssey-1.0.3.dist-info}/top_level.txt +0 -0
asteroid_odyssey/client.py
CHANGED
|
@@ -10,6 +10,7 @@ without modifying any generated files.
|
|
|
10
10
|
|
|
11
11
|
import time
|
|
12
12
|
import os
|
|
13
|
+
import logging
|
|
13
14
|
from typing import Dict, Any, Optional, List, Union, Tuple
|
|
14
15
|
from .openapi_client import (
|
|
15
16
|
Configuration,
|
|
@@ -58,14 +59,14 @@ class AsteroidClient:
|
|
|
58
59
|
self.sdk_api = SDKApi(self.api_client)
|
|
59
60
|
self.execution_api = ExecutionApi(self.api_client)
|
|
60
61
|
|
|
61
|
-
def execute_agent(self, agent_id: str,
|
|
62
|
+
def execute_agent(self, agent_id: str, execution_data: Dict[str, Any], agent_profile_id: Optional[str] = None) -> str:
|
|
62
63
|
"""
|
|
63
64
|
Execute an agent with the provided parameters.
|
|
64
65
|
|
|
65
66
|
Args:
|
|
66
67
|
agent_id: The ID of the agent to execute
|
|
67
|
-
agent_profile_id: The ID of the agent profile
|
|
68
68
|
execution_data: The execution parameters
|
|
69
|
+
agent_profile_id: Optional ID of the agent profile
|
|
69
70
|
|
|
70
71
|
Returns:
|
|
71
72
|
The execution ID
|
|
@@ -74,9 +75,12 @@ class AsteroidClient:
|
|
|
74
75
|
Exception: If the execution request fails
|
|
75
76
|
|
|
76
77
|
Example:
|
|
77
|
-
execution_id = client.
|
|
78
|
+
execution_id = client.execute_agent('my-agent-id', {'input': 'some dynamic value'}, 'agent-profile-id')
|
|
78
79
|
"""
|
|
79
|
-
req = StructuredAgentExecutionRequest(
|
|
80
|
+
req = StructuredAgentExecutionRequest(
|
|
81
|
+
dynamic_data=execution_data,
|
|
82
|
+
agent_profile_id=agent_profile_id
|
|
83
|
+
)
|
|
80
84
|
try:
|
|
81
85
|
response = self.sdk_api.execute_agent_structured(agent_id, req)
|
|
82
86
|
return response.execution_id
|
|
@@ -278,9 +282,23 @@ class AsteroidClient:
|
|
|
278
282
|
"""Context manager entry."""
|
|
279
283
|
return self
|
|
280
284
|
|
|
281
|
-
def __exit__(self, exc_type, exc_value,
|
|
282
|
-
"""Context manager exit."""
|
|
283
|
-
|
|
285
|
+
def __exit__(self, exc_type, exc_value, tb):
|
|
286
|
+
"""Context manager exit: clean up API client connection pool."""
|
|
287
|
+
try:
|
|
288
|
+
# Try to grab the pool_manager; if any attr is missing, skip
|
|
289
|
+
try:
|
|
290
|
+
pool_manager = self.api_client.rest_client.pool_manager
|
|
291
|
+
except AttributeError:
|
|
292
|
+
pool_manager = None
|
|
293
|
+
|
|
294
|
+
if pool_manager:
|
|
295
|
+
pool_manager.clear()
|
|
296
|
+
except Exception as e:
|
|
297
|
+
# Log but don't mask the original exception (if any)
|
|
298
|
+
logging.warning("Failed to clear connection pool: %s", e)
|
|
299
|
+
|
|
300
|
+
# Returning False allows any exception in the 'with' block to propagate
|
|
301
|
+
return False
|
|
284
302
|
|
|
285
303
|
|
|
286
304
|
# Convenience functions that mirror the TypeScript SDK pattern
|
|
@@ -302,23 +320,23 @@ def create_client(api_key: str, base_url: Optional[str] = None) -> AsteroidClien
|
|
|
302
320
|
"""
|
|
303
321
|
return AsteroidClient(api_key, base_url)
|
|
304
322
|
|
|
305
|
-
def execute_agent(client: AsteroidClient, agent_id: str,
|
|
323
|
+
def execute_agent(client: AsteroidClient, agent_id: str, execution_data: Dict[str, Any], agent_profile_id: Optional[str] = None) -> str:
|
|
306
324
|
"""
|
|
307
325
|
Execute an agent with the provided parameters.
|
|
308
326
|
|
|
309
327
|
Args:
|
|
310
328
|
client: The AsteroidClient instance
|
|
311
329
|
agent_id: The ID of the agent to execute
|
|
312
|
-
agent_profile_id: The ID of the agent profile
|
|
313
330
|
execution_data: The execution parameters
|
|
331
|
+
agent_profile_id: Optional ID of the agent profile
|
|
314
332
|
|
|
315
333
|
Returns:
|
|
316
334
|
The execution ID
|
|
317
335
|
|
|
318
336
|
Example:
|
|
319
|
-
execution_id = execute_agent(client, 'my-agent-id', {'input': 'some dynamic value'})
|
|
337
|
+
execution_id = execute_agent(client, 'my-agent-id', {'input': 'some dynamic value'}, 'agent-profile-id')
|
|
320
338
|
"""
|
|
321
|
-
return client.execute_agent(agent_id,
|
|
339
|
+
return client.execute_agent(agent_id, execution_data, agent_profile_id)
|
|
322
340
|
|
|
323
341
|
|
|
324
342
|
|
|
@@ -44,30 +44,30 @@ __all__ = [
|
|
|
44
44
|
]
|
|
45
45
|
|
|
46
46
|
# import apis into sdk package
|
|
47
|
-
from openapi_client.api.api_api import APIApi as APIApi
|
|
48
|
-
from openapi_client.api.execution_api import ExecutionApi as ExecutionApi
|
|
49
|
-
from openapi_client.api.sdk_api import SDKApi as SDKApi
|
|
47
|
+
from asteroid_odyssey.openapi_client.api.api_api import APIApi as APIApi
|
|
48
|
+
from asteroid_odyssey.openapi_client.api.execution_api import ExecutionApi as ExecutionApi
|
|
49
|
+
from asteroid_odyssey.openapi_client.api.sdk_api import SDKApi as SDKApi
|
|
50
50
|
|
|
51
51
|
# import ApiClient
|
|
52
|
-
from openapi_client.api_response import ApiResponse as ApiResponse
|
|
53
|
-
from openapi_client.api_client import ApiClient as ApiClient
|
|
54
|
-
from openapi_client.configuration import Configuration as Configuration
|
|
55
|
-
from openapi_client.exceptions import OpenApiException as OpenApiException
|
|
56
|
-
from openapi_client.exceptions import ApiTypeError as ApiTypeError
|
|
57
|
-
from openapi_client.exceptions import ApiValueError as ApiValueError
|
|
58
|
-
from openapi_client.exceptions import ApiKeyError as ApiKeyError
|
|
59
|
-
from openapi_client.exceptions import ApiAttributeError as ApiAttributeError
|
|
60
|
-
from openapi_client.exceptions import ApiException as ApiException
|
|
52
|
+
from asteroid_odyssey.openapi_client.api_response import ApiResponse as ApiResponse
|
|
53
|
+
from asteroid_odyssey.openapi_client.api_client import ApiClient as ApiClient
|
|
54
|
+
from asteroid_odyssey.openapi_client.configuration import Configuration as Configuration
|
|
55
|
+
from asteroid_odyssey.openapi_client.exceptions import OpenApiException as OpenApiException
|
|
56
|
+
from asteroid_odyssey.openapi_client.exceptions import ApiTypeError as ApiTypeError
|
|
57
|
+
from asteroid_odyssey.openapi_client.exceptions import ApiValueError as ApiValueError
|
|
58
|
+
from asteroid_odyssey.openapi_client.exceptions import ApiKeyError as ApiKeyError
|
|
59
|
+
from asteroid_odyssey.openapi_client.exceptions import ApiAttributeError as ApiAttributeError
|
|
60
|
+
from asteroid_odyssey.openapi_client.exceptions import ApiException as ApiException
|
|
61
61
|
|
|
62
62
|
# import models into sdk package
|
|
63
|
-
from openapi_client.models.browser_session_recording_response import BrowserSessionRecordingResponse as BrowserSessionRecordingResponse
|
|
64
|
-
from openapi_client.models.error_response import ErrorResponse as ErrorResponse
|
|
65
|
-
from openapi_client.models.execution_response import ExecutionResponse as ExecutionResponse
|
|
66
|
-
from openapi_client.models.execution_result import ExecutionResult as ExecutionResult
|
|
67
|
-
from openapi_client.models.execution_result_response import ExecutionResultResponse as ExecutionResultResponse
|
|
68
|
-
from openapi_client.models.execution_status_response import ExecutionStatusResponse as ExecutionStatusResponse
|
|
69
|
-
from openapi_client.models.health_check200_response import HealthCheck200Response as HealthCheck200Response
|
|
70
|
-
from openapi_client.models.health_check500_response import HealthCheck500Response as HealthCheck500Response
|
|
71
|
-
from openapi_client.models.status import Status as Status
|
|
72
|
-
from openapi_client.models.structured_agent_execution_request import StructuredAgentExecutionRequest as StructuredAgentExecutionRequest
|
|
73
|
-
from openapi_client.models.upload_execution_files200_response import UploadExecutionFiles200Response as UploadExecutionFiles200Response
|
|
63
|
+
from asteroid_odyssey.openapi_client.models.browser_session_recording_response import BrowserSessionRecordingResponse as BrowserSessionRecordingResponse
|
|
64
|
+
from asteroid_odyssey.openapi_client.models.error_response import ErrorResponse as ErrorResponse
|
|
65
|
+
from asteroid_odyssey.openapi_client.models.execution_response import ExecutionResponse as ExecutionResponse
|
|
66
|
+
from asteroid_odyssey.openapi_client.models.execution_result import ExecutionResult as ExecutionResult
|
|
67
|
+
from asteroid_odyssey.openapi_client.models.execution_result_response import ExecutionResultResponse as ExecutionResultResponse
|
|
68
|
+
from asteroid_odyssey.openapi_client.models.execution_status_response import ExecutionStatusResponse as ExecutionStatusResponse
|
|
69
|
+
from asteroid_odyssey.openapi_client.models.health_check200_response import HealthCheck200Response as HealthCheck200Response
|
|
70
|
+
from asteroid_odyssey.openapi_client.models.health_check500_response import HealthCheck500Response as HealthCheck500Response
|
|
71
|
+
from asteroid_odyssey.openapi_client.models.status import Status as Status
|
|
72
|
+
from asteroid_odyssey.openapi_client.models.structured_agent_execution_request import StructuredAgentExecutionRequest as StructuredAgentExecutionRequest
|
|
73
|
+
from asteroid_odyssey.openapi_client.models.upload_execution_files200_response import UploadExecutionFiles200Response as UploadExecutionFiles200Response
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# flake8: noqa
|
|
2
2
|
|
|
3
3
|
# import apis into api package
|
|
4
|
-
from openapi_client.api.api_api import APIApi
|
|
5
|
-
from openapi_client.api.execution_api import ExecutionApi
|
|
6
|
-
from openapi_client.api.sdk_api import SDKApi
|
|
4
|
+
from asteroid_odyssey.openapi_client.api.api_api import APIApi
|
|
5
|
+
from asteroid_odyssey.openapi_client.api.execution_api import ExecutionApi
|
|
6
|
+
from asteroid_odyssey.openapi_client.api.sdk_api import SDKApi
|
|
7
7
|
|
|
@@ -16,11 +16,11 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
|
18
18
|
|
|
19
|
-
from openapi_client.models.health_check200_response import HealthCheck200Response
|
|
19
|
+
from asteroid_odyssey.openapi_client.models.health_check200_response import HealthCheck200Response
|
|
20
20
|
|
|
21
|
-
from openapi_client.api_client import ApiClient, RequestSerialized
|
|
22
|
-
from openapi_client.api_response import ApiResponse
|
|
23
|
-
from openapi_client.rest import RESTResponseType
|
|
21
|
+
from asteroid_odyssey.openapi_client.api_client import ApiClient, RequestSerialized
|
|
22
|
+
from asteroid_odyssey.openapi_client.api_response import ApiResponse
|
|
23
|
+
from asteroid_odyssey.openapi_client.rest import RESTResponseType
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class APIApi:
|
|
@@ -19,11 +19,11 @@ from typing_extensions import Annotated
|
|
|
19
19
|
from pydantic import Field, StrictBytes, StrictStr
|
|
20
20
|
from typing import List, Optional, Tuple, Union
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
|
-
from openapi_client.models.upload_execution_files200_response import UploadExecutionFiles200Response
|
|
22
|
+
from asteroid_odyssey.openapi_client.models.upload_execution_files200_response import UploadExecutionFiles200Response
|
|
23
23
|
|
|
24
|
-
from openapi_client.api_client import ApiClient, RequestSerialized
|
|
25
|
-
from openapi_client.api_response import ApiResponse
|
|
26
|
-
from openapi_client.rest import RESTResponseType
|
|
24
|
+
from asteroid_odyssey.openapi_client.api_client import ApiClient, RequestSerialized
|
|
25
|
+
from asteroid_odyssey.openapi_client.api_response import ApiResponse
|
|
26
|
+
from asteroid_odyssey.openapi_client.rest import RESTResponseType
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
class ExecutionApi:
|
|
@@ -19,15 +19,15 @@ from typing_extensions import Annotated
|
|
|
19
19
|
from pydantic import Field, StrictStr
|
|
20
20
|
from typing import Any, Dict
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
|
-
from openapi_client.models.browser_session_recording_response import BrowserSessionRecordingResponse
|
|
23
|
-
from openapi_client.models.execution_response import ExecutionResponse
|
|
24
|
-
from openapi_client.models.execution_result_response import ExecutionResultResponse
|
|
25
|
-
from openapi_client.models.execution_status_response import ExecutionStatusResponse
|
|
26
|
-
from openapi_client.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
27
|
-
|
|
28
|
-
from openapi_client.api_client import ApiClient, RequestSerialized
|
|
29
|
-
from openapi_client.api_response import ApiResponse
|
|
30
|
-
from openapi_client.rest import RESTResponseType
|
|
22
|
+
from asteroid_odyssey.openapi_client.models.browser_session_recording_response import BrowserSessionRecordingResponse
|
|
23
|
+
from asteroid_odyssey.openapi_client.models.execution_response import ExecutionResponse
|
|
24
|
+
from asteroid_odyssey.openapi_client.models.execution_result_response import ExecutionResultResponse
|
|
25
|
+
from asteroid_odyssey.openapi_client.models.execution_status_response import ExecutionStatusResponse
|
|
26
|
+
from asteroid_odyssey.openapi_client.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
27
|
+
|
|
28
|
+
from asteroid_odyssey.openapi_client.api_client import ApiClient, RequestSerialized
|
|
29
|
+
from asteroid_odyssey.openapi_client.api_response import ApiResponse
|
|
30
|
+
from asteroid_odyssey.openapi_client.rest import RESTResponseType
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class SDKApi:
|
|
@@ -26,11 +26,11 @@ from urllib.parse import quote
|
|
|
26
26
|
from typing import Tuple, Optional, List, Dict, Union
|
|
27
27
|
from pydantic import SecretStr
|
|
28
28
|
|
|
29
|
-
from openapi_client.configuration import Configuration
|
|
30
|
-
from openapi_client.api_response import ApiResponse, T as ApiResponseT
|
|
31
|
-
import openapi_client.models
|
|
32
|
-
from openapi_client import rest
|
|
33
|
-
from openapi_client.exceptions import (
|
|
29
|
+
from asteroid_odyssey.openapi_client.configuration import Configuration
|
|
30
|
+
from asteroid_odyssey.openapi_client.api_response import ApiResponse, T as ApiResponseT
|
|
31
|
+
import asteroid_odyssey.openapi_client.models
|
|
32
|
+
from asteroid_odyssey.openapi_client import rest
|
|
33
|
+
from asteroid_odyssey.openapi_client.exceptions import (
|
|
34
34
|
ApiValueError,
|
|
35
35
|
ApiException,
|
|
36
36
|
BadRequestException,
|
|
@@ -453,7 +453,7 @@ class ApiClient:
|
|
|
453
453
|
if klass in self.NATIVE_TYPES_MAPPING:
|
|
454
454
|
klass = self.NATIVE_TYPES_MAPPING[klass]
|
|
455
455
|
else:
|
|
456
|
-
klass = getattr(openapi_client.models, klass)
|
|
456
|
+
klass = getattr(asteroid_odyssey.openapi_client.models, klass)
|
|
457
457
|
|
|
458
458
|
if klass in self.PRIMITIVE_TYPES:
|
|
459
459
|
return self.__deserialize_primitive(data, klass)
|
|
@@ -177,7 +177,7 @@ class Configuration:
|
|
|
177
177
|
|
|
178
178
|
You can programmatically set the cookie:
|
|
179
179
|
|
|
180
|
-
conf = openapi_client.Configuration(
|
|
180
|
+
conf = asteroid_odyssey.openapi_client.Configuration(
|
|
181
181
|
api_key={'cookieAuth': 'abc123'}
|
|
182
182
|
api_key_prefix={'cookieAuth': 'JSESSIONID'}
|
|
183
183
|
)
|
|
@@ -252,7 +252,7 @@ conf = openapi_client.Configuration(
|
|
|
252
252
|
self.logger = {}
|
|
253
253
|
"""Logging Settings
|
|
254
254
|
"""
|
|
255
|
-
self.logger["package_logger"] = logging.getLogger("openapi_client")
|
|
255
|
+
self.logger["package_logger"] = logging.getLogger("asteroid_odyssey.openapi_client")
|
|
256
256
|
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
|
257
257
|
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
|
258
258
|
"""Log format
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
# import models into model package
|
|
17
|
-
from openapi_client.models.browser_session_recording_response import BrowserSessionRecordingResponse
|
|
18
|
-
from openapi_client.models.error_response import ErrorResponse
|
|
19
|
-
from openapi_client.models.execution_response import ExecutionResponse
|
|
20
|
-
from openapi_client.models.execution_result import ExecutionResult
|
|
21
|
-
from openapi_client.models.execution_result_response import ExecutionResultResponse
|
|
22
|
-
from openapi_client.models.execution_status_response import ExecutionStatusResponse
|
|
23
|
-
from openapi_client.models.health_check200_response import HealthCheck200Response
|
|
24
|
-
from openapi_client.models.health_check500_response import HealthCheck500Response
|
|
25
|
-
from openapi_client.models.status import Status
|
|
26
|
-
from openapi_client.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
27
|
-
from openapi_client.models.upload_execution_files200_response import UploadExecutionFiles200Response
|
|
17
|
+
from asteroid_odyssey.openapi_client.models.browser_session_recording_response import BrowserSessionRecordingResponse
|
|
18
|
+
from asteroid_odyssey.openapi_client.models.error_response import ErrorResponse
|
|
19
|
+
from asteroid_odyssey.openapi_client.models.execution_response import ExecutionResponse
|
|
20
|
+
from asteroid_odyssey.openapi_client.models.execution_result import ExecutionResult
|
|
21
|
+
from asteroid_odyssey.openapi_client.models.execution_result_response import ExecutionResultResponse
|
|
22
|
+
from asteroid_odyssey.openapi_client.models.execution_status_response import ExecutionStatusResponse
|
|
23
|
+
from asteroid_odyssey.openapi_client.models.health_check200_response import HealthCheck200Response
|
|
24
|
+
from asteroid_odyssey.openapi_client.models.health_check500_response import HealthCheck500Response
|
|
25
|
+
from asteroid_odyssey.openapi_client.models.status import Status
|
|
26
|
+
from asteroid_odyssey.openapi_client.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
27
|
+
from asteroid_odyssey.openapi_client.models.upload_execution_files200_response import UploadExecutionFiles200Response
|
|
@@ -19,8 +19,8 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from openapi_client.models.execution_result import ExecutionResult
|
|
23
|
-
from openapi_client.models.status import Status
|
|
22
|
+
from asteroid_odyssey.openapi_client.models.execution_result import ExecutionResult
|
|
23
|
+
from asteroid_odyssey.openapi_client.models.status import Status
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
@@ -20,7 +20,7 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from openapi_client.models.status import Status
|
|
23
|
+
from asteroid_odyssey.openapi_client.models.status import Status
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
@@ -19,7 +19,7 @@ import ssl
|
|
|
19
19
|
|
|
20
20
|
import urllib3
|
|
21
21
|
|
|
22
|
-
from openapi_client.exceptions import ApiException, ApiValueError
|
|
22
|
+
from asteroid_odyssey.openapi_client.exceptions import ApiException, ApiValueError
|
|
23
23
|
|
|
24
24
|
SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
|
|
25
25
|
RESTResponseType = urllib3.HTTPResponse
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: asteroid-odyssey
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: A Python SDK for browser automation using Asteroid platform.
|
|
5
5
|
Author-email: David Mlcoch <founders@asteroid.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -28,7 +28,6 @@ Requires-Dist: tox>=3.9.0; extra == "dev"
|
|
|
28
28
|
Requires-Dist: flake8>=4.0.0; extra == "dev"
|
|
29
29
|
Requires-Dist: types-python-dateutil>=2.8.19.14; extra == "dev"
|
|
30
30
|
Requires-Dist: mypy>=1.5; extra == "dev"
|
|
31
|
-
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
32
31
|
|
|
33
32
|
# Asteroid Odyssey
|
|
34
33
|
|
|
@@ -114,7 +113,7 @@ result = wait_for_execution_result(client, execution_id)
|
|
|
114
113
|
|
|
115
114
|
The main client class provides the following methods:
|
|
116
115
|
|
|
117
|
-
- `execute_agent(agent_id, agent_profile_id, execution_data)` - Execute an agent and return execution ID
|
|
116
|
+
- `execute_agent(agent_id, agent_profile_id (optional), execution_data(optional))` - Execute an agent and return execution ID
|
|
118
117
|
- `get_execution_status(execution_id)` - Get current execution status
|
|
119
118
|
- `get_execution_result(execution_id)` - Get final execution result
|
|
120
119
|
- `wait_for_execution_result(execution_id, interval=1.0, timeout=3600.0)` - Wait for completion
|
|
@@ -147,38 +146,21 @@ with openapi_client.ApiClient(configuration) as api_client:
|
|
|
147
146
|
print("Exception when calling APIApi->get_open_api: %s\n" % e)
|
|
148
147
|
```
|
|
149
148
|
|
|
150
|
-
|
|
149
|
+
| Class | Method | Return Type Representation | Description |
|
|
150
|
+
| ---------------- | ------------------------------- | -------------------------- | -------------------------------------------------------- |
|
|
151
|
+
| `AsteroidClient` | `execute_agent` | `str` (execution ID) | Executes an agent and returns its execution ID. |
|
|
152
|
+
| `AsteroidClient` | `get_execution_status` | `dict-like object` | Gets the current status of an execution. |
|
|
153
|
+
| `AsteroidClient` | `get_execution_result` | `dict` (execution result) | Retrieves the result data of a completed execution. |
|
|
154
|
+
| `AsteroidClient` | `get_browser_session_recording` | `str` (URL) | Returns the session recording URL of an execution. |
|
|
155
|
+
| `AsteroidClient` | `upload_execution_files` | `dict-like object` | Uploads files to an execution and returns file metadata. |
|
|
151
156
|
|
|
152
|
-
All URIs are relative to *https://odyssey.asteroid.ai/api/v1*
|
|
153
157
|
|
|
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
158
|
|
|
178
159
|
|
|
179
160
|
<a id="documentation-for-authorization"></a>
|
|
180
161
|
## Documentation For Authorization
|
|
181
162
|
|
|
163
|
+
To generate an API key, go to our [platform](https://platform.asteroid.ai) and in your profile section, click on API Keys. You can now create and manage your API keys.
|
|
182
164
|
|
|
183
165
|
Authentication schemes defined for the API:
|
|
184
166
|
<a id="ApiKeyAuth"></a>
|
|
@@ -188,18 +170,40 @@ Authentication schemes defined for the API:
|
|
|
188
170
|
- **API key parameter name**: X-Asteroid-Agents-Api-Key
|
|
189
171
|
- **Location**: HTTP header
|
|
190
172
|
|
|
173
|
+
|
|
174
|
+
## Development quick‑start
|
|
175
|
+
```bash
|
|
176
|
+
# clone
|
|
177
|
+
git clone https://github.com/<org>/asteroid-odyssey-py.git
|
|
178
|
+
cd asteroid-odyssey-py
|
|
179
|
+
|
|
180
|
+
# create / activate a virtualenv (example using venv)
|
|
181
|
+
python -m venv .venv
|
|
182
|
+
source .venv/bin/activate
|
|
183
|
+
|
|
184
|
+
# install project in *editable* mode + dev tools
|
|
185
|
+
pip install -U pip
|
|
186
|
+
pip install -e .[dev] # or: pip install -e .
|
|
187
|
+
|
|
188
|
+
# run the generated SDK tests
|
|
189
|
+
pytest
|
|
190
|
+
```
|
|
191
|
+
|
|
191
192
|
## Regenerating the SDK
|
|
192
193
|
|
|
193
194
|
To update the SDK, regenerate the code by running
|
|
194
195
|
|
|
195
196
|
```bash
|
|
196
|
-
|
|
197
|
-
-i https://odyssey.asteroid.ai/api/v1/openapi.yaml \
|
|
198
|
-
-g python \
|
|
199
|
-
-o .
|
|
200
|
-
|
|
197
|
+
./regen-sdk.sh
|
|
201
198
|
```
|
|
202
199
|
|
|
200
|
+
If the OpenAPI spec changes:
|
|
201
|
+
```bash
|
|
202
|
+
./regen-sdk.sh # regenerate client & docs
|
|
203
|
+
pip install -e . # refresh editable install (safe to rerun)
|
|
204
|
+
pytest # all tests should still pass
|
|
205
|
+
```
|
|
206
|
+
|
|
203
207
|
After generation, ensure `pyproject.toml` is configured correctly and that files are modified correctly. Check for new files and if they are needed.
|
|
204
208
|
|
|
205
209
|
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
asteroid_odyssey/__init__.py,sha256=A05KbHfr1FWd2-j1LGJMXYmBVXpYMjr9qP0x_E5NbLk,461
|
|
2
|
-
asteroid_odyssey/client.py,sha256=
|
|
3
|
-
asteroid_odyssey/openapi_client/__init__.py,sha256=
|
|
4
|
-
asteroid_odyssey/openapi_client/api_client.py,sha256
|
|
2
|
+
asteroid_odyssey/client.py,sha256=_pTT4J6YaEfVHYFdZNkPf1rrtv3jbYCJoY_htOiH4g4,16194
|
|
3
|
+
asteroid_odyssey/openapi_client/__init__.py,sha256=dapzzGYDUa3oZUOoRGo5bhCoI4iuTt1W6pzTzfuZyy8,3340
|
|
4
|
+
asteroid_odyssey/openapi_client/api_client.py,sha256=-15SRPKjYZuoODh0zkUV0spuB-73fZ-GkbQ3e216yhs,27753
|
|
5
5
|
asteroid_odyssey/openapi_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
6
|
-
asteroid_odyssey/openapi_client/configuration.py,sha256=
|
|
6
|
+
asteroid_odyssey/openapi_client/configuration.py,sha256=PwQNLyPcrovYOCOhieY3GzEQGkEm6C_1o8KU7r_zj14,19062
|
|
7
7
|
asteroid_odyssey/openapi_client/exceptions.py,sha256=xauMukb96TkgN7Rx5c_d_XWOJb7ldCY5SuTmybyKTr8,6414
|
|
8
8
|
asteroid_odyssey/openapi_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
asteroid_odyssey/openapi_client/rest.py,sha256=
|
|
10
|
-
asteroid_odyssey/openapi_client/api/__init__.py,sha256=
|
|
11
|
-
asteroid_odyssey/openapi_client/api/api_api.py,sha256=
|
|
12
|
-
asteroid_odyssey/openapi_client/api/execution_api.py,sha256=
|
|
13
|
-
asteroid_odyssey/openapi_client/api/sdk_api.py,sha256=
|
|
14
|
-
asteroid_odyssey/openapi_client/models/__init__.py,sha256=
|
|
9
|
+
asteroid_odyssey/openapi_client/rest.py,sha256=XOZPH_19dd-_4zu2kNXJfsciyRxwOkOUVKTj89TDvvs,9428
|
|
10
|
+
asteroid_odyssey/openapi_client/api/__init__.py,sha256=6SCQSfLQ9JZRDoe84ReHjpLcccvck5YdAdeL9E1_fWw,249
|
|
11
|
+
asteroid_odyssey/openapi_client/api/api_api.py,sha256=dSrS485gpicMCjvaGogCN5ky8vKMvwhc4sR69fN0nDY,19221
|
|
12
|
+
asteroid_odyssey/openapi_client/api/execution_api.py,sha256=mydU_lB23ppRlP3OvJb8wtOiUoCrLj0bn7v4is-BEN0,12960
|
|
13
|
+
asteroid_odyssey/openapi_client/api/sdk_api.py,sha256=QWAhjXRoO0eoVHE9GKakA7VokOW_nd_QuIveYQNecgU,55728
|
|
14
|
+
asteroid_odyssey/openapi_client/models/__init__.py,sha256=5tQcej-IjG8T6S5WpItY01XMfY4JMzWE8dVQDg-5fWg,1382
|
|
15
15
|
asteroid_odyssey/openapi_client/models/browser_session_recording_response.py,sha256=OgYXsMiADk5IIDKkWJTy0RfnnBO3Zbaq9mEUyaxTaH0,2590
|
|
16
16
|
asteroid_odyssey/openapi_client/models/error_response.py,sha256=njnDeKZeMPiteuX4l3MsWTHkG4qEiv8sbIUTv0Z8yQY,2459
|
|
17
17
|
asteroid_odyssey/openapi_client/models/execution_response.py,sha256=c4PJNQDsWlQwumSonH1Sxqcb1q521FhNGgZugoinZNA,2513
|
|
18
18
|
asteroid_odyssey/openapi_client/models/execution_result.py,sha256=o6V8oHt9QR7vfRcCrnHwk8exwALUollWBfShze_lzBM,3354
|
|
19
|
-
asteroid_odyssey/openapi_client/models/execution_result_response.py,sha256=
|
|
20
|
-
asteroid_odyssey/openapi_client/models/execution_status_response.py,sha256=
|
|
19
|
+
asteroid_odyssey/openapi_client/models/execution_result_response.py,sha256=U1wdFYivdZLPsKuMrjJ0AVo0KE-M1z9hCZdWBcbR_2o,3605
|
|
20
|
+
asteroid_odyssey/openapi_client/models/execution_status_response.py,sha256=s-Nsld_P2f3ncD_ZFZI4RisjI-wf4qphPjUkO2dMxFE,3051
|
|
21
21
|
asteroid_odyssey/openapi_client/models/health_check200_response.py,sha256=x_6F6rhTvqpuMUFtD5ynLrUFY4vuVdkWfDRkTx2hVp0,2548
|
|
22
22
|
asteroid_odyssey/openapi_client/models/health_check500_response.py,sha256=b6pG-pqUKkQ5oqmWWyakdr7YYjnTYYeZjoVHkcU-TSY,2533
|
|
23
|
-
asteroid_odyssey/openapi_client/models/status.py,sha256=
|
|
23
|
+
asteroid_odyssey/openapi_client/models/status.py,sha256=tnt_4jdoMzcjo6J0vttf2QKLNK0FC9XcjZKbGC3sbz0,889
|
|
24
24
|
asteroid_odyssey/openapi_client/models/structured_agent_execution_request.py,sha256=VZyW85pVz9T27aiG4ZlGywnnxTOaJCAjHSDz8D2YxY8,2913
|
|
25
25
|
asteroid_odyssey/openapi_client/models/upload_execution_files200_response.py,sha256=u85oEP2bEuhszonE78VcrB_keT0UZpv16CTGvfse_v4,2735
|
|
26
|
-
asteroid_odyssey-1.0.
|
|
27
|
-
asteroid_odyssey-1.0.
|
|
28
|
-
asteroid_odyssey-1.0.
|
|
29
|
-
asteroid_odyssey-1.0.
|
|
26
|
+
asteroid_odyssey-1.0.3.dist-info/METADATA,sha256=fEjaafhufUJkTJybC8UTQ1zrQbJfF8VFfMh-qqwRLD8,7037
|
|
27
|
+
asteroid_odyssey-1.0.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
28
|
+
asteroid_odyssey-1.0.3.dist-info/top_level.txt,sha256=h4T6NKscnThJ4Nhzors2NKlJeZzepnM7XvDgsnfi5HA,17
|
|
29
|
+
asteroid_odyssey-1.0.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|