agenta 0.48.9__py3-none-any.whl → 0.49.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.

Potentially problematic release.


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

Files changed (297) hide show
  1. agenta/__init__.py +3 -2
  2. agenta/client/Readme.md +258 -80
  3. agenta/client/__init__.py +205 -29
  4. agenta/client/backend/__init__.py +461 -0
  5. agenta/client/backend/access_control/__init__.py +2 -0
  6. agenta/client/backend/access_control/client.py +53 -73
  7. agenta/client/backend/access_control/raw_client.py +180 -0
  8. agenta/client/backend/admin/__init__.py +2 -0
  9. agenta/client/backend/admin/client.py +473 -268
  10. agenta/client/backend/admin/raw_client.py +1017 -0
  11. agenta/client/backend/api_keys/__init__.py +2 -0
  12. agenta/client/backend/api_keys/client.py +43 -276
  13. agenta/client/backend/api_keys/raw_client.py +364 -0
  14. agenta/client/backend/apps/__init__.py +2 -0
  15. agenta/client/backend/apps/client.py +132 -895
  16. agenta/client/backend/apps/raw_client.py +1516 -0
  17. agenta/client/backend/bases/__init__.py +2 -0
  18. agenta/client/backend/bases/client.py +33 -73
  19. agenta/client/backend/bases/raw_client.py +179 -0
  20. agenta/client/backend/billing/__init__.py +3 -0
  21. agenta/client/backend/billing/client.py +564 -0
  22. agenta/client/backend/billing/raw_client.py +805 -0
  23. agenta/client/backend/client.py +1268 -0
  24. agenta/client/backend/configs/__init__.py +2 -0
  25. agenta/client/backend/configs/client.py +49 -361
  26. agenta/client/backend/configs/raw_client.py +402 -0
  27. agenta/client/backend/containers/__init__.py +1 -3
  28. agenta/client/backend/containers/client.py +25 -548
  29. agenta/client/backend/containers/raw_client.py +112 -0
  30. agenta/client/backend/core/__init__.py +5 -0
  31. agenta/client/backend/core/api_error.py +12 -6
  32. agenta/client/backend/core/client_wrapper.py +4 -4
  33. agenta/client/backend/core/file.py +1 -3
  34. agenta/client/backend/core/force_multipart.py +16 -0
  35. agenta/client/backend/core/http_client.py +78 -34
  36. agenta/client/backend/core/http_response.py +55 -0
  37. agenta/client/backend/core/jsonable_encoder.py +0 -1
  38. agenta/client/backend/core/pydantic_utilities.py +88 -113
  39. agenta/client/backend/core/serialization.py +9 -3
  40. agenta/client/backend/environment.py +7 -0
  41. agenta/client/backend/environments/__init__.py +2 -0
  42. agenta/client/backend/environments/client.py +43 -79
  43. agenta/client/backend/environments/raw_client.py +193 -0
  44. agenta/client/backend/errors/__init__.py +2 -0
  45. agenta/client/backend/errors/unprocessable_entity_error.py +8 -2
  46. agenta/client/backend/evals/__init__.py +3 -0
  47. agenta/client/backend/evals/client.py +1042 -0
  48. agenta/client/backend/evals/raw_client.py +1549 -0
  49. agenta/client/backend/evaluations/__init__.py +2 -0
  50. agenta/client/backend/evaluations/client.py +106 -590
  51. agenta/client/backend/evaluations/raw_client.py +1344 -0
  52. agenta/client/backend/evaluators/__init__.py +2 -0
  53. agenta/client/backend/evaluators/client.py +99 -516
  54. agenta/client/backend/evaluators/raw_client.py +1182 -0
  55. agenta/client/backend/human_evaluations/__init__.py +2 -0
  56. agenta/client/backend/human_evaluations/client.py +120 -680
  57. agenta/client/backend/human_evaluations/raw_client.py +1577 -0
  58. agenta/client/backend/observability/__init__.py +14 -2
  59. agenta/client/backend/observability/client.py +185 -341
  60. agenta/client/backend/observability/raw_client.py +943 -0
  61. agenta/client/backend/observability/types/__init__.py +10 -2
  62. agenta/client/backend/observability/types/{format.py → fetch_trace_by_id_request_trace_id.py} +1 -1
  63. agenta/client/backend/observability/types/fetch_trace_by_id_response.py +15 -0
  64. agenta/client/backend/observability/types/query_analytics_response.py +2 -1
  65. agenta/client/backend/observability/types/query_traces_response.py +7 -3
  66. agenta/client/backend/organization/__init__.py +2 -0
  67. agenta/client/backend/organization/client.py +105 -361
  68. agenta/client/backend/organization/raw_client.py +774 -0
  69. agenta/client/backend/raw_client.py +1432 -0
  70. agenta/client/backend/scopes/__init__.py +2 -0
  71. agenta/client/backend/scopes/client.py +31 -45
  72. agenta/client/backend/scopes/raw_client.py +105 -0
  73. agenta/client/backend/testsets/__init__.py +14 -0
  74. agenta/client/backend/testsets/client.py +1098 -653
  75. agenta/client/backend/testsets/raw_client.py +2348 -0
  76. agenta/client/backend/testsets/types/__init__.py +17 -0
  77. agenta/client/backend/testsets/types/create_testset_from_file_request_file_type.py +7 -0
  78. agenta/client/backend/testsets/types/fetch_testset_to_file_request_file_type.py +7 -0
  79. agenta/client/backend/testsets/types/update_testset_from_file_request_file_type.py +7 -0
  80. agenta/client/backend/tracing/__init__.py +7 -0
  81. agenta/client/backend/tracing/client.py +782 -0
  82. agenta/client/backend/tracing/raw_client.py +1223 -0
  83. agenta/client/backend/tracing/types/__init__.py +8 -0
  84. agenta/client/backend/{types/variant_action_enum.py → tracing/types/fetch_trace_request_trace_id.py} +1 -1
  85. agenta/client/backend/tracing/types/remove_trace_request_trace_id.py +5 -0
  86. agenta/client/backend/types/__init__.py +153 -26
  87. agenta/client/backend/types/account_request.py +24 -0
  88. agenta/client/backend/types/account_response.py +5 -7
  89. agenta/client/backend/types/agenta_node_dto.py +13 -13
  90. agenta/client/backend/types/agenta_node_dto_nodes_value.py +1 -0
  91. agenta/client/backend/types/agenta_nodes_response.py +14 -8
  92. agenta/client/backend/types/agenta_root_dto.py +16 -8
  93. agenta/client/backend/types/agenta_roots_response.py +16 -8
  94. agenta/client/backend/types/agenta_tree_dto.py +16 -8
  95. agenta/client/backend/types/agenta_trees_response.py +16 -8
  96. agenta/client/backend/types/aggregated_result.py +5 -7
  97. agenta/client/backend/types/aggregated_result_evaluator_config.py +1 -0
  98. agenta/client/backend/types/analytics_response.py +4 -6
  99. agenta/client/backend/types/annotation.py +50 -0
  100. agenta/client/backend/types/annotation_create.py +39 -0
  101. agenta/client/backend/types/annotation_edit.py +31 -0
  102. agenta/client/backend/types/annotation_kind.py +5 -0
  103. agenta/client/backend/types/{uri.py → annotation_link.py} +6 -7
  104. agenta/client/backend/types/{provider_key_dto.py → annotation_link_response.py} +6 -7
  105. agenta/client/backend/types/annotation_query.py +40 -0
  106. agenta/client/backend/types/annotation_query_request.py +20 -0
  107. agenta/client/backend/types/annotation_reference.py +21 -0
  108. agenta/client/backend/types/annotation_references.py +22 -0
  109. agenta/client/backend/types/{docker_env_vars.py → annotation_response.py} +6 -7
  110. agenta/client/backend/types/annotation_source.py +5 -0
  111. agenta/client/backend/types/annotations_response.py +24 -0
  112. agenta/client/backend/types/app.py +3 -5
  113. agenta/client/backend/types/app_variant_response.py +3 -6
  114. agenta/client/backend/types/app_variant_revision.py +5 -6
  115. agenta/client/backend/types/artifact.py +44 -0
  116. agenta/client/backend/types/base_output.py +3 -5
  117. agenta/client/backend/types/body_fetch_workflow_revision.py +21 -0
  118. agenta/client/backend/types/body_import_testset.py +3 -5
  119. agenta/client/backend/types/bucket_dto.py +4 -6
  120. agenta/client/backend/types/collect_status_response.py +3 -5
  121. agenta/client/backend/types/config_db.py +3 -5
  122. agenta/client/backend/types/config_dto.py +5 -7
  123. agenta/client/backend/types/config_response_model.py +5 -7
  124. agenta/client/backend/types/correct_answer.py +3 -5
  125. agenta/client/backend/types/create_app_output.py +3 -5
  126. agenta/client/backend/types/custom_model_settings_dto.py +3 -5
  127. agenta/client/backend/types/custom_provider_dto.py +6 -9
  128. agenta/client/backend/types/custom_provider_kind.py +5 -5
  129. agenta/client/backend/types/custom_provider_settings_dto.py +3 -5
  130. agenta/client/backend/types/data.py +2 -1
  131. agenta/client/backend/types/delete_evaluation.py +3 -5
  132. agenta/client/backend/types/environment_output.py +3 -5
  133. agenta/client/backend/types/environment_output_extended.py +4 -6
  134. agenta/client/backend/types/environment_revision.py +5 -5
  135. agenta/client/backend/types/error.py +3 -5
  136. agenta/client/backend/types/evaluation.py +6 -8
  137. agenta/client/backend/types/evaluation_scenario.py +5 -7
  138. agenta/client/backend/types/evaluation_scenario_input.py +3 -5
  139. agenta/client/backend/types/evaluation_scenario_output.py +4 -6
  140. agenta/client/backend/types/evaluation_scenario_result.py +4 -6
  141. agenta/client/backend/types/evaluator.py +31 -12
  142. agenta/client/backend/types/evaluator_config.py +3 -5
  143. agenta/client/backend/types/evaluator_flags.py +21 -0
  144. agenta/client/backend/types/evaluator_mapping_output_interface.py +3 -5
  145. agenta/client/backend/types/evaluator_output_interface.py +3 -5
  146. agenta/client/backend/types/evaluator_query.py +32 -0
  147. agenta/client/backend/types/evaluator_query_request.py +30 -0
  148. agenta/client/backend/types/evaluator_request.py +20 -0
  149. agenta/client/backend/types/evaluator_response.py +21 -0
  150. agenta/client/backend/types/evaluators_response.py +21 -0
  151. agenta/client/backend/types/exception_dto.py +3 -5
  152. agenta/client/backend/types/{o_tel_spans_response.py → extended_o_tel_tracing_response.py} +5 -7
  153. agenta/client/backend/types/focus.py +5 -0
  154. agenta/client/backend/types/format.py +5 -0
  155. agenta/client/backend/types/full_json_input.py +34 -0
  156. agenta/client/backend/types/full_json_output.py +29 -0
  157. agenta/client/backend/types/get_config_response.py +3 -5
  158. agenta/client/backend/types/{header_dto.py → header.py} +4 -6
  159. agenta/client/backend/types/http_validation_error.py +4 -6
  160. agenta/client/backend/types/human_evaluation.py +3 -5
  161. agenta/client/backend/types/human_evaluation_scenario.py +4 -6
  162. agenta/client/backend/types/human_evaluation_scenario_input.py +3 -5
  163. agenta/client/backend/types/human_evaluation_scenario_output.py +3 -5
  164. agenta/client/backend/types/invite_request.py +4 -6
  165. agenta/client/backend/types/legacy_analytics_response.py +4 -6
  166. agenta/client/backend/types/legacy_data_point.py +3 -5
  167. agenta/client/backend/types/legacy_evaluator.py +26 -0
  168. agenta/client/backend/types/legacy_scope_request.py +4 -6
  169. agenta/client/backend/types/legacy_scopes_response.py +3 -5
  170. agenta/client/backend/types/legacy_subscription_request.py +19 -0
  171. agenta/client/backend/types/legacy_user_request.py +5 -7
  172. agenta/client/backend/types/legacy_user_response.py +3 -5
  173. agenta/client/backend/types/lifecycle_dto.py +3 -5
  174. agenta/client/backend/types/link_dto.py +4 -6
  175. agenta/client/backend/types/list_api_keys_response.py +3 -5
  176. agenta/client/backend/types/llm_run_rate_limit.py +3 -5
  177. agenta/client/backend/types/meta_request.py +30 -0
  178. agenta/client/backend/types/metrics_dto.py +3 -5
  179. agenta/client/backend/types/new_testset.py +3 -5
  180. agenta/client/backend/types/node_dto.py +4 -6
  181. agenta/client/backend/types/o_tel_context_dto.py +3 -5
  182. agenta/client/backend/types/o_tel_event.py +35 -0
  183. agenta/client/backend/types/o_tel_event_dto.py +3 -5
  184. agenta/client/backend/types/o_tel_extra_dto.py +4 -6
  185. agenta/client/backend/types/o_tel_flat_span.py +56 -0
  186. agenta/client/backend/types/o_tel_flat_span_input_end_time.py +6 -0
  187. agenta/client/backend/types/o_tel_flat_span_input_start_time.py +6 -0
  188. agenta/client/backend/types/o_tel_flat_span_output_end_time.py +6 -0
  189. agenta/client/backend/types/o_tel_flat_span_output_start_time.py +6 -0
  190. agenta/client/backend/types/o_tel_link.py +34 -0
  191. agenta/client/backend/types/o_tel_link_dto.py +4 -6
  192. agenta/client/backend/types/o_tel_links_response.py +22 -0
  193. agenta/client/backend/types/o_tel_span.py +58 -0
  194. agenta/client/backend/types/o_tel_span_dto.py +8 -10
  195. agenta/client/backend/types/o_tel_span_input_end_time.py +6 -0
  196. agenta/client/backend/types/o_tel_span_input_spans_value.py +7 -0
  197. agenta/client/backend/types/o_tel_span_input_start_time.py +6 -0
  198. agenta/client/backend/types/o_tel_span_output_end_time.py +6 -0
  199. agenta/client/backend/types/o_tel_span_output_spans_value.py +30 -0
  200. agenta/client/backend/types/o_tel_span_output_start_time.py +6 -0
  201. agenta/client/backend/types/o_tel_spans_tree.py +22 -0
  202. agenta/client/backend/types/o_tel_spans_tree_input_spans_value.py +7 -0
  203. agenta/client/backend/types/o_tel_spans_tree_output_spans_value.py +5 -0
  204. agenta/client/backend/types/o_tel_status_code.py +1 -1
  205. agenta/client/backend/types/o_tel_tracing_data_response.py +22 -0
  206. agenta/client/backend/types/o_tel_tracing_request.py +22 -0
  207. agenta/client/backend/types/o_tel_tracing_response.py +27 -0
  208. agenta/client/backend/types/organization.py +3 -5
  209. agenta/client/backend/types/organization_details.py +3 -5
  210. agenta/client/backend/types/organization_membership_request.py +5 -7
  211. agenta/client/backend/types/organization_output.py +3 -5
  212. agenta/client/backend/types/organization_request.py +3 -5
  213. agenta/client/backend/types/parent_dto.py +3 -5
  214. agenta/client/backend/types/permission.py +11 -0
  215. agenta/client/backend/types/plan.py +14 -0
  216. agenta/client/backend/types/project_membership_request.py +5 -7
  217. agenta/client/backend/types/project_request.py +4 -6
  218. agenta/client/backend/types/project_scope.py +5 -7
  219. agenta/client/backend/types/projects_response.py +3 -5
  220. agenta/client/backend/types/recursive_types.py +23 -0
  221. agenta/client/backend/types/reference.py +18 -5
  222. agenta/client/backend/types/reference_dto.py +4 -5
  223. agenta/client/backend/types/reference_request_model.py +4 -5
  224. agenta/client/backend/types/result.py +4 -6
  225. agenta/client/backend/types/root_dto.py +3 -5
  226. agenta/client/backend/types/scopes_response_model.py +4 -6
  227. agenta/client/backend/types/secret_dto.py +5 -7
  228. agenta/client/backend/types/secret_response_dto.py +11 -11
  229. agenta/client/backend/types/simple_evaluation_output.py +4 -6
  230. agenta/client/backend/types/span_dto.py +18 -14
  231. agenta/client/backend/types/span_dto_nodes_value.py +1 -1
  232. agenta/client/backend/types/standard_provider_dto.py +5 -7
  233. agenta/client/backend/types/standard_provider_settings_dto.py +3 -5
  234. agenta/client/backend/types/status_dto.py +4 -6
  235. agenta/client/backend/types/tags_request.py +30 -0
  236. agenta/client/backend/types/test_set_output_response.py +5 -7
  237. agenta/client/backend/types/test_set_simple_response.py +3 -5
  238. agenta/client/backend/types/testcase_response.py +33 -0
  239. agenta/client/backend/types/testset.py +46 -0
  240. agenta/client/backend/types/testset_request.py +20 -0
  241. agenta/client/backend/types/testset_response.py +21 -0
  242. agenta/client/backend/types/testsets_response.py +21 -0
  243. agenta/client/backend/types/time_dto.py +3 -5
  244. agenta/client/backend/types/timestamp.py +6 -0
  245. agenta/client/backend/types/tree_dto.py +4 -6
  246. agenta/client/backend/types/update_app_output.py +3 -5
  247. agenta/client/backend/types/user_request.py +3 -5
  248. agenta/client/backend/types/validation_error.py +4 -6
  249. agenta/client/backend/types/workflow_artifact.py +45 -0
  250. agenta/client/backend/types/workflow_data.py +20 -0
  251. agenta/client/backend/types/workflow_flags.py +21 -0
  252. agenta/client/backend/types/workflow_request.py +20 -0
  253. agenta/client/backend/types/workflow_response.py +21 -0
  254. agenta/client/backend/types/workflow_revision.py +57 -0
  255. agenta/client/backend/types/workflow_revision_request.py +20 -0
  256. agenta/client/backend/types/workflow_revision_response.py +21 -0
  257. agenta/client/backend/types/workflow_revisions_response.py +21 -0
  258. agenta/client/backend/types/workflow_variant.py +48 -0
  259. agenta/client/backend/types/workflow_variant_request.py +20 -0
  260. agenta/client/backend/types/workflow_variant_response.py +21 -0
  261. agenta/client/backend/types/workflow_variants_response.py +21 -0
  262. agenta/client/backend/types/workflows_response.py +21 -0
  263. agenta/client/backend/types/workspace.py +3 -5
  264. agenta/client/backend/types/workspace_member_response.py +4 -6
  265. agenta/client/backend/types/workspace_membership_request.py +5 -7
  266. agenta/client/backend/types/workspace_permission.py +5 -7
  267. agenta/client/backend/types/workspace_request.py +4 -6
  268. agenta/client/backend/types/workspace_response.py +4 -6
  269. agenta/client/backend/variants/__init__.py +2 -0
  270. agenta/client/backend/variants/client.py +306 -1651
  271. agenta/client/backend/variants/raw_client.py +2482 -0
  272. agenta/client/backend/variants/types/__init__.py +2 -0
  273. agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +1 -0
  274. agenta/client/backend/vault/__init__.py +2 -0
  275. agenta/client/backend/vault/client.py +69 -323
  276. agenta/client/backend/vault/raw_client.py +616 -0
  277. agenta/client/backend/workflows/__init__.py +3 -0
  278. agenta/client/backend/workflows/client.py +2398 -0
  279. agenta/client/backend/workflows/raw_client.py +3639 -0
  280. agenta/client/backend/workspace/__init__.py +2 -0
  281. agenta/client/backend/workspace/client.py +46 -147
  282. agenta/client/backend/workspace/raw_client.py +376 -0
  283. agenta/client/types.py +4 -0
  284. agenta/sdk/litellm/mocks/__init__.py +144 -0
  285. agenta/sdk/middleware/auth.py +26 -25
  286. agenta/sdk/types.py +28 -1
  287. {agenta-0.48.9.dist-info → agenta-0.49.0.dist-info}/METADATA +1 -1
  288. agenta-0.49.0.dist-info/RECORD +362 -0
  289. agenta/client/backend/containers/types/__init__.py +0 -5
  290. agenta/client/backend/containers/types/container_templates_response.py +0 -6
  291. agenta/client/backend/types/image.py +0 -25
  292. agenta/client/backend/types/provider_kind.py +0 -21
  293. agenta/client/backend/types/template.py +0 -23
  294. agenta/client/backend/types/template_image_info.py +0 -29
  295. agenta/client/backend/types/variant_action.py +0 -22
  296. agenta-0.48.9.dist-info/RECORD +0 -255
  297. {agenta-0.48.9.dist-info → agenta-0.49.0.dist-info}/WHEEL +0 -0
