agenta 0.36.5__tar.gz → 0.37.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (259) hide show
  1. {agenta-0.36.5 → agenta-0.37.0}/PKG-INFO +2 -6
  2. {agenta-0.36.5 → agenta-0.37.0}/agenta/__init__.py +1 -2
  3. {agenta-0.36.5 → agenta-0.37.0}/agenta/client/__init__.py +6 -10
  4. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/admin/client.py +2 -0
  5. agenta-0.37.0/agenta/client/backend/api_keys/client.py +531 -0
  6. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/apps/client.py +0 -222
  7. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/containers/client.py +10 -70
  8. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/http_client.py +6 -6
  9. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/pydantic_utilities.py +2 -2
  10. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/environments/client.py +0 -2
  11. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/human_evaluations/client.py +0 -2
  12. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/observability/client.py +98 -0
  13. agenta-0.37.0/agenta/client/backend/organization/client.py +839 -0
  14. agenta-0.37.0/agenta/client/backend/testsets/__init__.py +1 -0
  15. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/__init__.py +22 -6
  16. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_nodes_response.py +0 -5
  17. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_root_dto.py +0 -5
  18. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_roots_response.py +0 -5
  19. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_tree_dto.py +0 -5
  20. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_trees_response.py +0 -5
  21. agenta-0.37.0/agenta/client/backend/types/custom_model_settings_dto.py +22 -0
  22. agenta-0.37.0/agenta/client/backend/types/custom_provider_dto.py +29 -0
  23. agenta-0.37.0/agenta/client/backend/types/custom_provider_kind.py +26 -0
  24. agenta-0.37.0/agenta/client/backend/types/custom_provider_settings_dto.py +24 -0
  25. agenta-0.37.0/agenta/client/backend/types/data.py +7 -0
  26. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/organization.py +1 -4
  27. agenta-0.37.0/agenta/client/backend/types/organization_details.py +29 -0
  28. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/organization_membership_request.py +3 -2
  29. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/permission.py +1 -0
  30. agenta-0.37.0/agenta/client/backend/types/provider_key_dto.py +21 -0
  31. agenta-0.37.0/agenta/client/backend/types/provider_kind.py +21 -0
  32. agenta-0.37.0/agenta/client/backend/types/score.py +3 -0
  33. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/secret_dto.py +3 -3
  34. agenta-0.37.0/agenta/client/backend/types/secret_kind.py +5 -0
  35. agenta-0.37.0/agenta/client/backend/types/standard_provider_dto.py +24 -0
  36. agenta-0.37.0/agenta/client/backend/types/standard_provider_kind.py +21 -0
  37. agenta-0.37.0/agenta/client/backend/types/standard_provider_settings_dto.py +21 -0
  38. agenta-0.37.0/agenta/client/backend/types/workspace.py +24 -0
  39. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/variants/client.py +18 -24
  40. agenta-0.37.0/agenta/client/backend/vault/__init__.py +1 -0
  41. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/vault/client.py +26 -8
  42. agenta-0.37.0/agenta/client/backend/workspace/__init__.py +1 -0
  43. agenta-0.37.0/agenta/client/backend/workspace/client.py +405 -0
  44. {agenta-0.36.5 → agenta-0.37.0}/agenta/client/client.py +46 -46
  45. agenta-0.37.0/agenta/client/types/provider_key_dto.py~feat_model-registry +21 -0
  46. agenta-0.37.0/agenta/client/types/provider_kind.py~feat_model-registry +21 -0
  47. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/__init__.py +1 -1
  48. agenta-0.37.0/agenta/sdk/managers/secrets.py +202 -0
  49. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/shared.py +3 -3
  50. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/vault.py +29 -37
  51. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/types.py +4 -7
  52. {agenta-0.36.5 → agenta-0.37.0}/pyproject.toml +6 -9
  53. agenta-0.36.5/agenta/client/types/score.py +0 -5
  54. agenta-0.36.5/agenta/client/types/secret_kind.py +0 -5
  55. agenta-0.36.5/agenta/sdk/client.py +0 -56
  56. agenta-0.36.5/agenta/sdk/managers/secrets.py +0 -38
  57. {agenta-0.36.5 → agenta-0.37.0}/README.md +0 -0
  58. {agenta-0.36.5 → agenta-0.37.0}/agenta/client/Readme.md +0 -0
  59. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/access_control/__init__.py +0 -0
  60. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/access_control/client.py +0 -0
  61. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/admin/__init__.py +0 -0
  62. {agenta-0.36.5/agenta/client/apps → agenta-0.37.0/agenta/client/backend/api_keys}/__init__.py +0 -0
  63. {agenta-0.36.5/agenta/client/bases → agenta-0.37.0/agenta/client/backend/apps}/__init__.py +0 -0
  64. {agenta-0.36.5/agenta/client/configs → agenta-0.37.0/agenta/client/backend/bases}/__init__.py +0 -0
  65. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/bases/client.py +0 -0
  66. {agenta-0.36.5/agenta/client/environments → agenta-0.37.0/agenta/client/backend/configs}/__init__.py +0 -0
  67. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/configs/client.py +0 -0
  68. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/containers/__init__.py +0 -0
  69. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/containers/types/__init__.py +0 -0
  70. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/containers/types/container_templates_response.py +0 -0
  71. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/__init__.py +0 -0
  72. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/api_error.py +0 -0
  73. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/client_wrapper.py +0 -0
  74. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/datetime_utils.py +0 -0
  75. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/file.py +0 -0
  76. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/jsonable_encoder.py +0 -0
  77. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/query_encoder.py +0 -0
  78. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/remove_none_from_dict.py +0 -0
  79. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/request_options.py +0 -0
  80. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/core/serialization.py +0 -0
  81. {agenta-0.36.5/agenta/client/evaluations → agenta-0.37.0/agenta/client/backend/environments}/__init__.py +0 -0
  82. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/errors/__init__.py +0 -0
  83. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/errors/unprocessable_entity_error.py +0 -0
  84. {agenta-0.36.5/agenta/client/evaluators → agenta-0.37.0/agenta/client/backend/evaluations}/__init__.py +0 -0
  85. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/evaluations/client.py +0 -0
  86. {agenta-0.36.5/agenta/client/human_evaluations → agenta-0.37.0/agenta/client/backend/evaluators}/__init__.py +0 -0
  87. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/evaluators/client.py +0 -0
  88. {agenta-0.36.5/agenta/client/scopes → agenta-0.37.0/agenta/client/backend/human_evaluations}/__init__.py +0 -0
  89. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/observability/__init__.py +0 -0
  90. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/observability/types/__init__.py +0 -0
  91. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/observability/types/format.py +0 -0
  92. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/observability/types/query_analytics_response.py +0 -0
  93. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/observability/types/query_traces_response.py +0 -0
  94. {agenta-0.36.5/agenta/client/testsets → agenta-0.37.0/agenta/client/backend/organization}/__init__.py +0 -0
  95. {agenta-0.36.5/agenta/client/vault → agenta-0.37.0/agenta/client/backend/scopes}/__init__.py +0 -0
  96. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/scopes/client.py +0 -0
  97. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/testsets/client.py +0 -0
  98. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/account_response.py +0 -0
  99. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_node_dto.py +0 -0
  100. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/agenta_node_dto_nodes_value.py +0 -0
  101. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/aggregated_result.py +0 -0
  102. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/aggregated_result_evaluator_config.py +0 -0
  103. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/analytics_response.py +0 -0
  104. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/app.py +0 -0
  105. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/app_variant_response.py +0 -0
  106. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/app_variant_revision.py +0 -0
  107. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/base_output.py +0 -0
  108. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/body_import_testset.py +0 -0
  109. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/bucket_dto.py +0 -0
  110. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/collect_status_response.py +0 -0
  111. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/config_db.py +0 -0
  112. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/config_dto.py +0 -0
  113. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/config_response_model.py +0 -0
  114. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/correct_answer.py +0 -0
  115. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/create_app_output.py +0 -0
  116. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/delete_evaluation.py +0 -0
  117. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/docker_env_vars.py +0 -0
  118. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/environment_output.py +0 -0
  119. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/environment_output_extended.py +0 -0
  120. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/environment_revision.py +0 -0
  121. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/error.py +0 -0
  122. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation.py +0 -0
  123. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation_scenario.py +0 -0
  124. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation_scenario_input.py +0 -0
  125. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation_scenario_output.py +0 -0
  126. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation_scenario_result.py +0 -0
  127. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation_status_enum.py +0 -0
  128. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluation_type.py +0 -0
  129. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluator.py +0 -0
  130. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluator_config.py +0 -0
  131. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluator_mapping_output_interface.py +0 -0
  132. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/evaluator_output_interface.py +0 -0
  133. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/exception_dto.py +0 -0
  134. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/get_config_response.py +0 -0
  135. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/header_dto.py +0 -0
  136. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/http_validation_error.py +0 -0
  137. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/human_evaluation.py +0 -0
  138. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/human_evaluation_scenario.py +0 -0
  139. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/human_evaluation_scenario_input.py +0 -0
  140. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/human_evaluation_scenario_output.py +0 -0
  141. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/image.py +0 -0
  142. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/invite_request.py +0 -0
  143. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/legacy_analytics_response.py +0 -0
  144. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/legacy_data_point.py +0 -0
  145. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/legacy_scope_request.py +0 -0
  146. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/legacy_scopes_response.py +0 -0
  147. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/legacy_user_request.py +0 -0
  148. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/legacy_user_response.py +0 -0
  149. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/lifecycle_dto.py +0 -0
  150. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/link_dto.py +0 -0
  151. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/list_api_keys_response.py +0 -0
  152. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/llm_run_rate_limit.py +0 -0
  153. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/metrics_dto.py +0 -0
  154. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/new_testset.py +0 -0
  155. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/node_dto.py +0 -0
  156. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/node_type.py +0 -0
  157. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_context_dto.py +0 -0
  158. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_event_dto.py +0 -0
  159. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_extra_dto.py +0 -0
  160. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_link_dto.py +0 -0
  161. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_span_dto.py +0 -0
  162. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_span_kind.py +0 -0
  163. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_spans_response.py +0 -0
  164. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/o_tel_status_code.py +0 -0
  165. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/organization_output.py +0 -0
  166. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/organization_request.py +0 -0
  167. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/parent_dto.py +0 -0
  168. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/project_membership_request.py +0 -0
  169. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/project_request.py +0 -0
  170. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/project_scope.py +0 -0
  171. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/projects_response.py +0 -0
  172. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/reference.py +0 -0
  173. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/reference_dto.py +0 -0
  174. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/reference_request_model.py +0 -0
  175. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/result.py +0 -0
  176. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/role.py +0 -0
  177. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/root_dto.py +0 -0
  178. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/scopes_response_model.py +0 -0
  179. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/secret_response_dto.py +0 -0
  180. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/simple_evaluation_output.py +0 -0
  181. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/span_dto.py +0 -0
  182. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/span_dto_nodes_value.py +0 -0
  183. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/status_code.py +0 -0
  184. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/status_dto.py +0 -0
  185. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/template.py +0 -0
  186. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/template_image_info.py +0 -0
  187. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/test_set_output_response.py +0 -0
  188. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/test_set_simple_response.py +0 -0
  189. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/time_dto.py +0 -0
  190. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/tree_dto.py +0 -0
  191. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/tree_type.py +0 -0
  192. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/update_app_output.py +0 -0
  193. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/uri.py +0 -0
  194. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/user_request.py +0 -0
  195. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/validation_error.py +0 -0
  196. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/validation_error_loc_item.py +0 -0
  197. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/variant_action.py +0 -0
  198. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/variant_action_enum.py +0 -0
  199. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_member_response.py +0 -0
  200. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_membership_request.py +0 -0
  201. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_permission.py +0 -0
  202. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_request.py +0 -0
  203. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_response.py +0 -0
  204. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_role.py +0 -0
  205. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/types/workspace_role_response.py +0 -0
  206. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/variants/__init__.py +0 -0
  207. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/variants/types/__init__.py +0 -0
  208. {agenta-0.36.5/agenta/client → agenta-0.37.0/agenta/client/backend}/variants/types/add_variant_from_base_and_config_response.py +0 -0
  209. /agenta-0.36.5/agenta/client/types/provider_key_dto.py → /agenta-0.37.0/agenta/client/types/provider_key_dto.py~HEAD +0 -0
  210. /agenta-0.36.5/agenta/client/types/provider_kind.py → /agenta-0.37.0/agenta/client/types/provider_kind.py~HEAD +0 -0
  211. {agenta-0.36.5 → agenta-0.37.0}/agenta/config.py +0 -0
  212. {agenta-0.36.5 → agenta-0.37.0}/agenta/config.toml +0 -0
  213. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/agenta_init.py +0 -0
  214. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/assets.py +0 -0
  215. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/context/__init__.py +0 -0
  216. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/context/exporting.py +0 -0
  217. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/context/routing.py +0 -0
  218. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/context/tracing.py +0 -0
  219. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/decorators/__init__.py +0 -0
  220. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/decorators/routing.py +0 -0
  221. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/decorators/tracing.py +0 -0
  222. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/litellm/__init__.py +0 -0
  223. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/litellm/litellm.py +0 -0
  224. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/litellm/mockllm.py +0 -0
  225. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/litellm/mocks/__init__.py +0 -0
  226. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/__init__.py +0 -0
  227. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/apps.py +0 -0
  228. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/config.py +0 -0
  229. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/deployment.py +0 -0
  230. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/variant.py +0 -0
  231. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/managers/vault.py +0 -0
  232. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/__init__.py +0 -0
  233. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/auth.py +0 -0
  234. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/config.py +0 -0
  235. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/cors.py +0 -0
  236. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/inline.py +0 -0
  237. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/mock.py +0 -0
  238. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/middleware/otel.py +0 -0
  239. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/router.py +0 -0
  240. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/__init__.py +0 -0
  241. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/attributes.py +0 -0
  242. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/conventions.py +0 -0
  243. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/exporters.py +0 -0
  244. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/inline.py +0 -0
  245. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/processors.py +0 -0
  246. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/propagation.py +0 -0
  247. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/spans.py +0 -0
  248. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/tracing/tracing.py +0 -0
  249. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/__init__.py +0 -0
  250. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/cache.py +0 -0
  251. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/constants.py +0 -0
  252. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/costs.py +0 -0
  253. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/exceptions.py +0 -0
  254. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/globals.py +0 -0
  255. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/helpers.py +0 -0
  256. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/logging.py +0 -0
  257. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/preinit.py +0 -0
  258. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/singleton.py +0 -0
  259. {agenta-0.36.5 → agenta-0.37.0}/agenta/sdk/utils/timing.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: agenta
