agenta 0.57.0__py3-none-any.whl → 0.65.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 (267) hide show
  1. agenta/__init__.py +12 -3
  2. agenta/client/__init__.py +4 -4
  3. agenta/client/backend/__init__.py +4 -4
  4. agenta/client/backend/api_keys/client.py +2 -2
  5. agenta/client/backend/billing/client.py +2 -2
  6. agenta/client/backend/billing/raw_client.py +2 -2
  7. agenta/client/backend/client.py +56 -48
  8. agenta/client/backend/core/client_wrapper.py +2 -2
  9. agenta/client/backend/core/file.py +3 -1
  10. agenta/client/backend/core/http_client.py +3 -3
  11. agenta/client/backend/core/pydantic_utilities.py +13 -3
  12. agenta/client/backend/human_evaluations/client.py +2 -2
  13. agenta/client/backend/human_evaluations/raw_client.py +2 -2
  14. agenta/client/backend/organization/client.py +46 -34
  15. agenta/client/backend/organization/raw_client.py +32 -26
  16. agenta/client/backend/raw_client.py +26 -26
  17. agenta/client/backend/testsets/client.py +18 -18
  18. agenta/client/backend/testsets/raw_client.py +30 -30
  19. agenta/client/backend/types/__init__.py +4 -4
  20. agenta/client/backend/types/account_request.py +3 -1
  21. agenta/client/backend/types/account_response.py +3 -1
  22. agenta/client/backend/types/agenta_node_dto.py +3 -1
  23. agenta/client/backend/types/agenta_nodes_response.py +3 -1
  24. agenta/client/backend/types/agenta_root_dto.py +3 -1
  25. agenta/client/backend/types/agenta_roots_response.py +3 -1
  26. agenta/client/backend/types/agenta_tree_dto.py +3 -1
  27. agenta/client/backend/types/agenta_trees_response.py +3 -1
  28. agenta/client/backend/types/aggregated_result.py +3 -1
  29. agenta/client/backend/types/analytics_response.py +3 -1
  30. agenta/client/backend/types/annotation.py +6 -4
  31. agenta/client/backend/types/annotation_create.py +3 -1
  32. agenta/client/backend/types/annotation_edit.py +3 -1
  33. agenta/client/backend/types/annotation_link.py +3 -1
  34. agenta/client/backend/types/annotation_link_response.py +3 -1
  35. agenta/client/backend/types/annotation_query.py +3 -1
  36. agenta/client/backend/types/annotation_query_request.py +3 -1
  37. agenta/client/backend/types/annotation_reference.py +3 -1
  38. agenta/client/backend/types/annotation_references.py +3 -1
  39. agenta/client/backend/types/annotation_response.py +3 -1
  40. agenta/client/backend/types/annotations_response.py +3 -1
  41. agenta/client/backend/types/app.py +3 -1
  42. agenta/client/backend/types/app_variant_response.py +3 -1
  43. agenta/client/backend/types/app_variant_revision.py +3 -1
  44. agenta/client/backend/types/artifact.py +6 -4
  45. agenta/client/backend/types/base_output.py +3 -1
  46. agenta/client/backend/types/body_fetch_workflow_revision.py +3 -1
  47. agenta/client/backend/types/body_import_testset.py +3 -1
  48. agenta/client/backend/types/bucket_dto.py +3 -1
  49. agenta/client/backend/types/collect_status_response.py +3 -1
  50. agenta/client/backend/types/config_db.py +3 -1
  51. agenta/client/backend/types/config_dto.py +3 -1
  52. agenta/client/backend/types/config_response_model.py +3 -1
  53. agenta/client/backend/types/correct_answer.py +3 -1
  54. agenta/client/backend/types/create_app_output.py +3 -1
  55. agenta/client/backend/types/custom_model_settings_dto.py +3 -1
  56. agenta/client/backend/types/custom_provider_dto.py +3 -1
  57. agenta/client/backend/types/custom_provider_kind.py +1 -1
  58. agenta/client/backend/types/custom_provider_settings_dto.py +3 -1
  59. agenta/client/backend/types/delete_evaluation.py +3 -1
  60. agenta/client/backend/types/environment_output.py +3 -1
  61. agenta/client/backend/types/environment_output_extended.py +3 -1
  62. agenta/client/backend/types/environment_revision.py +3 -1
  63. agenta/client/backend/types/error.py +3 -1
  64. agenta/client/backend/types/evaluation.py +3 -1
  65. agenta/client/backend/types/evaluation_scenario.py +3 -1
  66. agenta/client/backend/types/evaluation_scenario_input.py +3 -1
  67. agenta/client/backend/types/evaluation_scenario_output.py +3 -1
  68. agenta/client/backend/types/evaluation_scenario_result.py +3 -1
  69. agenta/client/backend/types/evaluator.py +6 -4
  70. agenta/client/backend/types/evaluator_config.py +6 -4
  71. agenta/client/backend/types/evaluator_flags.py +3 -1
  72. agenta/client/backend/types/evaluator_mapping_output_interface.py +3 -1
  73. agenta/client/backend/types/evaluator_output_interface.py +3 -1
  74. agenta/client/backend/types/evaluator_query.py +3 -1
  75. agenta/client/backend/types/evaluator_query_request.py +3 -1
  76. agenta/client/backend/types/evaluator_request.py +3 -1
  77. agenta/client/backend/types/evaluator_response.py +3 -1
  78. agenta/client/backend/types/evaluators_response.py +3 -1
  79. agenta/client/backend/types/exception_dto.py +3 -1
  80. agenta/client/backend/types/extended_o_tel_tracing_response.py +3 -1
  81. agenta/client/backend/types/get_config_response.py +3 -1
  82. agenta/client/backend/types/header.py +3 -1
  83. agenta/client/backend/types/http_validation_error.py +3 -1
  84. agenta/client/backend/types/human_evaluation.py +3 -1
  85. agenta/client/backend/types/human_evaluation_scenario.py +3 -1
  86. agenta/client/backend/types/human_evaluation_scenario_input.py +3 -1
  87. agenta/client/backend/types/human_evaluation_scenario_output.py +3 -1
  88. agenta/client/backend/types/invite_request.py +3 -1
  89. agenta/client/backend/types/legacy_analytics_response.py +3 -1
  90. agenta/client/backend/types/legacy_data_point.py +3 -1
  91. agenta/client/backend/types/legacy_evaluator.py +3 -1
  92. agenta/client/backend/types/legacy_scope_request.py +3 -1
  93. agenta/client/backend/types/legacy_scopes_response.py +3 -1
  94. agenta/client/backend/types/legacy_subscription_request.py +3 -1
  95. agenta/client/backend/types/legacy_user_request.py +3 -1
  96. agenta/client/backend/types/legacy_user_response.py +3 -1
  97. agenta/client/backend/types/lifecycle_dto.py +3 -1
  98. agenta/client/backend/types/link_dto.py +3 -1
  99. agenta/client/backend/types/list_api_keys_response.py +3 -1
  100. agenta/client/backend/types/llm_run_rate_limit.py +3 -1
  101. agenta/client/backend/types/meta_request.py +3 -1
  102. agenta/client/backend/types/metrics_dto.py +3 -1
  103. agenta/client/backend/types/new_testset.py +3 -1
  104. agenta/client/backend/types/node_dto.py +3 -1
  105. agenta/client/backend/types/o_tel_context_dto.py +3 -1
  106. agenta/client/backend/types/o_tel_event.py +6 -4
  107. agenta/client/backend/types/o_tel_event_dto.py +3 -1
  108. agenta/client/backend/types/o_tel_extra_dto.py +3 -1
  109. agenta/client/backend/types/o_tel_flat_span.py +6 -4
  110. agenta/client/backend/types/o_tel_link.py +6 -4
  111. agenta/client/backend/types/o_tel_link_dto.py +3 -1
  112. agenta/client/backend/types/o_tel_links_response.py +3 -1
  113. agenta/client/backend/types/o_tel_span.py +1 -1
  114. agenta/client/backend/types/o_tel_span_dto.py +3 -1
  115. agenta/client/backend/types/o_tel_spans_tree.py +3 -1
  116. agenta/client/backend/types/o_tel_tracing_data_response.py +3 -1
  117. agenta/client/backend/types/o_tel_tracing_request.py +3 -1
  118. agenta/client/backend/types/o_tel_tracing_response.py +3 -1
  119. agenta/client/backend/types/organization.py +3 -1
  120. agenta/client/backend/types/organization_details.py +3 -1
  121. agenta/client/backend/types/organization_membership_request.py +3 -1
  122. agenta/client/backend/types/organization_output.py +3 -1
  123. agenta/client/backend/types/organization_request.py +3 -1
  124. agenta/client/backend/types/parent_dto.py +3 -1
  125. agenta/client/backend/types/project_membership_request.py +3 -1
  126. agenta/client/backend/types/project_request.py +3 -1
  127. agenta/client/backend/types/project_scope.py +3 -1
  128. agenta/client/backend/types/projects_response.py +4 -1
  129. agenta/client/backend/types/reference.py +6 -4
  130. agenta/client/backend/types/reference_dto.py +3 -1
  131. agenta/client/backend/types/reference_request_model.py +3 -1
  132. agenta/client/backend/types/result.py +3 -1
  133. agenta/client/backend/types/root_dto.py +3 -1
  134. agenta/client/backend/types/scopes_response_model.py +3 -1
  135. agenta/client/backend/types/secret_dto.py +3 -1
  136. agenta/client/backend/types/secret_response_dto.py +3 -1
  137. agenta/client/backend/types/simple_evaluation_output.py +3 -1
  138. agenta/client/backend/types/span_dto.py +6 -4
  139. agenta/client/backend/types/standard_provider_dto.py +3 -1
  140. agenta/client/backend/types/standard_provider_settings_dto.py +3 -1
  141. agenta/client/backend/types/status_dto.py +3 -1
  142. agenta/client/backend/types/tags_request.py +3 -1
  143. agenta/client/backend/types/testcase_response.py +6 -4
  144. agenta/client/backend/types/testset.py +6 -4
  145. agenta/client/backend/types/{test_set_output_response.py → testset_output_response.py} +4 -2
  146. agenta/client/backend/types/testset_request.py +3 -1
  147. agenta/client/backend/types/testset_response.py +3 -1
  148. agenta/client/backend/types/{test_set_simple_response.py → testset_simple_response.py} +4 -2
  149. agenta/client/backend/types/testsets_response.py +3 -1
  150. agenta/client/backend/types/time_dto.py +3 -1
  151. agenta/client/backend/types/tree_dto.py +3 -1
  152. agenta/client/backend/types/update_app_output.py +3 -1
  153. agenta/client/backend/types/user_request.py +3 -1
  154. agenta/client/backend/types/validation_error.py +3 -1
  155. agenta/client/backend/types/workflow_artifact.py +6 -4
  156. agenta/client/backend/types/workflow_data.py +3 -1
  157. agenta/client/backend/types/workflow_flags.py +3 -1
  158. agenta/client/backend/types/workflow_request.py +3 -1
  159. agenta/client/backend/types/workflow_response.py +3 -1
  160. agenta/client/backend/types/workflow_revision.py +6 -4
  161. agenta/client/backend/types/workflow_revision_request.py +3 -1
  162. agenta/client/backend/types/workflow_revision_response.py +3 -1
  163. agenta/client/backend/types/workflow_revisions_response.py +3 -1
  164. agenta/client/backend/types/workflow_variant.py +6 -4
  165. agenta/client/backend/types/workflow_variant_request.py +3 -1
  166. agenta/client/backend/types/workflow_variant_response.py +3 -1
  167. agenta/client/backend/types/workflow_variants_response.py +3 -1
  168. agenta/client/backend/types/workflows_response.py +3 -1
  169. agenta/client/backend/types/workspace.py +3 -1
  170. agenta/client/backend/types/workspace_member_response.py +3 -1
  171. agenta/client/backend/types/workspace_membership_request.py +3 -1
  172. agenta/client/backend/types/workspace_permission.py +3 -1
  173. agenta/client/backend/types/workspace_request.py +3 -1
  174. agenta/client/backend/types/workspace_response.py +3 -1
  175. agenta/client/backend/workspace/client.py +2 -2
  176. agenta/client/client.py +102 -88
  177. agenta/sdk/__init__.py +52 -3
  178. agenta/sdk/agenta_init.py +43 -16
  179. agenta/sdk/assets.py +22 -15
  180. agenta/sdk/context/serving.py +20 -8
  181. agenta/sdk/context/tracing.py +40 -22
  182. agenta/sdk/contexts/__init__.py +0 -0
  183. agenta/sdk/contexts/routing.py +38 -0
  184. agenta/sdk/contexts/running.py +57 -0
  185. agenta/sdk/contexts/tracing.py +86 -0
  186. agenta/sdk/decorators/__init__.py +1 -0
  187. agenta/sdk/decorators/routing.py +284 -0
  188. agenta/sdk/decorators/running.py +692 -98
  189. agenta/sdk/decorators/serving.py +20 -21
  190. agenta/sdk/decorators/tracing.py +176 -131
  191. agenta/sdk/engines/__init__.py +0 -0
  192. agenta/sdk/engines/running/__init__.py +0 -0
  193. agenta/sdk/engines/running/utils.py +17 -0
  194. agenta/sdk/engines/tracing/__init__.py +1 -0
  195. agenta/sdk/engines/tracing/attributes.py +185 -0
  196. agenta/sdk/engines/tracing/conventions.py +49 -0
  197. agenta/sdk/engines/tracing/exporters.py +130 -0
  198. agenta/sdk/engines/tracing/inline.py +1154 -0
  199. agenta/sdk/engines/tracing/processors.py +190 -0
  200. agenta/sdk/engines/tracing/propagation.py +102 -0
  201. agenta/sdk/engines/tracing/spans.py +136 -0
  202. agenta/sdk/engines/tracing/tracing.py +324 -0
  203. agenta/sdk/evaluations/__init__.py +2 -0
  204. agenta/sdk/evaluations/metrics.py +37 -0
  205. agenta/sdk/evaluations/preview/__init__.py +0 -0
  206. agenta/sdk/evaluations/preview/evaluate.py +765 -0
  207. agenta/sdk/evaluations/preview/utils.py +861 -0
  208. agenta/sdk/evaluations/results.py +66 -0
  209. agenta/sdk/evaluations/runs.py +152 -0
  210. agenta/sdk/evaluations/scenarios.py +48 -0
  211. agenta/sdk/litellm/litellm.py +12 -0
  212. agenta/sdk/litellm/mockllm.py +6 -8
  213. agenta/sdk/litellm/mocks/__init__.py +5 -5
  214. agenta/sdk/managers/applications.py +304 -0
  215. agenta/sdk/managers/config.py +2 -2
  216. agenta/sdk/managers/evaluations.py +0 -0
  217. agenta/sdk/managers/evaluators.py +303 -0
  218. agenta/sdk/managers/secrets.py +161 -24
  219. agenta/sdk/managers/shared.py +3 -1
  220. agenta/sdk/managers/testsets.py +441 -0
  221. agenta/sdk/managers/vault.py +3 -3
  222. agenta/sdk/middleware/auth.py +0 -176
  223. agenta/sdk/middleware/vault.py +203 -8
  224. agenta/sdk/middlewares/__init__.py +0 -0
  225. agenta/sdk/middlewares/routing/__init__.py +0 -0
  226. agenta/sdk/middlewares/routing/auth.py +263 -0
  227. agenta/sdk/middlewares/routing/cors.py +30 -0
  228. agenta/sdk/middlewares/routing/otel.py +29 -0
  229. agenta/sdk/middlewares/running/__init__.py +0 -0
  230. agenta/sdk/middlewares/running/normalizer.py +321 -0
  231. agenta/sdk/middlewares/running/resolver.py +161 -0
  232. agenta/sdk/middlewares/running/vault.py +140 -0
  233. agenta/sdk/models/__init__.py +0 -0
  234. agenta/sdk/models/blobs.py +33 -0
  235. agenta/sdk/models/evaluations.py +119 -0
  236. agenta/sdk/models/git.py +126 -0
  237. agenta/sdk/models/shared.py +167 -0
  238. agenta/sdk/models/testsets.py +163 -0
  239. agenta/sdk/models/tracing.py +202 -0
  240. agenta/sdk/models/workflows.py +753 -0
  241. agenta/sdk/tracing/exporters.py +67 -17
  242. agenta/sdk/tracing/processors.py +97 -0
  243. agenta/sdk/tracing/propagation.py +3 -1
  244. agenta/sdk/tracing/spans.py +4 -0
  245. agenta/sdk/tracing/tracing.py +13 -13
  246. agenta/sdk/types.py +211 -17
  247. agenta/sdk/utils/cache.py +1 -1
  248. agenta/sdk/utils/client.py +38 -0
  249. agenta/sdk/utils/helpers.py +13 -12
  250. agenta/sdk/utils/logging.py +18 -78
  251. agenta/sdk/utils/references.py +23 -0
  252. agenta/sdk/workflows/builtin.py +600 -0
  253. agenta/sdk/workflows/configurations.py +22 -0
  254. agenta/sdk/workflows/errors.py +292 -0
  255. agenta/sdk/workflows/handlers.py +1791 -0
  256. agenta/sdk/workflows/interfaces.py +948 -0
  257. agenta/sdk/workflows/sandbox.py +118 -0
  258. agenta/sdk/workflows/utils.py +303 -6
  259. {agenta-0.57.0.dist-info → agenta-0.65.0.dist-info}/METADATA +44 -47
  260. agenta-0.65.0.dist-info/RECORD +421 -0
  261. agenta/sdk/middleware/adapt.py +0 -253
  262. agenta/sdk/middleware/base.py +0 -40
  263. agenta/sdk/middleware/flags.py +0 -40
  264. agenta/sdk/workflows/types.py +0 -472
  265. agenta-0.57.0.dist-info/RECORD +0 -371
  266. /agenta/sdk/{workflows → engines/running}/registry.py +0 -0
  267. {agenta-0.57.0.dist-info → agenta-0.65.0.dist-info}/WHEEL +0 -0
