agenta 0.12.7__py3-none-any.whl → 0.13.0a0__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.

Potentially problematic release.


This version of agenta might be problematic. Click here for more details.

Files changed (123) hide show
  1. agenta/__init__.py +3 -2
  2. agenta/cli/helper.py +1 -1
  3. agenta/cli/main.py +1 -1
  4. agenta/cli/variant_commands.py +7 -5
  5. agenta/client/api.py +1 -1
  6. agenta/client/backend/__init__.py +78 -18
  7. agenta/client/backend/client.py +961 -5575
  8. agenta/client/backend/core/api_error.py +1 -3
  9. agenta/client/backend/core/datetime_utils.py +1 -3
  10. agenta/client/backend/core/jsonable_encoder.py +3 -9
  11. agenta/client/backend/resources/__init__.py +20 -0
  12. agenta/client/backend/resources/apps/__init__.py +2 -0
  13. agenta/client/backend/resources/apps/client.py +915 -0
  14. agenta/client/backend/resources/bases/__init__.py +2 -0
  15. agenta/client/backend/resources/bases/client.py +121 -0
  16. agenta/client/backend/resources/configs/__init__.py +2 -0
  17. agenta/client/backend/resources/configs/client.py +333 -0
  18. agenta/client/backend/resources/containers/__init__.py +5 -0
  19. agenta/client/backend/resources/containers/client.py +351 -0
  20. agenta/client/backend/resources/containers/types/__init__.py +5 -0
  21. agenta/client/backend/{types → resources/containers/types}/container_templates_response.py +1 -1
  22. agenta/client/backend/resources/environments/__init__.py +2 -0
  23. agenta/client/backend/resources/environments/client.py +119 -0
  24. agenta/client/backend/resources/evaluations/__init__.py +2 -0
  25. agenta/client/backend/resources/evaluations/client.py +948 -0
  26. agenta/client/backend/resources/evaluators/__init__.py +2 -0
  27. agenta/client/backend/resources/evaluators/client.py +554 -0
  28. agenta/client/backend/resources/observability/__init__.py +2 -0
  29. agenta/client/backend/resources/observability/client.py +1114 -0
  30. agenta/client/backend/resources/testsets/__init__.py +2 -0
  31. agenta/client/backend/resources/testsets/client.py +649 -0
  32. agenta/client/backend/resources/variants/__init__.py +5 -0
  33. agenta/client/backend/resources/variants/client.py +730 -0
  34. agenta/client/backend/resources/variants/types/__init__.py +5 -0
  35. agenta/client/backend/resources/variants/types/add_variant_from_base_and_config_response.py +7 -0
  36. agenta/client/backend/types/__init__.py +54 -22
  37. agenta/client/backend/types/aggregated_result.py +4 -12
  38. agenta/client/backend/types/aggregated_result_evaluator_config.py +7 -0
  39. agenta/client/backend/types/app.py +2 -10
  40. agenta/client/backend/types/{app_variant_output.py → app_variant_response.py} +6 -12
  41. agenta/client/backend/types/app_variant_revision.py +2 -10
  42. agenta/client/backend/types/base_output.py +2 -10
  43. agenta/client/backend/types/body_import_testset.py +2 -10
  44. agenta/client/backend/types/config_db.py +2 -10
  45. agenta/client/backend/types/create_app_output.py +2 -10
  46. agenta/client/backend/types/{trace.py → create_span.py} +21 -20
  47. agenta/client/backend/types/{delete_evaluation.py → create_trace_response.py} +5 -12
  48. agenta/client/backend/types/docker_env_vars.py +2 -10
  49. agenta/client/backend/types/environment_output.py +5 -11
  50. agenta/client/backend/types/environment_output_extended.py +37 -0
  51. agenta/client/backend/types/environment_revision.py +33 -0
  52. agenta/client/backend/types/error.py +29 -0
  53. agenta/client/backend/types/evaluation.py +8 -13
  54. agenta/client/backend/types/evaluation_scenario.py +2 -10
  55. agenta/client/backend/types/evaluation_scenario_input.py +2 -10
  56. agenta/client/backend/types/evaluation_scenario_output.py +6 -12
  57. agenta/client/backend/types/evaluation_scenario_result.py +2 -10
  58. agenta/client/backend/types/evaluation_scenario_score_update.py +28 -0
  59. agenta/client/backend/types/evaluation_status_enum.py +4 -0
  60. agenta/client/backend/types/evaluation_type.py +1 -3
  61. agenta/client/backend/types/evaluation_webhook.py +2 -10
  62. agenta/client/backend/types/evaluator.py +3 -10
  63. agenta/client/backend/types/evaluator_config.py +2 -10
  64. agenta/client/backend/types/feedback.py +2 -10
  65. agenta/client/backend/types/{get_config_reponse.py → get_config_response.py} +4 -12
  66. agenta/client/backend/types/http_validation_error.py +2 -10
  67. agenta/client/backend/types/human_evaluation.py +2 -10
  68. agenta/client/backend/types/human_evaluation_scenario.py +4 -12
  69. agenta/client/backend/types/human_evaluation_scenario_input.py +2 -10
  70. agenta/client/backend/types/human_evaluation_scenario_output.py +2 -10
  71. agenta/client/backend/types/human_evaluation_scenario_update.py +37 -0
  72. agenta/client/backend/types/human_evaluation_update.py +29 -0
  73. agenta/client/backend/types/image.py +3 -10
  74. agenta/client/backend/types/invite_request.py +3 -10
  75. agenta/client/backend/types/{list_api_keys_output.py → list_api_keys_response.py} +3 -11
  76. agenta/client/backend/types/llm_run_rate_limit.py +2 -10
  77. agenta/client/backend/types/llm_tokens.py +30 -0
  78. agenta/client/backend/types/new_human_evaluation.py +34 -0
  79. agenta/client/backend/types/new_testset.py +2 -10
  80. agenta/client/backend/types/organization.py +3 -10
  81. agenta/client/backend/types/organization_output.py +2 -10
  82. agenta/client/backend/types/permission.py +141 -0
  83. agenta/client/backend/types/result.py +4 -10
  84. agenta/client/backend/types/{human_evaluation_scenario_score.py → score.py} +1 -1
  85. agenta/client/backend/types/simple_evaluation_output.py +2 -10
  86. agenta/client/backend/types/span.py +20 -26
  87. agenta/client/backend/types/span_detail.py +44 -0
  88. agenta/client/backend/types/span_kind.py +49 -0
  89. agenta/client/backend/types/span_status_code.py +29 -0
  90. agenta/client/backend/types/span_variant.py +30 -0
  91. agenta/client/backend/types/template.py +2 -10
  92. agenta/client/backend/types/template_image_info.py +2 -10
  93. agenta/client/backend/types/test_set_output_response.py +2 -10
  94. agenta/client/backend/types/test_set_simple_response.py +2 -10
  95. agenta/client/backend/types/trace_detail.py +44 -0
  96. agenta/client/backend/types/uri.py +2 -10
  97. agenta/client/backend/types/validation_error.py +2 -10
  98. agenta/client/backend/types/variant_action.py +2 -10
  99. agenta/client/backend/types/variant_action_enum.py +1 -3
  100. agenta/client/backend/types/with_pagination.py +32 -0
  101. agenta/client/backend/types/workspace_member_response.py +30 -0
  102. agenta/client/backend/types/workspace_permission.py +32 -0
  103. agenta/client/backend/types/workspace_response.py +36 -0
  104. agenta/client/backend/types/workspace_role.py +41 -0
  105. agenta/client/backend/types/workspace_role_response.py +30 -0
  106. agenta/docker/docker_utils.py +1 -5
  107. agenta/sdk/__init__.py +3 -2
  108. agenta/sdk/agenta_decorator.py +68 -26
  109. agenta/sdk/agenta_init.py +50 -20
  110. agenta/sdk/tracing/context_manager.py +13 -0
  111. agenta/sdk/tracing/decorators.py +41 -0
  112. agenta/sdk/tracing/llm_tracing.py +203 -0
  113. agenta/sdk/tracing/logger.py +19 -0
  114. agenta/sdk/tracing/tasks_manager.py +130 -0
  115. agenta/sdk/types.py +0 -38
  116. {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/METADATA +2 -1
  117. agenta-0.13.0a0.dist-info/RECORD +161 -0
  118. agenta/client/backend/types/add_variant_from_base_and_config_response.py +0 -7
  119. agenta/client/backend/types/app_variant_output_extended.py +0 -50
  120. agenta/client/backend/types/human_evaluation_scenario_update_score.py +0 -5
  121. agenta-0.12.7.dist-info/RECORD +0 -114
  122. {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/WHEEL +0 -0
  123. {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,121 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ import urllib.parse
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ...core.api_error import ApiError
8
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ...core.remove_none_from_dict import remove_none_from_dict
10
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
11
+ from ...types.base_output import BaseOutput
12
+ from ...types.http_validation_error import HttpValidationError
13
+
14
+ try:
15
+ import pydantic.v1 as pydantic # type: ignore
16
+ except ImportError:
17
+ import pydantic # type: ignore
18
+
19
+
20
+ class BasesClient:
21
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
22
+ self._client_wrapper = client_wrapper
23
+
24
+ def list_bases(
25
+ self, *, app_id: typing.Optional[str] = None, base_name: typing.Optional[str] = None
26
+ ) -> typing.List[BaseOutput]:
27
+ """
28
+ Retrieve a list of bases filtered by app_id and base_name.
29
+
30
+ Args:
31
+ request (Request): The incoming request.
32
+ app_id (Optional[str], optional): The ID of the app to filter by. Defaults to None.
33
+ base_name (Optional[str], optional): The name of the base to filter by. Defaults to None.
34
+
35
+ Returns:
36
+ List[BaseOutput]: A list of BaseOutput objects representing the filtered bases.
37
+
38
+ Raises:
39
+ HTTPException: If there was an error retrieving the bases.
40
+
41
+ Parameters:
42
+ - app_id: typing.Optional[str].
43
+
44
+ - base_name: typing.Optional[str].
45
+ ---
46
+ from agenta.client import AgentaApi
47
+
48
+ client = AgentaApi(
49
+ api_key="YOUR_API_KEY",
50
+ base_url="https://yourhost.com/path/to/api",
51
+ )
52
+ client.bases.list_bases()
53
+ """
54
+ _response = self._client_wrapper.httpx_client.request(
55
+ "GET",
56
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "bases"),
57
+ params=remove_none_from_dict({"app_id": app_id, "base_name": base_name}),
58
+ headers=self._client_wrapper.get_headers(),
59
+ timeout=60,
60
+ )
61
+ if 200 <= _response.status_code < 300:
62
+ return pydantic.parse_obj_as(typing.List[BaseOutput], _response.json()) # type: ignore
63
+ if _response.status_code == 422:
64
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
65
+ try:
66
+ _response_json = _response.json()
67
+ except JSONDecodeError:
68
+ raise ApiError(status_code=_response.status_code, body=_response.text)
69
+ raise ApiError(status_code=_response.status_code, body=_response_json)
70
+
71
+
72
+ class AsyncBasesClient:
73
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
74
+ self._client_wrapper = client_wrapper
75
+
76
+ async def list_bases(
77
+ self, *, app_id: typing.Optional[str] = None, base_name: typing.Optional[str] = None
78
+ ) -> typing.List[BaseOutput]:
79
+ """
80
+ Retrieve a list of bases filtered by app_id and base_name.
81
+
82
+ Args:
83
+ request (Request): The incoming request.
84
+ app_id (Optional[str], optional): The ID of the app to filter by. Defaults to None.
85
+ base_name (Optional[str], optional): The name of the base to filter by. Defaults to None.
86
+
87
+ Returns:
88
+ List[BaseOutput]: A list of BaseOutput objects representing the filtered bases.
89
+
90
+ Raises:
91
+ HTTPException: If there was an error retrieving the bases.
92
+
93
+ Parameters:
94
+ - app_id: typing.Optional[str].
95
+
96
+ - base_name: typing.Optional[str].
97
+ ---
98
+ from agenta.client import AsyncAgentaApi
99
+
100
+ client = AsyncAgentaApi(
101
+ api_key="YOUR_API_KEY",
102
+ base_url="https://yourhost.com/path/to/api",
103
+ )
104
+ await client.bases.list_bases()
105
+ """
106
+ _response = await self._client_wrapper.httpx_client.request(
107
+ "GET",
108
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "bases"),
109
+ params=remove_none_from_dict({"app_id": app_id, "base_name": base_name}),
110
+ headers=self._client_wrapper.get_headers(),
111
+ timeout=60,
112
+ )
113
+ if 200 <= _response.status_code < 300:
114
+ return pydantic.parse_obj_as(typing.List[BaseOutput], _response.json()) # type: ignore
115
+ if _response.status_code == 422:
116
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
117
+ try:
118
+ _response_json = _response.json()
119
+ except JSONDecodeError:
120
+ raise ApiError(status_code=_response.status_code, body=_response.text)
121
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
@@ -0,0 +1,333 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ import urllib.parse
5
+ from json.decoder import JSONDecodeError
6
+
7
+ from ...core.api_error import ApiError
8
+ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
9
+ from ...core.jsonable_encoder import jsonable_encoder
10
+ from ...core.remove_none_from_dict import remove_none_from_dict
11
+ from ...errors.unprocessable_entity_error import UnprocessableEntityError
12
+ from ...types.get_config_response import GetConfigResponse
13
+ from ...types.http_validation_error import HttpValidationError
14
+
15
+ try:
16
+ import pydantic.v1 as pydantic # type: ignore
17
+ except ImportError:
18
+ import pydantic # type: ignore
19
+
20
+ # this is used as the default value for optional parameters
21
+ OMIT = typing.cast(typing.Any, ...)
22
+
23
+
24
+ class ConfigsClient:
25
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
26
+ self._client_wrapper = client_wrapper
27
+
28
+ def get_config(
29
+ self, *, base_id: str, config_name: typing.Optional[str] = None, environment_name: typing.Optional[str] = None
30
+ ) -> GetConfigResponse:
31
+ """
32
+ Parameters:
33
+ - base_id: str.
34
+
35
+ - config_name: typing.Optional[str].
36
+
37
+ - environment_name: typing.Optional[str].
38
+ ---
39
+ from agenta.client import AgentaApi
40
+
41
+ client = AgentaApi(
42
+ api_key="YOUR_API_KEY",
43
+ base_url="https://yourhost.com/path/to/api",
44
+ )
45
+ client.configs.get_config(
46
+ base_id="base_id",
47
+ )
48
+ """
49
+ _response = self._client_wrapper.httpx_client.request(
50
+ "GET",
51
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
52
+ params=remove_none_from_dict(
53
+ {"base_id": base_id, "config_name": config_name, "environment_name": environment_name}
54
+ ),
55
+ headers=self._client_wrapper.get_headers(),
56
+ timeout=60,
57
+ )
58
+ if 200 <= _response.status_code < 300:
59
+ return pydantic.parse_obj_as(GetConfigResponse, _response.json()) # type: ignore
60
+ if _response.status_code == 422:
61
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
62
+ try:
63
+ _response_json = _response.json()
64
+ except JSONDecodeError:
65
+ raise ApiError(status_code=_response.status_code, body=_response.text)
66
+ raise ApiError(status_code=_response.status_code, body=_response_json)
67
+
68
+ def save_config(
69
+ self, *, base_id: str, config_name: str, parameters: typing.Dict[str, typing.Any], overwrite: bool
70
+ ) -> typing.Any:
71
+ """
72
+ Parameters:
73
+ - base_id: str.
74
+
75
+ - config_name: str.
76
+
77
+ - parameters: typing.Dict[str, typing.Any].
78
+
79
+ - overwrite: bool.
80
+ ---
81
+ from agenta.client import AgentaApi
82
+
83
+ client = AgentaApi(
84
+ api_key="YOUR_API_KEY",
85
+ base_url="https://yourhost.com/path/to/api",
86
+ )
87
+ client.configs.save_config(
88
+ base_id="base_id",
89
+ config_name="config_name",
90
+ parameters={},
91
+ overwrite=True,
92
+ )
93
+ """
94
+ _response = self._client_wrapper.httpx_client.request(
95
+ "POST",
96
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
97
+ json=jsonable_encoder(
98
+ {"base_id": base_id, "config_name": config_name, "parameters": parameters, "overwrite": overwrite}
99
+ ),
100
+ headers=self._client_wrapper.get_headers(),
101
+ timeout=60,
102
+ )
103
+ if 200 <= _response.status_code < 300:
104
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
105
+ if _response.status_code == 422:
106
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
107
+ try:
108
+ _response_json = _response.json()
109
+ except JSONDecodeError:
110
+ raise ApiError(status_code=_response.status_code, body=_response.text)
111
+ raise ApiError(status_code=_response.status_code, body=_response_json)
112
+
113
+ def get_config_deployment_revision(self, deployment_revision_id: str) -> typing.Any:
114
+ """
115
+ Parameters:
116
+ - deployment_revision_id: str.
117
+ ---
118
+ from agenta.client import AgentaApi
119
+
120
+ client = AgentaApi(
121
+ api_key="YOUR_API_KEY",
122
+ base_url="https://yourhost.com/path/to/api",
123
+ )
124
+ client.configs.get_config_deployment_revision(
125
+ deployment_revision_id="deployment_revision_id",
126
+ )
127
+ """
128
+ _response = self._client_wrapper.httpx_client.request(
129
+ "GET",
130
+ urllib.parse.urljoin(
131
+ f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}"
132
+ ),
133
+ headers=self._client_wrapper.get_headers(),
134
+ timeout=60,
135
+ )
136
+ if 200 <= _response.status_code < 300:
137
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
138
+ if _response.status_code == 422:
139
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
140
+ try:
141
+ _response_json = _response.json()
142
+ except JSONDecodeError:
143
+ raise ApiError(status_code=_response.status_code, body=_response.text)
144
+ raise ApiError(status_code=_response.status_code, body=_response_json)
145
+
146
+ def revert_deployment_revision(self, deployment_revision_id: str) -> typing.Any:
147
+ """
148
+ Parameters:
149
+ - deployment_revision_id: str.
150
+ ---
151
+ from agenta.client import AgentaApi
152
+
153
+ client = AgentaApi(
154
+ api_key="YOUR_API_KEY",
155
+ base_url="https://yourhost.com/path/to/api",
156
+ )
157
+ client.configs.revert_deployment_revision(
158
+ deployment_revision_id="deployment_revision_id",
159
+ )
160
+ """
161
+ _response = self._client_wrapper.httpx_client.request(
162
+ "POST",
163
+ urllib.parse.urljoin(
164
+ f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}/revert"
165
+ ),
166
+ headers=self._client_wrapper.get_headers(),
167
+ timeout=60,
168
+ )
169
+ if 200 <= _response.status_code < 300:
170
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
171
+ if _response.status_code == 422:
172
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
173
+ try:
174
+ _response_json = _response.json()
175
+ except JSONDecodeError:
176
+ raise ApiError(status_code=_response.status_code, body=_response.text)
177
+ raise ApiError(status_code=_response.status_code, body=_response_json)
178
+
179
+
180
+ class AsyncConfigsClient:
181
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
182
+ self._client_wrapper = client_wrapper
183
+
184
+ async def get_config(
185
+ self, *, base_id: str, config_name: typing.Optional[str] = None, environment_name: typing.Optional[str] = None
186
+ ) -> GetConfigResponse:
187
+ """
188
+ Parameters:
189
+ - base_id: str.
190
+
191
+ - config_name: typing.Optional[str].
192
+
193
+ - environment_name: typing.Optional[str].
194
+ ---
195
+ from agenta.client import AsyncAgentaApi
196
+
197
+ client = AsyncAgentaApi(
198
+ api_key="YOUR_API_KEY",
199
+ base_url="https://yourhost.com/path/to/api",
200
+ )
201
+ await client.configs.get_config(
202
+ base_id="base_id",
203
+ )
204
+ """
205
+ _response = await self._client_wrapper.httpx_client.request(
206
+ "GET",
207
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
208
+ params=remove_none_from_dict(
209
+ {"base_id": base_id, "config_name": config_name, "environment_name": environment_name}
210
+ ),
211
+ headers=self._client_wrapper.get_headers(),
212
+ timeout=60,
213
+ )
214
+ if 200 <= _response.status_code < 300:
215
+ return pydantic.parse_obj_as(GetConfigResponse, _response.json()) # type: ignore
216
+ if _response.status_code == 422:
217
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
218
+ try:
219
+ _response_json = _response.json()
220
+ except JSONDecodeError:
221
+ raise ApiError(status_code=_response.status_code, body=_response.text)
222
+ raise ApiError(status_code=_response.status_code, body=_response_json)
223
+
224
+ async def save_config(
225
+ self, *, base_id: str, config_name: str, parameters: typing.Dict[str, typing.Any], overwrite: bool
226
+ ) -> typing.Any:
227
+ """
228
+ Parameters:
229
+ - base_id: str.
230
+
231
+ - config_name: str.
232
+
233
+ - parameters: typing.Dict[str, typing.Any].
234
+
235
+ - overwrite: bool.
236
+ ---
237
+ from agenta.client import AsyncAgentaApi
238
+
239
+ client = AsyncAgentaApi(
240
+ api_key="YOUR_API_KEY",
241
+ base_url="https://yourhost.com/path/to/api",
242
+ )
243
+ await client.configs.save_config(
244
+ base_id="base_id",
245
+ config_name="config_name",
246
+ parameters={},
247
+ overwrite=True,
248
+ )
249
+ """
250
+ _response = await self._client_wrapper.httpx_client.request(
251
+ "POST",
252
+ urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "configs"),
253
+ json=jsonable_encoder(
254
+ {"base_id": base_id, "config_name": config_name, "parameters": parameters, "overwrite": overwrite}
255
+ ),
256
+ headers=self._client_wrapper.get_headers(),
257
+ timeout=60,
258
+ )
259
+ if 200 <= _response.status_code < 300:
260
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
261
+ if _response.status_code == 422:
262
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
263
+ try:
264
+ _response_json = _response.json()
265
+ except JSONDecodeError:
266
+ raise ApiError(status_code=_response.status_code, body=_response.text)
267
+ raise ApiError(status_code=_response.status_code, body=_response_json)
268
+
269
+ async def get_config_deployment_revision(self, deployment_revision_id: str) -> typing.Any:
270
+ """
271
+ Parameters:
272
+ - deployment_revision_id: str.
273
+ ---
274
+ from agenta.client import AsyncAgentaApi
275
+
276
+ client = AsyncAgentaApi(
277
+ api_key="YOUR_API_KEY",
278
+ base_url="https://yourhost.com/path/to/api",
279
+ )
280
+ await client.configs.get_config_deployment_revision(
281
+ deployment_revision_id="deployment_revision_id",
282
+ )
283
+ """
284
+ _response = await self._client_wrapper.httpx_client.request(
285
+ "GET",
286
+ urllib.parse.urljoin(
287
+ f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}"
288
+ ),
289
+ headers=self._client_wrapper.get_headers(),
290
+ timeout=60,
291
+ )
292
+ if 200 <= _response.status_code < 300:
293
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
294
+ if _response.status_code == 422:
295
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
296
+ try:
297
+ _response_json = _response.json()
298
+ except JSONDecodeError:
299
+ raise ApiError(status_code=_response.status_code, body=_response.text)
300
+ raise ApiError(status_code=_response.status_code, body=_response_json)
301
+
302
+ async def revert_deployment_revision(self, deployment_revision_id: str) -> typing.Any:
303
+ """
304
+ Parameters:
305
+ - deployment_revision_id: str.
306
+ ---
307
+ from agenta.client import AsyncAgentaApi
308
+
309
+ client = AsyncAgentaApi(
310
+ api_key="YOUR_API_KEY",
311
+ base_url="https://yourhost.com/path/to/api",
312
+ )
313
+ await client.configs.revert_deployment_revision(
314
+ deployment_revision_id="deployment_revision_id",
315
+ )
316
+ """
317
+ _response = await self._client_wrapper.httpx_client.request(
318
+ "POST",
319
+ urllib.parse.urljoin(
320
+ f"{self._client_wrapper.get_base_url()}/", f"configs/deployment/{deployment_revision_id}/revert"
321
+ ),
322
+ headers=self._client_wrapper.get_headers(),
323
+ timeout=60,
324
+ )
325
+ if 200 <= _response.status_code < 300:
326
+ return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
327
+ if _response.status_code == 422:
328
+ raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
329
+ try:
330
+ _response_json = _response.json()
331
+ except JSONDecodeError:
332
+ raise ApiError(status_code=_response.status_code, body=_response.text)
333
+ raise ApiError(status_code=_response.status_code, body=_response_json)
@@ -0,0 +1,5 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from .types import ContainerTemplatesResponse
4
+
5
+ __all__ = ["ContainerTemplatesResponse"]