3
- Version: 0.36.5
3
+ Version: 0.37.0
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Keywords: LLMOps,LLM,evaluation,prompt engineering
6
6
  Author: Mahmoud Mabrouk
@@ -15,20 +15,16 @@ Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Software Development :: Libraries
18
- Requires-Dist: cachetools (>=5.3.3,<6.0.0)
19
- Requires-Dist: docker (>=6.1.1,<8.0.0)
20
18
  Requires-Dist: fastapi (>=0.100.0)
21
19
  Requires-Dist: httpx (>=0.24,<0.28)
22
20
  Requires-Dist: importlib-metadata (>=8.0.0,<9.0)
23
21
  Requires-Dist: litellm (>=1.48.0,<2.0.0)
24
22
  Requires-Dist: opentelemetry-api (==1.27.0)
25
- Requires-Dist: opentelemetry-exporter-otlp (==1.27.0)
23
+ Requires-Dist: opentelemetry-exporter-otlp-proto-http (==1.27.0)
26
24
  Requires-Dist: opentelemetry-sdk (==1.27.0)
27
- Requires-Dist: posthog (>=3.1.0,<4.0.0)
28
25
  Requires-Dist: pydantic (>=2)
29
26
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
30
27
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
31
- Requires-Dist: questionary (>=1.10,<3.0)
32
28
  Requires-Dist: toml (>=0.10.2,<0.11.0)