agenta/__init__.py CHANGED
@@ -27,8 +27,12 @@ from .sdk.utils.costs import calculate_token_usage
27
27
  from .sdk.tracing import Tracing, get_tracer
28
28
  from .sdk.tracing.conventions import Reference
29
29
  from .sdk.decorators.tracing import instrument
30
- from .sdk.decorators.running import workflow, workflows
31
- from .sdk.decorators.serving import entrypoint, app, route
30
+ from .sdk.decorators.running import (
31
+ workflow,
32
+ application,
33
+ evaluator,
34
+ )
35
+ from .sdk.decorators.serving import route, app
32
36
  from .sdk.context.running import workflow_mode_enabled
33
37
  from .sdk.litellm import litellm as callbacks
34
38
  from .sdk.managers.apps import AppManager
@@ -40,6 +44,10 @@ from .sdk.managers.deployment import DeploymentManager
40
44
  from .sdk import assets as assets
41
45
  from .sdk import tracer
42
46
 
47
+ # evaluations
48
+ from .sdk import testsets as testsets
49
+
50
+
43
51
  config = PreInitObject("agenta.config", Config)
44
52
  DEFAULT_AGENTA_SINGLETON_INSTANCE = AgentaSingleton()
45
53
 
@@ -65,7 +73,8 @@ def init(
65
73
  global api, async_api, tracing, tracer # pylint: disable=global-statement
66
74
 
67
75
  _init(
68
- host=host or api_url,
76
+ host=host,
77
+ api_url=api_url,
69
78
  api_key=api_key,
70
79
  config_fname=config_fname,
71
80
  redact=redact,
agenta/client/__init__.py CHANGED
@@ -160,8 +160,8 @@ from .backend.types import (
160
160
  StandardProviderSettingsDto,
161
161
  StatusCode,
162
162
  StatusDto,
163
- TestSetOutputResponse,
164
- TestSetSimpleResponse,
163
+ TestsetOutputResponse,
164
+ TestsetSimpleResponse,
165
165
  TestcaseResponse,
166
166
  Testset,
167
167
  TestsetRequest,
@@ -403,8 +403,8 @@ __all__ = [
403
403
  "StandardProviderSettingsDto",
404
404
  "StatusCode",
405
405
  "StatusDto",
406
- "TestSetOutputResponse",
407
- "TestSetSimpleResponse",
406
+ "TestsetOutputResponse",
407
+ "TestsetSimpleResponse",
408
408
  "TestcaseResponse",
409
409
  "Testset",
410
410
  "TestsetRequest",
@@ -155,8 +155,8 @@ from .types import (
155
155
  StandardProviderSettingsDto,
156
156
  StatusCode,
157
157
  StatusDto,
158
- TestSetOutputResponse,
159
- TestSetSimpleResponse,
158
+ TestsetOutputResponse,
159
+ TestsetSimpleResponse,
160
160
  TestcaseResponse,
161
161
  Testset,
162
162
  TestsetRequest,
@@ -398,8 +398,8 @@ __all__ = [
398
398
  "StandardProviderSettingsDto",
399
399
  "StatusCode",
400
400
  "StatusDto",
401
- "TestSetOutputResponse",
402
- "TestSetSimpleResponse",
401
+ "TestsetOutputResponse",
402
+ "TestsetSimpleResponse",
403
403
  "TestcaseResponse",
404
404
  "Testset",
405
405
  "TestsetRequest",
@@ -95,7 +95,7 @@ class ApiKeysClient:
95
95
  self,
96
96
  key_prefix: str,
97
97
  *,
98
- request_options: typing.Optional[RequestOptions] = None
98
+ request_options: typing.Optional[RequestOptions] = None,
99
99
  ) -> typing.Dict[str, typing.Optional[typing.Any]]:
100
100
  """
101
101
  Delete an API key with the given key prefix for the authenticated user.
@@ -246,7 +246,7 @@ class AsyncApiKeysClient:
246
246
  self,
247
247
  key_prefix: str,
248
248
  *,
249
- request_options: typing.Optional[RequestOptions] = None
249
+ request_options: typing.Optional[RequestOptions] = None,
250
250
  ) -> typing.Dict[str, typing.Optional[typing.Any]]:
251
251
  """
252
252
  Delete an API key with the given key prefix for the authenticated user.
@@ -80,7 +80,7 @@ class BillingClient:
80
80
  *,
81
81
  plan: Plan,
82
82
  success_url: str,
83
- request_options: typing.Optional[RequestOptions] = None
83
+ request_options: typing.Optional[RequestOptions] = None,
84
84
  ) -> typing.Optional[typing.Any]:
85
85
  """
86
86
  Parameters
@@ -343,7 +343,7 @@ class AsyncBillingClient:
343
343
  *,
344
344
  plan: Plan,
345
345
  success_url: str,
346
- request_options: typing.Optional[RequestOptions] = None
346
+ request_options: typing.Optional[RequestOptions] = None,
347
347
  ) -> typing.Optional[typing.Any]:
348
348
  """
349
349
  Parameters
@@ -110,7 +110,7 @@ class RawBillingClient:
110
110
  *,
111
111
  plan: Plan,
112
112
  success_url: str,
113
- request_options: typing.Optional[RequestOptions] = None
113
+ request_options: typing.Optional[RequestOptions] = None,
114
114
  ) -> HttpResponse[typing.Optional[typing.Any]]:
115
115
  """
116
116
  Parameters
@@ -506,7 +506,7 @@ class AsyncRawBillingClient:
506
506
  *,
507
507
  plan: Plan,
508
508
  success_url: str,
509
- request_options: typing.Optional[RequestOptions] = None
509
+ request_options: typing.Optional[RequestOptions] = None,
510
510
  ) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
511
511
  """
512
512
  Parameters
@@ -98,13 +98,17 @@ class AgentaApi:
98
98
  self._client_wrapper = SyncClientWrapper(
99
99
  base_url=_get_base_url(base_url=base_url, environment=environment),
100
100
  api_key=api_key,
101
- httpx_client=httpx_client
102
- if httpx_client is not None
103
- else httpx.Client(
104
- timeout=_defaulted_timeout, follow_redirects=follow_redirects
105
- )
106
- if follow_redirects is not None
107
- else httpx.Client(timeout=_defaulted_timeout),
101
+ httpx_client=(
102
+ httpx_client
103
+ if httpx_client is not None
104
+ else (
105
+ httpx.Client(
106
+ timeout=_defaulted_timeout, follow_redirects=follow_redirects
107
+ )
108
+ if follow_redirects is not None
109
+ else httpx.Client(timeout=_defaulted_timeout)
110
+ )
111
+ ),
108
112
  timeout=_defaulted_timeout,
109
113
  )
110
114
  self._raw_client = RawAgentaApi(client_wrapper=self._client_wrapper)
@@ -172,7 +176,7 @@ class AgentaApi:
172
176
 
173
177
  def update_organization(
174
178
  self,
175
- org_id: str,
179
+ organization_id: str,
176
180
  *,
177
181
  name: typing.Optional[str] = OMIT,
178
182
  description: typing.Optional[str] = OMIT,
@@ -182,7 +186,7 @@ class AgentaApi:
182
186
  """
183
187
  Parameters
184
188
  ----------
185
- org_id : str
189
+ organization_id : str
186
190
 
187
191
  name : typing.Optional[str]
188
192
 
@@ -206,11 +210,11 @@ class AgentaApi:
206
210
  api_key="YOUR_API_KEY",
207
211
  )
208
212
  client.update_organization(
209
- org_id="org_id",
213
+ organization_id="organization_id",
210
214
  )
211
215
  """
212
216
  _response = self._raw_client.update_organization(
213
- org_id,
217
+ organization_id,
214
218
  name=name,
215
219
  description=description,
216
220
  updated_at=updated_at,
@@ -220,7 +224,7 @@ class AgentaApi:
220
224
 
221
225
  def create_workspace(
222
226
  self,
223
- org_id: str,
227
+ organization_id: str,
224
228
  *,
225
229
  name: str,
226
230
  description: typing.Optional[str] = OMIT,
@@ -230,7 +234,7 @@ class AgentaApi:
230
234
  """
231
235
  Parameters
232
236
  ----------
233
- org_id : str
237
+ organization_id : str
234
238
 
235
239
  name : str
236
240
 
@@ -254,12 +258,12 @@ class AgentaApi:
254
258
  api_key="YOUR_API_KEY",
255
259
  )
256
260
  client.create_workspace(
257
- org_id="org_id",
261
+ organization_id="organization_id",
258
262
  name="name",
259
263
  )
260
264
  """
261
265
  _response = self._raw_client.create_workspace(
262
- org_id,
266
+ organization_id,
263
267
  name=name,
264
268
  description=description,
265
269
  type=type,
@@ -269,7 +273,7 @@ class AgentaApi:
269
273
 
270
274
  def update_workspace(
271
275
  self,
272
- org_id: str,
276
+ organization_id: str,
273
277
  workspace_id: str,
274
278
  *,
275
279
  name: typing.Optional[str] = OMIT,
@@ -280,7 +284,7 @@ class AgentaApi:
280
284
  """
281
285
  Parameters
282
286
  ----------
283
- org_id : str
287
+ organization_id : str
284
288
 
285
289
  workspace_id : str
286
290
 
@@ -306,12 +310,12 @@ class AgentaApi:
306
310
  api_key="YOUR_API_KEY",
307
311
  )
308
312
  client.update_workspace(
309
- org_id="org_id",
313
+ organization_id="organization_id",
310
314
  workspace_id="workspace_id",
311
315
  )
312
316
  """
313
317
  _response = self._raw_client.update_workspace(
314
- org_id,
318
+ organization_id,
315
319
  workspace_id,
316
320
  name=name,
317
321
  description=description,
@@ -427,7 +431,7 @@ class AgentaApi:
427
431
  workspace_id: str,
428
432
  *,
429
433
  email: str,
430
- org_id: str,
434
+ organization_id: str,
431
435
  role: str,
432
436
  request_options: typing.Optional[RequestOptions] = None,
433
437
  ) -> typing.Optional[typing.Any]:
@@ -437,7 +441,7 @@ class AgentaApi:
437
441
  Args:
438
442
  workspace_id (str): The ID of the workspace.
439
443
  email (str): The email of the user to remove the role from.
440
- org_id (str): The ID of the organization.
444
+ organization_id (str): The ID of the organization.
441
445
  role (str): The role to remove from the user.
442
446
  request (Request): The FastAPI request object.
443
447
 
@@ -454,7 +458,7 @@ class AgentaApi:
454
458
 
455
459
  email : str
456
460
 
457
- org_id : str
461
+ organization_id : str
458
462
 
459
463
  role : str
460
464
 
@@ -476,14 +480,14 @@ class AgentaApi:
476
480
  client.unassign_role_from_user(
477
481
  workspace_id="workspace_id",
478
482
  email="email",
479
- org_id="org_id",
483
+ organization_id="organization_id",
480
484
  role="role",
481
485
  )
482
486
  """
483
487
  _response = self._raw_client.unassign_role_from_user(
484
488
  workspace_id,
485
489
  email=email,
486
- org_id=org_id,
490
+ organization_id=organization_id,
487
491
  role=role,
488
492
  request_options=request_options,
489
493
  )
@@ -657,13 +661,17 @@ class AsyncAgentaApi:
657
661
  self._client_wrapper = AsyncClientWrapper(
658
662
  base_url=_get_base_url(base_url=base_url, environment=environment),
659
663
  api_key=api_key,
660
- httpx_client=httpx_client
661
- if httpx_client is not None
662
- else httpx.AsyncClient(
663
- timeout=_defaulted_timeout, follow_redirects=follow_redirects
664
- )
665
- if follow_redirects is not None
666
- else httpx.AsyncClient(timeout=_defaulted_timeout),
664
+ httpx_client=(
665
+ httpx_client
666
+ if httpx_client is not None
667
+ else (
668
+ httpx.AsyncClient(
669
+ timeout=_defaulted_timeout, follow_redirects=follow_redirects
670
+ )
671
+ if follow_redirects is not None
672
+ else httpx.AsyncClient(timeout=_defaulted_timeout)
673
+ )
674
+ ),
667
675
  timeout=_defaulted_timeout,
668
676
  )
669
677
  self._raw_client = AsyncRawAgentaApi(client_wrapper=self._client_wrapper)
@@ -743,7 +751,7 @@ class AsyncAgentaApi:
743
751
 
744
752
  async def update_organization(
745
753
  self,
746
- org_id: str,
754
+ organization_id: str,
747
755
  *,
748
756
  name: typing.Optional[str] = OMIT,
749
757
  description: typing.Optional[str] = OMIT,
@@ -753,7 +761,7 @@ class AsyncAgentaApi:
753
761
  """
754
762
  Parameters
755
763
  ----------
756
- org_id : str
764
+ organization_id : str
757
765
 
758
766
  name : typing.Optional[str]
759
767
 
@@ -782,14 +790,14 @@ class AsyncAgentaApi:
782
790
 
783
791
  async def main() -> None:
784
792
  await client.update_organization(
785
- org_id="org_id",
793
+ organization_id="organization_id",
786
794
  )
787
795
 
788
796
 
789
797
  asyncio.run(main())
790
798
  """
791
799
  _response = await self._raw_client.update_organization(
792
- org_id,
800
+ organization_id,
793
801
  name=name,
794
802
  description=description,
795
803
  updated_at=updated_at,
@@ -799,7 +807,7 @@ class AsyncAgentaApi:
799
807
 
800
808
  async def create_workspace(
801
809
  self,
802
- org_id: str,
810
+ organization_id: str,
803
811
  *,
804
812
  name: str,
805
813
  description: typing.Optional[str] = OMIT,
@@ -809,7 +817,7 @@ class AsyncAgentaApi:
809
817
  """
810
818
  Parameters
811
819
  ----------
812
- org_id : str
820
+ organization_id : str
813
821
 
814
822
  name : str
815
823
 
@@ -838,7 +846,7 @@ class AsyncAgentaApi:
838
846
 
839
847
  async def main() -> None:
840
848
  await client.create_workspace(
841
- org_id="org_id",
849
+ organization_id="organization_id",
842
850
  name="name",
843
851
  )
844
852
 
@@ -846,7 +854,7 @@ class AsyncAgentaApi:
846
854
  asyncio.run(main())
847
855
  """
848
856
  _response = await self._raw_client.create_workspace(
849
- org_id,
857
+ organization_id,
850
858
  name=name,
851
859
  description=description,
852
860
  type=type,
@@ -856,7 +864,7 @@ class AsyncAgentaApi:
856
864
 
857
865
  async def update_workspace(
858
866
  self,
859
- org_id: str,
867
+ organization_id: str,
860
868
  workspace_id: str,
861
869
  *,
862
870
  name: typing.Optional[str] = OMIT,
@@ -867,7 +875,7 @@ class AsyncAgentaApi:
867
875
  """
868
876
  Parameters
869
877
  ----------
870
- org_id : str
878
+ organization_id : str
871
879
 
872
880
  workspace_id : str
873
881
 
@@ -898,7 +906,7 @@ class AsyncAgentaApi:
898
906
 
899
907
  async def main() -> None:
900
908
  await client.update_workspace(
901
- org_id="org_id",
909
+ organization_id="organization_id",
902
910
  workspace_id="workspace_id",
903
911
  )
904
912
 
@@ -906,7 +914,7 @@ class AsyncAgentaApi:
906
914
  asyncio.run(main())
907
915
  """
908
916
  _response = await self._raw_client.update_workspace(
909
- org_id,
917
+ organization_id,
910
918
  workspace_id,
911
919
  name=name,
912
920
  description=description,
@@ -1038,7 +1046,7 @@ class AsyncAgentaApi:
1038
1046
  workspace_id: str,
1039
1047
  *,
1040
1048
  email: str,
1041
- org_id: str,
1049
+ organization_id: str,
1042
1050
  role: str,
1043
1051
  request_options: typing.Optional[RequestOptions] = None,
1044
1052
  ) -> typing.Optional[typing.Any]:
@@ -1048,7 +1056,7 @@ class AsyncAgentaApi:
1048
1056
  Args:
1049
1057
  workspace_id (str): The ID of the workspace.
1050
1058
  email (str): The email of the user to remove the role from.
1051
- org_id (str): The ID of the organization.
1059
+ organization_id (str): The ID of the organization.
1052
1060
  role (str): The role to remove from the user.
1053
1061
  request (Request): The FastAPI request object.
1054
1062
 
@@ -1065,7 +1073,7 @@ class AsyncAgentaApi:
1065
1073
 
1066
1074
  email : str
1067
1075
 
1068
- org_id : str
1076
+ organization_id : str
1069
1077
 
1070
1078
  role : str
1071
1079
 
@@ -1092,7 +1100,7 @@ class AsyncAgentaApi:
1092
1100
  await client.unassign_role_from_user(
1093
1101
  workspace_id="workspace_id",
1094
1102
  email="email",
1095
- org_id="org_id",
1103
+ organization_id="organization_id",
1096
1104
  role="role",
1097
1105
  )
1098
1106
 
@@ -1102,7 +1110,7 @@ class AsyncAgentaApi:
1102
1110
  _response = await self._raw_client.unassign_role_from_user(
1103
1111
  workspace_id,
1104
1112
  email=email,
1105
- org_id=org_id,
1113
+ organization_id=organization_id,
1106
1114
  role=role,
1107
1115
  request_options=request_options,
1108
1116
  )
@@ -35,7 +35,7 @@ class SyncClientWrapper(BaseClientWrapper):
35
35
  api_key: str,
36
36
  base_url: str,
37
37
  timeout: typing.Optional[float] = None,
38
- httpx_client: httpx.Client
38
+ httpx_client: httpx.Client,
39
39
  ):
40
40
  super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
41
41
  self.httpx_client = HttpClient(
@@ -53,7 +53,7 @@ class AsyncClientWrapper(BaseClientWrapper):
53
53
  api_key: str,
54
54
  base_url: str,
55
55
  timeout: typing.Optional[float] = None,
56
- httpx_client: httpx.AsyncClient
56
+ httpx_client: httpx.AsyncClient,
57
57
  ):
58
58
  super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
59
59
  self.httpx_client = AsyncHttpClient(
@@ -53,7 +53,9 @@ def with_content_type(*, file: File, default_content_type: str) -> File:
53
53
  filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore
54
54
  return (filename, content, default_content_type)
55
55
  elif len(file) == 3:
56
- filename, content, file_content_type = cast(Tuple[Optional[str], FileContent, Optional[str]], file) # type: ignore
56
+ filename, content, file_content_type = cast(
57
+ Tuple[Optional[str], FileContent, Optional[str]], file
58
+ ) # type: ignore
57
59
  out_content_type = file_content_type or default_content_type
58
60
  return (filename, content, out_content_type)
59
61
  elif len(file) == 4:
@@ -148,9 +148,9 @@ def get_request_body(
148
148
  json_body = maybe_filter_request_body(json, request_options, omit)
149
149
 
150
150
  # If you have an empty JSON body, you should just send None
151
- return (
152
- json_body if json_body != {} else None
153
- ), data_body if data_body != {} else None
151
+ return (json_body if json_body != {} else None), (
152
+ data_body if data_body != {} else None
153
+ )
154
154
 
155
155
 
156
156
  class HttpClient:
@@ -78,7 +78,9 @@ class UniversalBaseModel(pydantic.BaseModel):
78
78
  )
79
79
 
80
80
  @pydantic.model_serializer(mode="wrap", when_used="json") # type: ignore[attr-defined]
81
- def serialize_model(self, handler: pydantic.SerializerFunctionWrapHandler) -> Any: # type: ignore[name-defined]
81
+ def serialize_model(
82
+ self, handler: pydantic.SerializerFunctionWrapHandler
83
+ ) -> Any: # type: ignore[name-defined]
82
84
  serialized = handler(self)
83
85
  data = {
84
86
  k: serialize_datetime(v) if isinstance(v, dt.datetime) else v
@@ -260,7 +262,10 @@ def universal_root_validator(
260
262
  ) -> Callable[[AnyCallable], AnyCallable]:
261
263
  def decorator(func: AnyCallable) -> AnyCallable:
262
264
  if IS_PYDANTIC_V2:
263
- return cast(AnyCallable, pydantic.model_validator(mode="before" if pre else "after")(func)) # type: ignore[attr-defined]
265
+ return cast(
266
+ AnyCallable,
267
+ pydantic.model_validator(mode="before" if pre else "after")(func),
268
+ ) # type: ignore[attr-defined]
264
269
  return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload]
265
270
 
266
271
  return decorator
@@ -271,7 +276,12 @@ def universal_field_validator(
271
276
  ) -> Callable[[AnyCallable], AnyCallable]:
272
277
  def decorator(func: AnyCallable) -> AnyCallable:
273
278
  if IS_PYDANTIC_V2:
274
- return cast(AnyCallable, pydantic.field_validator(field_name, mode="before" if pre else "after")(func)) # type: ignore[attr-defined]
279
+ return cast(
280
+ AnyCallable,
281
+ pydantic.field_validator(field_name, mode="before" if pre else "after")(
282
+ func
283
+ ),
284
+ ) # type: ignore[attr-defined]
275
285
  return cast(AnyCallable, pydantic.validator(field_name, pre=pre)(func))
276
286
 
277
287
  return decorator
@@ -237,7 +237,7 @@ class HumanEvaluationsClient:
237
237
  Updates an evaluation's status.
238
238
 
239
239
  Raises:
240
- HTTPException: If the columns in the test set do not match with the inputs in the variant.
240
+ HTTPException: If the columns in the testset do not match with the inputs in the variant.
241
241
 
242
242
  Returns:
243
243
  None: A 204 No Content status code, indicating that the update was successful.
@@ -785,7 +785,7 @@ class AsyncHumanEvaluationsClient:
785
785
  Updates an evaluation's status.
786
786
 
787
787
  Raises:
788
- HTTPException: If the columns in the test set do not match with the inputs in the variant.
788
+ HTTPException: If the columns in the testset do not match with the inputs in the variant.
789
789
 
790
790
  Returns:
791
791
  None: A 204 No Content status code, indicating that the update was successful.
@@ -336,7 +336,7 @@ class RawHumanEvaluationsClient:
336
336
  Updates an evaluation's status.
337
337
 
338
338
  Raises:
339
- HTTPException: If the columns in the test set do not match with the inputs in the variant.
339
+ HTTPException: If the columns in the testset do not match with the inputs in the variant.
340
340
 
341
341
  Returns:
342
342
  None: A 204 No Content status code, indicating that the update was successful.
@@ -1112,7 +1112,7 @@ class AsyncRawHumanEvaluationsClient:
1112
1112
  Updates an evaluation's status.
1113
1113
 
1114
1114
  Raises:
1115
- HTTPException: If the columns in the test set do not match with the inputs in the variant.
1115
+ HTTPException: If the columns in the testset do not match with the inputs in the variant.
1116
1116
 
1117
1117
  Returns:
1118
1118
  None: A 204 No Content status code, indicating that the update was successful.