asteroid-odyssey 1.0.2__tar.gz → 1.0.3__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.2 → asteroid_odyssey-1.0.3}/PKG-INFO +1 -1
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/pyproject.toml +1 -1
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/client.py +29 -11
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/PKG-INFO +1 -1
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/README.md +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/setup.cfg +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/__init__.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/__init__.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api/__init__.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api/api_api.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api/execution_api.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api/sdk_api.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api_client.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/configuration.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/exceptions.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/__init__.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/browser_session_recording_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/error_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/execution_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/execution_result.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/execution_result_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/execution_status_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/health_check200_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/health_check500_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/status.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/structured_agent_execution_request.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/models/upload_execution_files200_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/py.typed +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/rest.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/SOURCES.txt +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/dependency_links.txt +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/requires.txt +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/top_level.txt +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_api_api.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_browser_session_recording_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_error_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_execution_api.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_execution_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_execution_result.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_execution_result_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_execution_status_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_health_check200_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_health_check500_response.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_sdk_api.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_status.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_structured_agent_execution_request.py +0 -0
- {asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_upload_execution_files200_response.py +0 -0
|
@@ -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, execution_data: Dict[str, Any]) -> 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
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api/api_api.py
RENAMED
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api/sdk_api.py
RENAMED
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/api_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/py.typed
RENAMED
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey/openapi_client/rest.py
RENAMED
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/requires.txt
RENAMED
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/src/asteroid_odyssey.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_browser_session_recording_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_structured_agent_execution_request.py
RENAMED
|
File without changes
|
{asteroid_odyssey-1.0.2 → asteroid_odyssey-1.0.3}/test/test_upload_execution_files200_response.py
RENAMED
|
File without changes
|