33
29
  Project-URL: Documentation, https://docs.agenta.ai
34
30
  Project-URL: Homepage, https://agenta.ai
@@ -2,7 +2,7 @@ from typing import Any, Callable, Optional
2
2
 
3
3
  from .sdk.utils.preinit import PreInitObject
4
4
 
5
- import agenta.client.types as client_types # pylint: disable=wrong-import-order
5
+ import agenta.client.backend.types as client_types # pylint: disable=wrong-import-order
6
6
 
7
7
  from .sdk.types import (
8
8
  MCField,
@@ -27,7 +27,6 @@ from .sdk.tracing.conventions import Reference
27
27
  from .sdk.decorators.routing import entrypoint, app, route
28
28
  from .sdk.agenta_init import Config, AgentaSingleton, init as _init
29
29
  from .sdk.utils.costs import calculate_token_usage
30
- from .sdk.client import Agenta
31
30
  from .sdk.litellm import litellm as callbacks
32
31
  from .sdk.managers.apps import AppManager
33
32
  from .sdk.managers.vault import VaultManager
@@ -1,6 +1,6 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- from .types import (
3
+ from .backend.types import (
4
4
  AccountResponse,
5
5
  AgentaNodeDto,
6
6
  AgentaNodeDtoNodesValue,
@@ -83,8 +83,6 @@ from .types import (
83
83
  ProjectRequest,
84
84
  ProjectScope,
85
85
  ProjectsResponse,
86
- ProviderKeyDto,
87
- ProviderKind,
88
86
  Reference,
89
87
  ReferenceDto,
90
88
  ReferenceRequestModel,
@@ -123,8 +121,8 @@ from .types import (
123
121
  WorkspaceRole,
124
122
  WorkspaceRoleResponse,
125
123
  )
126
- from .errors import UnprocessableEntityError
127
- from . import (
124
+ from .backend.errors import UnprocessableEntityError
125
+ from .backend import (
128
126
  access_control,
129
127
  admin,
130
128
  apps,
@@ -142,9 +140,9 @@ from . import (
142
140
  vault,
143
141
  )
144
142
  from .client import AgentaApi, AsyncAgentaApi
145
- from .containers import ContainerTemplatesResponse
146
- from .observability import Format, QueryAnalyticsResponse, QueryTracesResponse
147
- from .variants import AddVariantFromBaseAndConfigResponse
143
+ from .backend.containers import ContainerTemplatesResponse
144
+ from .backend.observability import Format, QueryAnalyticsResponse, QueryTracesResponse
145
+ from .backend.variants import AddVariantFromBaseAndConfigResponse
148
146
 
149
147
  __all__ = [
150
148
  "AccountResponse",
@@ -234,8 +232,6 @@ __all__ = [
234
232
  "ProjectRequest",
235
233
  "ProjectScope",
236
234
  "ProjectsResponse",
237
- "ProviderKeyDto",
238
- "ProviderKind",
239
235
  "QueryAnalyticsResponse",
240
236
  "QueryTracesResponse",
241
237
  "Reference",
@@ -118,6 +118,7 @@ class AdminClient:
118
118
  },
119
119
  organization_memberships={
120
120
  "key": OrganizationMembershipRequest(
121
+ role="owner",
121
122
  is_demo=True,
122
123
  user_ref=Reference(),
123
124
  organization_ref=Reference(),
@@ -390,6 +391,7 @@ class AsyncAdminClient:
390
391
  },
391
392
  organization_memberships={
392
393
  "key": OrganizationMembershipRequest(
394
+ role="owner",
393
395
  is_demo=True,
394
396
  user_ref=Reference(),
395
397
  organization_ref=Reference(),
@@ -0,0 +1,531 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from ..core.client_wrapper import SyncClientWrapper
4
+ import typing
5
+ from ..core.request_options import RequestOptions
6
+ from ..types.list_api_keys_response import ListApiKeysResponse
7
+ from ..core.pydantic_utilities import parse_obj_as
8
+ from json.decoder import JSONDecodeError
9
+ from ..core.api_error import ApiError
10
+ from ..core.jsonable_encoder import jsonable_encoder
11
+ from ..errors.unprocessable_entity_error import UnprocessableEntityError
12
+ from ..types.http_validation_error import HttpValidationError
13
+ from ..core.client_wrapper import AsyncClientWrapper
14
+
15
+
16
+ class ApiKeysClient:
17
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
18
+ self._client_wrapper = client_wrapper
19
+
20
+ def list_api_keys(
21
+ self, *, request_options: typing.Optional[RequestOptions] = None
22
+ ) -> typing.List[ListApiKeysResponse]:
23
+ """
24
+ List all API keys associated with the authenticated user.
25
+
26
+ Args:
27
+ request (Request): The incoming request object.
28
+
29
+ Returns:
30
+ List[ListAPIKeysResponse]: A list of API Keys associated with the user.
31
+
32
+ Parameters
33
+ ----------
34
+ request_options : typing.Optional[RequestOptions]
35
+ Request-specific configuration.
36
+
37
+ Returns
38
+ -------
39
+ typing.List[ListApiKeysResponse]
40
+ Successful Response
41
+
42
+ Examples
43
+ --------
44
+ from agenta import AgentaApi
45
+
46
+ client = AgentaApi(
47
+ api_key="YOUR_API_KEY",
48
+ base_url="https://yourhost.com/path/to/api",
49
+ )
50
+ client.api_keys.list_api_keys()
51
+ """
52
+ _response = self._client_wrapper.httpx_client.request(
53
+ "keys",
54
+ method="GET",
55
+ request_options=request_options,
56
+ )
57
+ try:
58
+ if 200 <= _response.status_code < 300:
59
+ return typing.cast(
60
+ typing.List[ListApiKeysResponse],
61
+ parse_obj_as(
62
+ type_=typing.List[ListApiKeysResponse], # type: ignore
63
+ object_=_response.json(),
64
+ ),
65
+ )
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
+ def create_api_key(
72
+ self, *, request_options: typing.Optional[RequestOptions] = None
73
+ ) -> str:
74
+ """
75
+ Creates an API key for a user.
76
+
77
+ Args:
78
+ request (Request): The request object containing the user ID in the request state.
79
+
80
+ Returns:
81
+ str: The created API key.
82
+
83
+ Parameters
84
+ ----------
85
+ request_options : typing.Optional[RequestOptions]
86
+ Request-specific configuration.
87
+
88
+ Returns
89
+ -------
90
+ str
91
+ Successful Response
92
+
93
+ Examples
94
+ --------
95
+ from agenta import AgentaApi
96
+
97
+ client = AgentaApi(
98
+ api_key="YOUR_API_KEY",
99
+ base_url="https://yourhost.com/path/to/api",
100
+ )
101
+ client.api_keys.create_api_key()
102
+ """
103
+ _response = self._client_wrapper.httpx_client.request(
104
+ "keys",
105
+ method="POST",
106
+ request_options=request_options,
107
+ )
108
+ try:
109
+ if 200 <= _response.status_code < 300:
110
+ return typing.cast(
111
+ str,
112
+ parse_obj_as(
113
+ type_=str, # type: ignore
114
+ object_=_response.json(),
115
+ ),
116
+ )
117
+ _response_json = _response.json()
118
+ except JSONDecodeError:
119
+ raise ApiError(status_code=_response.status_code, body=_response.text)
120
+ raise ApiError(status_code=_response.status_code, body=_response_json)
121
+
122
+ def delete_api_key(
123
+ self,
124
+ key_prefix: str,
125
+ *,
126
+ request_options: typing.Optional[RequestOptions] = None,
127
+ ) -> typing.Dict[str, typing.Optional[typing.Any]]:
128
+ """
129
+ Delete an API key with the given key prefix for the authenticated user.
130
+
131
+ Args:
132
+ key_prefix (str): The prefix of the API key to be deleted.
133
+ request (Request): The incoming request object.
134
+
135
+ Returns:
136
+ dict: A dictionary containing a success message upon successful deletion.
137
+
138
+ Raises:
139
+ HTTPException: If the API key is not found or does not belong to the user.
140
+
141
+ Parameters
142
+ ----------
143
+ key_prefix : str
144
+
145
+ request_options : typing.Optional[RequestOptions]
146
+ Request-specific configuration.
147
+
148
+ Returns
149
+ -------
150
+ typing.Dict[str, typing.Optional[typing.Any]]
151
+ Successful Response
152
+
153
+ Examples
154
+ --------
155
+ from agenta import AgentaApi
156
+
157
+ client = AgentaApi(
158
+ api_key="YOUR_API_KEY",
159
+ base_url="https://yourhost.com/path/to/api",
160
+ )
161
+ client.api_keys.delete_api_key(
162
+ key_prefix="key_prefix",
163
+ )
164
+ """
165
+ _response = self._client_wrapper.httpx_client.request(
166
+ f"keys/{jsonable_encoder(key_prefix)}",
167
+ method="DELETE",
168
+ request_options=request_options,
169
+ )
170
+ try:
171
+ if 200 <= _response.status_code < 300:
172
+ return typing.cast(
173
+ typing.Dict[str, typing.Optional[typing.Any]],
174
+ parse_obj_as(
175
+ type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
176
+ object_=_response.json(),
177
+ ),
178
+ )
179
+ if _response.status_code == 422:
180
+ raise UnprocessableEntityError(
181
+ typing.cast(
182
+ HttpValidationError,
183
+ parse_obj_as(
184
+ type_=HttpValidationError, # type: ignore
185
+ object_=_response.json(),
186
+ ),
187
+ )
188
+ )
189
+ _response_json = _response.json()
190
+ except JSONDecodeError:
191
+ raise ApiError(status_code=_response.status_code, body=_response.text)
192
+ raise ApiError(status_code=_response.status_code, body=_response_json)
193
+
194
+ def validate_api_key(
195
+ self,
196
+ key_prefix: str,
197
+ *,
198
+ request_options: typing.Optional[RequestOptions] = None,
199
+ ) -> bool:
200
+ """
201
+ This Function is called by the CLI and is used to validate an API key provided by a user in agenta init setup.
202
+ Returns:
203
+ bool: True. If the request reaches this point, the API key is valid.
204
+
205
+ Parameters
206
+ ----------
207
+ key_prefix : str
208
+
209
+ request_options : typing.Optional[RequestOptions]
210
+ Request-specific configuration.
211
+
212
+ Returns
213
+ -------
214
+ bool
215
+ Successful Response
216
+
217
+ Examples
218
+ --------
219
+ from agenta import AgentaApi
220
+
221
+ client = AgentaApi(
222
+ api_key="YOUR_API_KEY",
223
+ base_url="https://yourhost.com/path/to/api",
224
+ )
225
+ client.api_keys.validate_api_key(
226
+ key_prefix="key_prefix",
227
+ )
228
+ """
229
+ _response = self._client_wrapper.httpx_client.request(
230
+ f"keys/{jsonable_encoder(key_prefix)}/validate",
231
+ method="GET",
232
+ request_options=request_options,
233
+ )
234
+ try:
235
+ if 200 <= _response.status_code < 300:
236
+ return typing.cast(
237
+ bool,
238
+ parse_obj_as(
239
+ type_=bool, # type: ignore
240
+ object_=_response.json(),
241
+ ),
242
+ )
243
+ if _response.status_code == 422:
244
+ raise UnprocessableEntityError(
245
+ typing.cast(
246
+ HttpValidationError,
247
+ parse_obj_as(
248
+ type_=HttpValidationError, # type: ignore
249
+ object_=_response.json(),
250
+ ),
251
+ )
252
+ )
253
+ _response_json = _response.json()
254
+ except JSONDecodeError:
255
+ raise ApiError(status_code=_response.status_code, body=_response.text)
256
+ raise ApiError(status_code=_response.status_code, body=_response_json)
257
+
258
+
259
+ class AsyncApiKeysClient:
260
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
261
+ self._client_wrapper = client_wrapper
262
+
263
+ async def list_api_keys(
264
+ self, *, request_options: typing.Optional[RequestOptions] = None
265
+ ) -> typing.List[ListApiKeysResponse]:
266
+ """
267
+ List all API keys associated with the authenticated user.
268
+
269
+ Args:
270
+ request (Request): The incoming request object.
271
+
272
+ Returns:
273
+ List[ListAPIKeysResponse]: A list of API Keys associated with the user.
274
+
275
+ Parameters
276
+ ----------
277
+ request_options : typing.Optional[RequestOptions]
278
+ Request-specific configuration.
279
+
280
+ Returns
281
+ -------
282
+ typing.List[ListApiKeysResponse]
283
+ Successful Response
284
+
285
+ Examples
286
+ --------
287
+ import asyncio
288
+
289
+ from agenta import AsyncAgentaApi
290
+
291
+ client = AsyncAgentaApi(
292
+ api_key="YOUR_API_KEY",
293
+ base_url="https://yourhost.com/path/to/api",
294
+ )
295
+
296
+
297
+ async def main() -> None:
298
+ await client.api_keys.list_api_keys()
299
+
300
+
301
+ asyncio.run(main())
302
+ """
303
+ _response = await self._client_wrapper.httpx_client.request(
304
+ "keys",
305
+ method="GET",
306
+ request_options=request_options,
307
+ )
308
+ try:
309
+ if 200 <= _response.status_code < 300:
310
+ return typing.cast(
311
+ typing.List[ListApiKeysResponse],
312
+ parse_obj_as(
313
+ type_=typing.List[ListApiKeysResponse], # type: ignore
314
+ object_=_response.json(),
315
+ ),
316
+ )
317
+ _response_json = _response.json()
318
+ except JSONDecodeError:
319
+ raise ApiError(status_code=_response.status_code, body=_response.text)
320
+ raise ApiError(status_code=_response.status_code, body=_response_json)
321
+
322
+ async def create_api_key(
323
+ self, *, request_options: typing.Optional[RequestOptions] = None
324
+ ) -> str:
325
+ """
326
+ Creates an API key for a user.
327
+
328
+ Args:
329
+ request (Request): The request object containing the user ID in the request state.
330
+
331
+ Returns:
332
+ str: The created API key.
333
+
334
+ Parameters
335
+ ----------
336
+ request_options : typing.Optional[RequestOptions]
337
+ Request-specific configuration.
338
+
339
+ Returns
340
+ -------
341
+ str
342
+ Successful Response
343
+
344
+ Examples
345
+ --------
346
+ import asyncio
347
+
348
+ from agenta import AsyncAgentaApi
349
+
350
+ client = AsyncAgentaApi(
351
+ api_key="YOUR_API_KEY",
352
+ base_url="https://yourhost.com/path/to/api",
353
+ )
354
+
355
+
356
+ async def main() -> None:
357
+ await client.api_keys.create_api_key()
358
+
359
+
360
+ asyncio.run(main())
361
+ """
362
+ _response = await self._client_wrapper.httpx_client.request(
363
+ "keys",
364
+ method="POST",
365
+ request_options=request_options,
366
+ )
367
+ try:
368
+ if 200 <= _response.status_code < 300:
369
+ return typing.cast(
370
+ str,
371
+ parse_obj_as(
372
+ type_=str, # type: ignore
373
+ object_=_response.json(),
374
+ ),
375
+ )
376
+ _response_json = _response.json()
377
+ except JSONDecodeError:
378
+ raise ApiError(status_code=_response.status_code, body=_response.text)
379
+ raise ApiError(status_code=_response.status_code, body=_response_json)
380
+
381
+ async def delete_api_key(
382
+ self,
383
+ key_prefix: str,
384
+ *,
385
+ request_options: typing.Optional[RequestOptions] = None,
386
+ ) -> typing.Dict[str, typing.Optional[typing.Any]]:
387
+ """
388
+ Delete an API key with the given key prefix for the authenticated user.
389
+
390
+ Args:
391
+ key_prefix (str): The prefix of the API key to be deleted.
392
+ request (Request): The incoming request object.
393
+
394
+ Returns:
395
+ dict: A dictionary containing a success message upon successful deletion.
396
+
397
+ Raises:
398
+ HTTPException: If the API key is not found or does not belong to the user.
399
+
400
+ Parameters
401
+ ----------
402
+ key_prefix : str
403
+
404
+ request_options : typing.Optional[RequestOptions]
405
+ Request-specific configuration.
406
+
407
+ Returns
408
+ -------
409
+ typing.Dict[str, typing.Optional[typing.Any]]
410
+ Successful Response
411
+
412
+ Examples
413
+ --------
414
+ import asyncio
415
+
416
+ from agenta import AsyncAgentaApi
417
+
418
+ client = AsyncAgentaApi(
419
+ api_key="YOUR_API_KEY",
420
+ base_url="https://yourhost.com/path/to/api",
421
+ )
422
+
423
+
424
+ async def main() -> None:
425
+ await client.api_keys.delete_api_key(
426
+ key_prefix="key_prefix",
427
+ )
428
+
429
+
430
+ asyncio.run(main())
431
+ """
432
+ _response = await self._client_wrapper.httpx_client.request(
433
+ f"keys/{jsonable_encoder(key_prefix)}",
434
+ method="DELETE",
435
+ request_options=request_options,
436
+ )
437
+ try:
438
+ if 200 <= _response.status_code < 300:
439
+ return typing.cast(
440
+ typing.Dict[str, typing.Optional[typing.Any]],
441
+ parse_obj_as(
442
+ type_=typing.Dict[str, typing.Optional[typing.Any]], # type: ignore
443
+ object_=_response.json(),
444
+ ),
445
+ )
446
+ if _response.status_code == 422:
447
+ raise UnprocessableEntityError(
448
+ typing.cast(
449
+ HttpValidationError,
450
+ parse_obj_as(
451
+ type_=HttpValidationError, # type: ignore
452
+ object_=_response.json(),
453
+ ),
454
+ )
455
+ )
456
+ _response_json = _response.json()
457
+ except JSONDecodeError:
458
+ raise ApiError(status_code=_response.status_code, body=_response.text)
459
+ raise ApiError(status_code=_response.status_code, body=_response_json)
460
+
461
+ async def validate_api_key(
462
+ self,
463
+ key_prefix: str,
464
+ *,
465
+ request_options: typing.Optional[RequestOptions] = None,
466
+ ) -> bool:
467
+ """
468
+ This Function is called by the CLI and is used to validate an API key provided by a user in agenta init setup.
469
+ Returns:
470
+ bool: True. If the request reaches this point, the API key is valid.
471
+
472
+ Parameters
473
+ ----------
474
+ key_prefix : str
475
+
476
+ request_options : typing.Optional[RequestOptions]
477
+ Request-specific configuration.
478
+
479
+ Returns
480
+ -------
481
+ bool
482
+ Successful Response
483
+
484
+ Examples
485
+ --------
486
+ import asyncio
487
+
488
+ from agenta import AsyncAgentaApi
489
+
490
+ client = AsyncAgentaApi(
491
+ api_key="YOUR_API_KEY",
492
+ base_url="https://yourhost.com/path/to/api",
493
+ )
494
+
495
+
496
+ async def main() -> None:
497
+ await client.api_keys.validate_api_key(
498
+ key_prefix="key_prefix",
499
+ )
500
+
501
+
502
+ asyncio.run(main())
503
+ """
504
+ _response = await self._client_wrapper.httpx_client.request(
505
+ f"keys/{jsonable_encoder(key_prefix)}/validate",
506
+ method="GET",
507
+ request_options=request_options,
508
+ )
509
+ try:
510
+ if 200 <= _response.status_code < 300:
511
+ return typing.cast(
512
+ bool,
513
+ parse_obj_as(
514
+ type_=bool, # type: ignore
515
+ object_=_response.json(),
516
+ ),
517
+ )
518
+ if _response.status_code == 422:
519
+ raise UnprocessableEntityError(
520
+ typing.cast(
521
+ HttpValidationError,
522
+ parse_obj_as(
523
+ type_=HttpValidationError, # type: ignore
524
+ object_=_response.json(),
525
+ ),
526
+ )
527
+ )
528
+ _response_json = _response.json()
529
+ except JSONDecodeError:
530
+ raise ApiError(status_code=_response.status_code, body=_response.text)
531
+ raise ApiError(status_code=_response.status_code, body=_response_json)