asteroid-odyssey 0.1.21__py3-none-any.whl → 1.0.0__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.
Files changed (96) hide show
  1. asteroid_odyssey/__init__.py +20 -34
  2. asteroid_odyssey/client.py +387 -337
  3. asteroid_odyssey/openapi_client/__init__.py +73 -0
  4. asteroid_odyssey/openapi_client/api/__init__.py +7 -0
  5. asteroid_odyssey/openapi_client/api/api_api.py +516 -0
  6. asteroid_odyssey/openapi_client/api/execution_api.py +335 -0
  7. asteroid_odyssey/openapi_client/api/sdk_api.py +1434 -0
  8. asteroid_odyssey/openapi_client/api_client.py +801 -0
  9. asteroid_odyssey/openapi_client/api_response.py +21 -0
  10. asteroid_odyssey/openapi_client/configuration.py +606 -0
  11. asteroid_odyssey/openapi_client/exceptions.py +216 -0
  12. asteroid_odyssey/openapi_client/models/__init__.py +27 -0
  13. asteroid_odyssey/openapi_client/models/browser_session_recording_response.py +87 -0
  14. asteroid_odyssey/openapi_client/models/error_response.py +87 -0
  15. asteroid_odyssey/openapi_client/models/execution_response.py +87 -0
  16. asteroid_odyssey/openapi_client/models/execution_result.py +101 -0
  17. asteroid_odyssey/openapi_client/models/execution_result_response.py +100 -0
  18. asteroid_odyssey/openapi_client/models/execution_status_response.py +95 -0
  19. asteroid_odyssey/openapi_client/models/health_check200_response.py +87 -0
  20. asteroid_odyssey/openapi_client/models/health_check500_response.py +87 -0
  21. asteroid_odyssey/openapi_client/models/status.py +43 -0
  22. asteroid_odyssey/openapi_client/models/structured_agent_execution_request.py +89 -0
  23. asteroid_odyssey/openapi_client/models/upload_execution_files200_response.py +89 -0
  24. asteroid_odyssey/openapi_client/rest.py +258 -0
  25. asteroid_odyssey-1.0.0.dist-info/METADATA +208 -0
  26. asteroid_odyssey-1.0.0.dist-info/RECORD +29 -0
  27. {asteroid_odyssey-0.1.21.dist-info → asteroid_odyssey-1.0.0.dist-info}/WHEEL +1 -1
  28. asteroid_odyssey/api/generated/asteroid_agents_api_client/__init__.py +0 -8
  29. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/__init__.py +0 -1
  30. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/agent/get_agents.py +0 -127
  31. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/__init__.py +0 -0
  32. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/get_open_api.py +0 -79
  33. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/api/health_check.py +0 -131
  34. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/credentials/__init__.py +0 -0
  35. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/credentials/get_credentials_public_key.py +0 -127
  36. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/__init__.py +0 -0
  37. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/delete_execution.py +0 -156
  38. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_browser_session.py +0 -154
  39. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution.py +0 -154
  40. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution_files.py +0 -159
  41. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_execution_progress.py +0 -159
  42. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/get_executions_for_workflow.py +0 -156
  43. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/execution/update_execution_status.py +0 -115
  44. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/notifications/__init__.py +0 -0
  45. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/notifications/set_slack_channel.py +0 -107
  46. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/optimiser/__init__.py +0 -0
  47. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/optimiser/queue_optimisation_job.py +0 -103
  48. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/__init__.py +0 -0
  49. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/add_workflow_credential.py +0 -111
  50. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/create_workflow.py +0 -174
  51. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/delete_workflow.py +0 -156
  52. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/delete_workflow_credentials.py +0 -96
  53. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/execute_workflow.py +0 -179
  54. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_agent_workflow_executions.py +0 -155
  55. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow.py +0 -154
  56. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_credentials.py +0 -154
  57. asteroid_odyssey/api/generated/asteroid_agents_api_client/api/workflow/get_workflow_versions.py +0 -159
  58. asteroid_odyssey/api/generated/asteroid_agents_api_client/client.py +0 -268
  59. asteroid_odyssey/api/generated/asteroid_agents_api_client/errors.py +0 -16
  60. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/__init__.py +0 -61
  61. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/agent.py +0 -90
  62. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/browser_session.py +0 -136
  63. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request.py +0 -126
  64. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request_fields.py +0 -48
  65. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/create_workflow_request_provider.py +0 -9
  66. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credential.py +0 -66
  67. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credentials_request.py +0 -72
  68. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/credentials_response.py +0 -80
  69. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_execution_response_200.py +0 -58
  70. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_execution_response_404.py +0 -58
  71. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_workflow_response_200.py +0 -58
  72. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/delete_workflow_response_404.py +0 -58
  73. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution.py +0 -147
  74. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_dynamic_data.py +0 -48
  75. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_result.py +0 -43
  76. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/execution_status.py +0 -89
  77. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/file.py +0 -127
  78. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/health_check_response_200.py +0 -58
  79. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/health_check_response_500.py +0 -58
  80. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/optimisation_request.py +0 -59
  81. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/progress_update.py +0 -77
  82. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/result_schema.py +0 -51
  83. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/slack_channel_request.py +0 -58
  84. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/status.py +0 -13
  85. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow.py +0 -152
  86. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_execution.py +0 -82
  87. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_execution_request.py +0 -48
  88. asteroid_odyssey/api/generated/asteroid_agents_api_client/models/workflow_fields.py +0 -48
  89. asteroid_odyssey/api/generated/asteroid_agents_api_client/py.typed +0 -1
  90. asteroid_odyssey/api/generated/asteroid_agents_api_client/types.py +0 -45
  91. asteroid_odyssey/exceptions.py +0 -15
  92. asteroid_odyssey-0.1.21.dist-info/METADATA +0 -31
  93. asteroid_odyssey-0.1.21.dist-info/RECORD +0 -72
  94. asteroid_odyssey-0.1.21.dist-info/entry_points.txt +0 -2
  95. /asteroid_odyssey/{api/generated/asteroid_agents_api_client/api/agent/__init__.py → openapi_client/py.typed} +0 -0
  96. {asteroid_odyssey-0.1.21.dist-info → asteroid_odyssey-1.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,216 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Asteroid Agents API
5
+
6
+ Version 1 of the Asteroid Agents API
7
+
8
+ The version of the OpenAPI document: v1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+ class OpenApiException(Exception):
18
+ """The base exception class for all OpenAPIExceptions"""
19
+
20
+
21
+ class ApiTypeError(OpenApiException, TypeError):
22
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
23
+ key_type=None) -> None:
24
+ """ Raises an exception for TypeErrors
25
+
26
+ Args:
27
+ msg (str): the exception message
28
+
29
+ Keyword Args:
30
+ path_to_item (list): a list of keys an indices to get to the
31
+ current_item
32
+ None if unset
33
+ valid_classes (tuple): the primitive classes that current item
34
+ should be an instance of
35
+ None if unset
36
+ key_type (bool): False if our value is a value in a dict
37
+ True if it is a key in a dict
38
+ False if our item is an item in a list
39
+ None if unset
40
+ """
41
+ self.path_to_item = path_to_item
42
+ self.valid_classes = valid_classes
43
+ self.key_type = key_type
44
+ full_msg = msg
45
+ if path_to_item:
46
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
47
+ super(ApiTypeError, self).__init__(full_msg)
48
+
49
+
50
+ class ApiValueError(OpenApiException, ValueError):
51
+ def __init__(self, msg, path_to_item=None) -> None:
52
+ """
53
+ Args:
54
+ msg (str): the exception message
55
+
56
+ Keyword Args:
57
+ path_to_item (list) the path to the exception in the
58
+ received_data dict. None if unset
59
+ """
60
+
61
+ self.path_to_item = path_to_item
62
+ full_msg = msg
63
+ if path_to_item:
64
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
65
+ super(ApiValueError, self).__init__(full_msg)
66
+
67
+
68
+ class ApiAttributeError(OpenApiException, AttributeError):
69
+ def __init__(self, msg, path_to_item=None) -> None:
70
+ """
71
+ Raised when an attribute reference or assignment fails.
72
+
73
+ Args:
74
+ msg (str): the exception message
75
+
76
+ Keyword Args:
77
+ path_to_item (None/list) the path to the exception in the
78
+ received_data dict
79
+ """
80
+ self.path_to_item = path_to_item
81
+ full_msg = msg
82
+ if path_to_item:
83
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
84
+ super(ApiAttributeError, self).__init__(full_msg)
85
+
86
+
87
+ class ApiKeyError(OpenApiException, KeyError):
88
+ def __init__(self, msg, path_to_item=None) -> None:
89
+ """
90
+ Args:
91
+ msg (str): the exception message
92
+
93
+ Keyword Args:
94
+ path_to_item (None/list) the path to the exception in the
95
+ received_data dict
96
+ """
97
+ self.path_to_item = path_to_item
98
+ full_msg = msg
99
+ if path_to_item:
100
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
101
+ super(ApiKeyError, self).__init__(full_msg)
102
+
103
+
104
+ class ApiException(OpenApiException):
105
+
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
121
+ if http_resp:
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
131
+ self.headers = http_resp.getheaders()
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ # Added new conditions for 409 and 422
154
+ if http_resp.status == 409:
155
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
156
+
157
+ if http_resp.status == 422:
158
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
159
+
160
+ if 500 <= http_resp.status <= 599:
161
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
162
+ raise ApiException(http_resp=http_resp, body=body, data=data)
163
+
164
+ def __str__(self):
165
+ """Custom error messages for exception"""
166
+ error_message = "({0})\n"\
167
+ "Reason: {1}\n".format(self.status, self.reason)
168
+ if self.headers:
169
+ error_message += "HTTP response headers: {0}\n".format(
170
+ self.headers)
171
+
172
+ if self.data or self.body:
173
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
174
+
175
+ return error_message
176
+
177
+
178
+ class BadRequestException(ApiException):
179
+ pass
180
+
181
+
182
+ class NotFoundException(ApiException):
183
+ pass
184
+
185
+
186
+ class UnauthorizedException(ApiException):
187
+ pass
188
+
189
+
190
+ class ForbiddenException(ApiException):
191
+ pass
192
+
193
+
194
+ class ServiceException(ApiException):
195
+ pass
196
+
197
+
198
+ class ConflictException(ApiException):
199
+ """Exception for HTTP 409 Conflict."""
200
+ pass
201
+
202
+
203
+ class UnprocessableEntityException(ApiException):
204
+ """Exception for HTTP 422 Unprocessable Entity."""
205
+ pass
206
+
207
+
208
+ def render_path(path_to_item):
209
+ """Returns a string representation of a path"""
210
+ result = ""
211
+ for pth in path_to_item:
212
+ if isinstance(pth, int):
213
+ result += "[{0}]".format(pth)
214
+ else:
215
+ result += "['{0}']".format(pth)
216
+ return result
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ Asteroid Agents API
6
+
7
+ Version 1 of the Asteroid Agents API
8
+
9
+ The version of the OpenAPI document: v1.0.0
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
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
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Asteroid Agents API
5
+
6
+ Version 1 of the Asteroid Agents API
7
+
8
+ The version of the OpenAPI document: v1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class BrowserSessionRecordingResponse(BaseModel):
26
+ """
27
+ BrowserSessionRecordingResponse
28
+ """ # noqa: E501
29
+ recording_url: StrictStr = Field(description="The URL of the browser session recording")
30
+ __properties: ClassVar[List[str]] = ["recording_url"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of BrowserSessionRecordingResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of BrowserSessionRecordingResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "recording_url": obj.get("recording_url")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Asteroid Agents API
5
+
6
+ Version 1 of the Asteroid Agents API
7
+
8
+ The version of the OpenAPI document: v1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ErrorResponse(BaseModel):
26
+ """
27
+ ErrorResponse
28
+ """ # noqa: E501
29
+ error: StrictStr = Field(description="Error message")
30
+ __properties: ClassVar[List[str]] = ["error"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of ErrorResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of ErrorResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "error": obj.get("error")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Asteroid Agents API
5
+
6
+ Version 1 of the Asteroid Agents API
7
+
8
+ The version of the OpenAPI document: v1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ExecutionResponse(BaseModel):
26
+ """
27
+ ExecutionResponse
28
+ """ # noqa: E501
29
+ execution_id: StrictStr = Field(description="The ID of the execution")
30
+ __properties: ClassVar[List[str]] = ["execution_id"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of ExecutionResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of ExecutionResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "execution_id": obj.get("execution_id")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Asteroid Agents API
5
+
6
+ Version 1 of the Asteroid Agents API
7
+
8
+ The version of the OpenAPI document: v1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ExecutionResult(BaseModel):
26
+ """
27
+ The result of an execution. Contains the outcome, reasoning, and result.
28
+ """ # noqa: E501
29
+ outcome: Optional[StrictStr] = Field(default=None, description="The outcome of the execution (success or failure)")
30
+ reasoning: Optional[StrictStr] = Field(default=None, description="The reasoning behind the execution outcome")
31
+ result: Optional[Dict[str, Any]] = Field(default=None, description="The structured result data from the execution. This will follow the format defined in the result_schema of the agent.")
32
+ __properties: ClassVar[List[str]] = ["outcome", "reasoning", "result"]
33
+
34
+ @field_validator('outcome')
35
+ def outcome_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value is None:
38
+ return value
39
+
40
+ if value not in set(['success', 'failure']):
41
+ raise ValueError("must be one of enum values ('success', 'failure')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of ExecutionResult from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ """
75
+ excluded_fields: Set[str] = set([
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of ExecutionResult from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "outcome": obj.get("outcome"),
96
+ "reasoning": obj.get("reasoning"),
97
+ "result": obj.get("result")
98
+ })
99
+ return _obj
100
+
101
+