@@ -1,5 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ # isort: skip_file
4
+
3
5
  from .add_variant_from_base_and_config_response import (
4
6
  AddVariantFromBaseAndConfigResponse,
5
7
  )
@@ -1,6 +1,7 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
+
4
5
  from ...types.app_variant_response import AppVariantResponse
5
6
 
6
7
  AddVariantFromBaseAndConfigResponse = typing.Union[
@@ -1 +1,3 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
@@ -1,19 +1,13 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- from ..core.client_wrapper import SyncClientWrapper
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
5
6
  from ..core.request_options import RequestOptions
6
- from ..types.secret_response_dto import SecretResponseDto
7
- from ..core.pydantic_utilities import parse_obj_as
8
- from json.decoder import JSONDecodeError
9
- from ..core.api_error import ApiError
10
- from ..types.header_dto import HeaderDto
7
+ from ..types.header import Header
11
8
  from ..types.secret_dto import SecretDto
12
- from ..core.serialization import convert_and_respect_annotation_metadata
13
- from ..errors.unprocessable_entity_error import UnprocessableEntityError
14
- from ..types.http_validation_error import HttpValidationError
15
- from ..core.jsonable_encoder import jsonable_encoder
16
- from ..core.client_wrapper import AsyncClientWrapper
9
+ from ..types.secret_response_dto import SecretResponseDto
10
+ from .raw_client import AsyncRawVaultClient, RawVaultClient
17
11
 
18
12
  # this is used as the default value for optional parameters
19
13
  OMIT = typing.cast(typing.Any, ...)
@@ -21,7 +15,18 @@ OMIT = typing.cast(typing.Any, ...)
21
15
 
22
16
  class VaultClient:
23
17
  def __init__(self, *, client_wrapper: SyncClientWrapper):
24
- self._client_wrapper = client_wrapper
18
+ self._raw_client = RawVaultClient(client_wrapper=client_wrapper)
19
+
20
+ @property
21
+ def with_raw_response(self) -> RawVaultClient:
22
+ """
23
+ Retrieves a raw implementation of this client that returns raw responses.
24
+
25
+ Returns
26
+ -------
27
+ RawVaultClient
28
+ """
29
+ return self._raw_client
25
30
 
26
31
  def list_secrets(
27
32
  self, *, request_options: typing.Optional[RequestOptions] = None
@@ -43,40 +48,23 @@ class VaultClient:
43
48
 
44
49
  client = AgentaApi(
45
50
  api_key="YOUR_API_KEY",
46
- base_url="https://yourhost.com/path/to/api",
47
51
  )
48
52
  client.vault.list_secrets()
49
53
  """
50
- _response = self._client_wrapper.httpx_client.request(
51
- "vault/v1/secrets",
52
- method="GET",
53
- request_options=request_options,
54
- )
55
- try:
56
- if 200 <= _response.status_code < 300:
57
- return typing.cast(
58
- typing.List[SecretResponseDto],
59
- parse_obj_as(
60
- type_=typing.List[SecretResponseDto], # type: ignore
61
- object_=_response.json(),
62
- ),
63
- )
64
- _response_json = _response.json()
65
- except JSONDecodeError:
66
- raise ApiError(status_code=_response.status_code, body=_response.text)
67
- raise ApiError(status_code=_response.status_code, body=_response_json)
54
+ _response = self._raw_client.list_secrets(request_options=request_options)
55
+ return _response.data
68
56
 
69
57
  def create_secret(
70
58
  self,
71
59
  *,
72
- header: HeaderDto,
60
+ header: Header,
73
61
  secret: SecretDto,
74
62
  request_options: typing.Optional[RequestOptions] = None,
75
63
  ) -> SecretResponseDto:
76
64
  """
77
65
  Parameters
78
66
  ----------
79
- header : HeaderDto
67
+ header : Header
80
68
 
81
69
  secret : SecretDto
82
70
 
@@ -92,7 +80,7 @@ class VaultClient:
92
80
  --------
93
81
  from agenta import (
94
82
  AgentaApi,
95
- HeaderDto,
83
+ Header,
96
84
  SecretDto,
97
85
  StandardProviderDto,
98
86
  StandardProviderSettingsDto,
@@ -100,10 +88,9 @@ class VaultClient:
100
88
 
101
89
  client = AgentaApi(
102
90
  api_key="YOUR_API_KEY",
103
- base_url="https://yourhost.com/path/to/api",
104
91
  )
105
92
  client.vault.create_secret(
106
- header=HeaderDto(),
93
+ header=Header(),
107
94
  secret=SecretDto(
108
95
  kind="provider_key",
109
96
  data=StandardProviderDto(
@@ -115,46 +102,10 @@ class VaultClient:
115
102
  ),
116
103
  )
117
104
  """
118
- _response = self._client_wrapper.httpx_client.request(
119
- "vault/v1/secrets",
120
- method="POST",
121
- json={
122
- "header": convert_and_respect_annotation_metadata(
123
- object_=header, annotation=HeaderDto, direction="write"
124
- ),
125
- "secret": convert_and_respect_annotation_metadata(
126
- object_=secret, annotation=SecretDto, direction="write"
127
- ),
128
- },
129
- headers={
130
- "content-type": "application/json",
131
- },
132
- request_options=request_options,
133
- omit=OMIT,
105
+ _response = self._raw_client.create_secret(
106
+ header=header, secret=secret, request_options=request_options
134
107
  )
135
- try:
136
- if 200 <= _response.status_code < 300:
137
- return typing.cast(
138
- SecretResponseDto,
139
- parse_obj_as(
140
- type_=SecretResponseDto, # type: ignore
141
- object_=_response.json(),
142
- ),
143
- )
144
- if _response.status_code == 422:
145
- raise UnprocessableEntityError(
146
- typing.cast(
147
- HttpValidationError,
148
- parse_obj_as(
149
- type_=HttpValidationError, # type: ignore
150
- object_=_response.json(),
151
- ),
152
- )
153
- )
154
- _response_json = _response.json()
155
- except JSONDecodeError:
156
- raise ApiError(status_code=_response.status_code, body=_response.text)
157
- raise ApiError(status_code=_response.status_code, body=_response_json)
108
+ return _response.data
158
109
 
159
110
  def read_secret(
160
111
  self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -178,46 +129,21 @@ class VaultClient:
178
129
 
179
130
  client = AgentaApi(
180
131
  api_key="YOUR_API_KEY",
181
- base_url="https://yourhost.com/path/to/api",
182
132
  )
183
133
  client.vault.read_secret(
184
134
  secret_id="secret_id",
185
135
  )
186
136
  """
187
- _response = self._client_wrapper.httpx_client.request(
188
- f"vault/v1/secrets/{jsonable_encoder(secret_id)}",
189
- method="GET",
190
- request_options=request_options,
137
+ _response = self._raw_client.read_secret(
138
+ secret_id, request_options=request_options
191
139
  )
192
- try:
193
- if 200 <= _response.status_code < 300:
194
- return typing.cast(
195
- SecretResponseDto,
196
- parse_obj_as(
197
- type_=SecretResponseDto, # type: ignore
198
- object_=_response.json(),
199
- ),
200
- )
201
- if _response.status_code == 422:
202
- raise UnprocessableEntityError(
203
- typing.cast(
204
- HttpValidationError,
205
- parse_obj_as(
206
- type_=HttpValidationError, # type: ignore
207
- object_=_response.json(),
208
- ),
209
- )
210
- )
211
- _response_json = _response.json()
212
- except JSONDecodeError:
213
- raise ApiError(status_code=_response.status_code, body=_response.text)
214
- raise ApiError(status_code=_response.status_code, body=_response_json)
140
+ return _response.data
215
141
 
216
142
  def update_secret(
217
143
  self,
218
144
  secret_id: str,
219
145
  *,
220
- header: typing.Optional[HeaderDto] = OMIT,
146
+ header: typing.Optional[Header] = OMIT,
221
147
  secret: typing.Optional[SecretDto] = OMIT,
222
148
  request_options: typing.Optional[RequestOptions] = None,
223
149
  ) -> SecretResponseDto:
@@ -226,7 +152,7 @@ class VaultClient:
226
152
  ----------
227
153
  secret_id : str
228
154
 
229
- header : typing.Optional[HeaderDto]
155
+ header : typing.Optional[Header]
230
156
 
231
157
  secret : typing.Optional[SecretDto]
232
158
 
@@ -244,52 +170,15 @@ class VaultClient:
244
170
 
245
171
  client = AgentaApi(
246
172
  api_key="YOUR_API_KEY",
247
- base_url="https://yourhost.com/path/to/api",
248
173
  )
249
174
  client.vault.update_secret(
250
175
  secret_id="secret_id",
251
176
  )
252
177
  """
253
- _response = self._client_wrapper.httpx_client.request(
254
- f"vault/v1/secrets/{jsonable_encoder(secret_id)}",
255
- method="PUT",
256
- json={
257
- "header": convert_and_respect_annotation_metadata(
258
- object_=header, annotation=HeaderDto, direction="write"
259
- ),
260
- "secret": convert_and_respect_annotation_metadata(
261
- object_=secret, annotation=SecretDto, direction="write"
262
- ),
263
- },
264
- headers={
265
- "content-type": "application/json",
266
- },
267
- request_options=request_options,
268
- omit=OMIT,
178
+ _response = self._raw_client.update_secret(
179
+ secret_id, header=header, secret=secret, request_options=request_options
269
180
  )
270
- try:
271
- if 200 <= _response.status_code < 300:
272
- return typing.cast(
273
- SecretResponseDto,
274
- parse_obj_as(
275
- type_=SecretResponseDto, # type: ignore
276
- object_=_response.json(),
277
- ),
278
- )
279
- if _response.status_code == 422:
280
- raise UnprocessableEntityError(
281
- typing.cast(
282
- HttpValidationError,
283
- parse_obj_as(
284
- type_=HttpValidationError, # type: ignore
285
- object_=_response.json(),
286
- ),
287
- )
288
- )
289
- _response_json = _response.json()
290
- except JSONDecodeError:
291
- raise ApiError(status_code=_response.status_code, body=_response.text)
292
- raise ApiError(status_code=_response.status_code, body=_response_json)
181
+ return _response.data
293
182
 
294
183
  def delete_secret(
295
184
  self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -312,39 +201,31 @@ class VaultClient:
312
201
 
313
202
  client = AgentaApi(
314
203
  api_key="YOUR_API_KEY",
315
- base_url="https://yourhost.com/path/to/api",
316
204
  )
317
205
  client.vault.delete_secret(
318
206
  secret_id="secret_id",
319
207
  )
320
208
  """
321
- _response = self._client_wrapper.httpx_client.request(
322
- f"vault/v1/secrets/{jsonable_encoder(secret_id)}",
323
- method="DELETE",
324
- request_options=request_options,
209
+ _response = self._raw_client.delete_secret(
210
+ secret_id, request_options=request_options
325
211
  )
326
- try:
327
- if 200 <= _response.status_code < 300:
328
- return
329
- if _response.status_code == 422:
330
- raise UnprocessableEntityError(
331
- typing.cast(
332
- HttpValidationError,
333
- parse_obj_as(
334
- type_=HttpValidationError, # type: ignore
335
- object_=_response.json(),
336
- ),
337
- )
338
- )
339
- _response_json = _response.json()
340
- except JSONDecodeError:
341
- raise ApiError(status_code=_response.status_code, body=_response.text)
342
- raise ApiError(status_code=_response.status_code, body=_response_json)
212
+ return _response.data
343
213
 
344
214
 
345
215
  class AsyncVaultClient:
346
216
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
347
- self._client_wrapper = client_wrapper
217
+ self._raw_client = AsyncRawVaultClient(client_wrapper=client_wrapper)
218
+
219
+ @property
220
+ def with_raw_response(self) -> AsyncRawVaultClient:
221
+ """
222
+ Retrieves a raw implementation of this client that returns raw responses.
223
+
224
+ Returns
225
+ -------
226
+ AsyncRawVaultClient
227
+ """
228
+ return self._raw_client
348
229
 
349
230
  async def list_secrets(
350
231
  self, *, request_options: typing.Optional[RequestOptions] = None
@@ -368,7 +249,6 @@ class AsyncVaultClient:
368
249
 
369
250
  client = AsyncAgentaApi(
370
251
  api_key="YOUR_API_KEY",
371
- base_url="https://yourhost.com/path/to/api",
372
252
  )
373
253
 
374
254
 
@@ -378,36 +258,20 @@ class AsyncVaultClient:
378
258
 
379
259
  asyncio.run(main())
380
260
  """
381
- _response = await self._client_wrapper.httpx_client.request(
382
- "vault/v1/secrets",
383
- method="GET",
384
- request_options=request_options,
385
- )
386
- try:
387
- if 200 <= _response.status_code < 300:
388
- return typing.cast(
389
- typing.List[SecretResponseDto],
390
- parse_obj_as(
391
- type_=typing.List[SecretResponseDto], # type: ignore
392
- object_=_response.json(),
393
- ),
394
- )
395
- _response_json = _response.json()
396
- except JSONDecodeError:
397
- raise ApiError(status_code=_response.status_code, body=_response.text)
398
- raise ApiError(status_code=_response.status_code, body=_response_json)
261
+ _response = await self._raw_client.list_secrets(request_options=request_options)
262
+ return _response.data
399
263
 
400
264
  async def create_secret(
401
265
  self,
402
266
  *,
403
- header: HeaderDto,
267
+ header: Header,
404
268
  secret: SecretDto,
405
269
  request_options: typing.Optional[RequestOptions] = None,
406
270
  ) -> SecretResponseDto:
407
271
  """
408
272
  Parameters
409
273
  ----------
410
- header : HeaderDto
274
+ header : Header
411
275
 
412
276
  secret : SecretDto
413
277
 
@@ -425,7 +289,7 @@ class AsyncVaultClient:
425
289
 
426
290
  from agenta import (
427
291
  AsyncAgentaApi,
428
- HeaderDto,
292
+ Header,
429
293
  SecretDto,
430
294
  StandardProviderDto,
431
295
  StandardProviderSettingsDto,
@@ -433,13 +297,12 @@ class AsyncVaultClient:
433
297
 
434
298
  client = AsyncAgentaApi(
435
299
  api_key="YOUR_API_KEY",
436
- base_url="https://yourhost.com/path/to/api",
437
300
  )
438
301
 
439
302
 
440
303
  async def main() -> None:
441
304
  await client.vault.create_secret(
442
- header=HeaderDto(),
305
+ header=Header(),
443
306
  secret=SecretDto(
444
307
  kind="provider_key",
445
308
  data=StandardProviderDto(
@@ -454,46 +317,10 @@ class AsyncVaultClient:
454
317
 
455
318
  asyncio.run(main())
456
319
  """
457
- _response = await self._client_wrapper.httpx_client.request(
458
- "vault/v1/secrets",
459
- method="POST",
460
- json={
461
- "header": convert_and_respect_annotation_metadata(
462
- object_=header, annotation=HeaderDto, direction="write"
463
- ),
464
- "secret": convert_and_respect_annotation_metadata(
465
- object_=secret, annotation=SecretDto, direction="write"
466
- ),
467
- },
468
- headers={
469
- "content-type": "application/json",
470
- },
471
- request_options=request_options,
472
- omit=OMIT,
320
+ _response = await self._raw_client.create_secret(
321
+ header=header, secret=secret, request_options=request_options
473
322
  )
474
- try:
475
- if 200 <= _response.status_code < 300:
476
- return typing.cast(
477
- SecretResponseDto,
478
- parse_obj_as(
479
- type_=SecretResponseDto, # type: ignore
480
- object_=_response.json(),
481
- ),
482
- )
483
- if _response.status_code == 422:
484
- raise UnprocessableEntityError(
485
- typing.cast(
486
- HttpValidationError,
487
- parse_obj_as(
488
- type_=HttpValidationError, # type: ignore
489
- object_=_response.json(),
490
- ),
491
- )
492
- )
493
- _response_json = _response.json()
494
- except JSONDecodeError:
495
- raise ApiError(status_code=_response.status_code, body=_response.text)
496
- raise ApiError(status_code=_response.status_code, body=_response_json)
323
+ return _response.data
497
324
 
498
325
  async def read_secret(
499
326
  self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -519,7 +346,6 @@ class AsyncVaultClient:
519
346
 
520
347
  client = AsyncAgentaApi(
521
348
  api_key="YOUR_API_KEY",
522
- base_url="https://yourhost.com/path/to/api",
523
349
  )
524
350
 
525
351
 
@@ -531,40 +357,16 @@ class AsyncVaultClient:
531
357
 
532
358
  asyncio.run(main())
533
359
  """
534
- _response = await self._client_wrapper.httpx_client.request(
535
- f"vault/v1/secrets/{jsonable_encoder(secret_id)}",
536
- method="GET",
537
- request_options=request_options,
360
+ _response = await self._raw_client.read_secret(
361
+ secret_id, request_options=request_options
538
362
  )
539
- try:
540
- if 200 <= _response.status_code < 300:
541
- return typing.cast(
542
- SecretResponseDto,
543
- parse_obj_as(
544
- type_=SecretResponseDto, # type: ignore
545
- object_=_response.json(),
546
- ),
547
- )
548
- if _response.status_code == 422:
549
- raise UnprocessableEntityError(
550
- typing.cast(
551
- HttpValidationError,
552
- parse_obj_as(
553
- type_=HttpValidationError, # type: ignore
554
- object_=_response.json(),
555
- ),
556
- )
557
- )
558
- _response_json = _response.json()
559
- except JSONDecodeError:
560
- raise ApiError(status_code=_response.status_code, body=_response.text)
561
- raise ApiError(status_code=_response.status_code, body=_response_json)
363
+ return _response.data
562
364
 
563
365
  async def update_secret(
564
366
  self,
565
367
  secret_id: str,
566
368
  *,
567
- header: typing.Optional[HeaderDto] = OMIT,
369
+ header: typing.Optional[Header] = OMIT,
568
370
  secret: typing.Optional[SecretDto] = OMIT,
569
371
  request_options: typing.Optional[RequestOptions] = None,
570
372
  ) -> SecretResponseDto:
@@ -573,7 +375,7 @@ class AsyncVaultClient:
573
375
  ----------
574
376
  secret_id : str
575
377
 
576
- header : typing.Optional[HeaderDto]
378
+ header : typing.Optional[Header]
577
379
 
578
380
  secret : typing.Optional[SecretDto]
579
381
 
@@ -593,7 +395,6 @@ class AsyncVaultClient:
593
395
 
594
396
  client = AsyncAgentaApi(
595
397
  api_key="YOUR_API_KEY",
596
- base_url="https://yourhost.com/path/to/api",
597
398
  )
598
399
 
599
400
 
@@ -605,46 +406,10 @@ class AsyncVaultClient:
605
406
 
606
407
  asyncio.run(main())
607
408
  """
608
- _response = await self._client_wrapper.httpx_client.request(
609
- f"vault/v1/secrets/{jsonable_encoder(secret_id)}",
610
- method="PUT",
611
- json={
612
- "header": convert_and_respect_annotation_metadata(
613
- object_=header, annotation=HeaderDto, direction="write"
614
- ),
615
- "secret": convert_and_respect_annotation_metadata(
616
- object_=secret, annotation=SecretDto, direction="write"
617
- ),
618
- },
619
- headers={
620
- "content-type": "application/json",
621
- },
622
- request_options=request_options,
623
- omit=OMIT,
409
+ _response = await self._raw_client.update_secret(
410
+ secret_id, header=header, secret=secret, request_options=request_options
624
411
  )
625
- try:
626
- if 200 <= _response.status_code < 300:
627
- return typing.cast(
628
- SecretResponseDto,
629
- parse_obj_as(
630
- type_=SecretResponseDto, # type: ignore
631
- object_=_response.json(),
632
- ),
633
- )
634
- if _response.status_code == 422:
635
- raise UnprocessableEntityError(
636
- typing.cast(
637
- HttpValidationError,
638
- parse_obj_as(
639
- type_=HttpValidationError, # type: ignore
640
- object_=_response.json(),
641
- ),
642
- )
643
- )
644
- _response_json = _response.json()
645
- except JSONDecodeError:
646
- raise ApiError(status_code=_response.status_code, body=_response.text)
647
- raise ApiError(status_code=_response.status_code, body=_response_json)
412
+ return _response.data
648
413
 
649
414
  async def delete_secret(
650
415
  self, secret_id: str, *, request_options: typing.Optional[RequestOptions] = None
@@ -669,7 +434,6 @@ class AsyncVaultClient:
669
434
 
670
435
  client = AsyncAgentaApi(
671
436
  api_key="YOUR_API_KEY",
672
- base_url="https://yourhost.com/path/to/api",
673
437
  )
674
438
 
675
439
 
@@ -681,25 +445,7 @@ class AsyncVaultClient:
681
445
 
682
446
  asyncio.run(main())
683
447
  """
684
- _response = await self._client_wrapper.httpx_client.request(
685
- f"vault/v1/secrets/{jsonable_encoder(secret_id)}",
686
- method="DELETE",
687
- request_options=request_options,
448
+ _response = await self._raw_client.delete_secret(
449
+ secret_id, request_options=request_options
688
450
  )
689
- try:
690
- if 200 <= _response.status_code < 300:
691
- return
692
- if _response.status_code == 422:
693
- raise UnprocessableEntityError(
694
- typing.cast(
695
- HttpValidationError,
696
- parse_obj_as(
697
- type_=HttpValidationError, # type: ignore
698
- object_=_response.json(),
699
- ),
700
- )
701
- )
702
- _response_json = _response.json()
703
- except JSONDecodeError:
704
- raise ApiError(status_code=_response.status_code, body=_response.text)
705
- raise ApiError(status_code=_response.status_code, body=_response_json)
451
+ return _response.data