agenta 0.27.0a9__tar.gz → 0.27.0a12__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 (199) hide show
  1. {agenta-0.27.0a9 → agenta-0.27.0a12}/PKG-INFO +1 -1
  2. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/__init__.py +21 -3
  3. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/__init__.py +14 -0
  4. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/apps/client.py +28 -20
  5. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/client.py +25 -2
  6. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/containers/client.py +5 -1
  7. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/__init__.py +2 -1
  8. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/client_wrapper.py +6 -6
  9. agenta-0.27.0a12/agenta/client/backend/core/file.py +65 -0
  10. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/http_client.py +24 -18
  11. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/pydantic_utilities.py +144 -29
  12. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/request_options.py +3 -0
  13. agenta-0.27.0a12/agenta/client/backend/core/serialization.py +276 -0
  14. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/evaluations/client.py +7 -2
  15. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/evaluators/client.py +349 -1
  16. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/observability/client.py +11 -2
  17. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/testsets/client.py +10 -10
  18. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/__init__.py +14 -0
  19. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/app.py +1 -0
  20. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/app_variant_response.py +3 -1
  21. agenta-0.27.0a12/agenta/client/backend/types/config_dto.py +32 -0
  22. agenta-0.27.0a12/agenta/client/backend/types/config_response_model.py +32 -0
  23. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/create_span.py +3 -2
  24. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/environment_output.py +1 -0
  25. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/environment_output_extended.py +1 -0
  26. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation.py +1 -2
  27. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluator.py +2 -0
  28. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluator_config.py +1 -0
  29. agenta-0.27.0a12/agenta/client/backend/types/evaluator_mapping_output_interface.py +21 -0
  30. agenta-0.27.0a12/agenta/client/backend/types/evaluator_output_interface.py +21 -0
  31. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/human_evaluation.py +1 -2
  32. agenta-0.27.0a12/agenta/client/backend/types/lifecycle_dto.py +24 -0
  33. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/llm_tokens.py +2 -2
  34. agenta-0.27.0a12/agenta/client/backend/types/reference_dto.py +23 -0
  35. agenta-0.27.0a12/agenta/client/backend/types/reference_request_model.py +23 -0
  36. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/span.py +1 -0
  37. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/span_detail.py +7 -1
  38. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/test_set_output_response.py +5 -2
  39. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/trace_detail.py +7 -1
  40. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/with_pagination.py +4 -2
  41. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/variants/client.py +1565 -272
  42. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/__init__.py +19 -5
  43. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/agenta_init.py +21 -7
  44. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/context/routing.py +6 -5
  45. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/decorators/routing.py +16 -5
  46. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/decorators/tracing.py +16 -9
  47. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/litellm/litellm.py +47 -36
  48. agenta-0.27.0a12/agenta/sdk/managers/__init__.py +6 -0
  49. agenta-0.27.0a12/agenta/sdk/managers/config.py +318 -0
  50. agenta-0.27.0a12/agenta/sdk/managers/deployment.py +45 -0
  51. agenta-0.27.0a12/agenta/sdk/managers/shared.py +639 -0
  52. agenta-0.27.0a12/agenta/sdk/managers/variant.py +182 -0
  53. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/exporters.py +0 -1
  54. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/inline.py +45 -0
  55. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/processors.py +0 -1
  56. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/types.py +47 -2
  57. agenta-0.27.0a12/agenta/sdk/utils/exceptions.py +52 -0
  58. {agenta-0.27.0a9 → agenta-0.27.0a12}/pyproject.toml +11 -1
  59. agenta-0.27.0a9/agenta/client/backend/core/file.py +0 -43
  60. agenta-0.27.0a9/agenta/client/backend/core/serialization.py +0 -179
  61. agenta-0.27.0a9/agenta/sdk/config_manager.py +0 -205
  62. agenta-0.27.0a9/agenta/sdk/utils/exceptions.py +0 -22
  63. {agenta-0.27.0a9 → agenta-0.27.0a12}/README.md +0 -0
  64. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/cli/evaluation_commands.py +0 -0
  65. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/cli/helper.py +0 -0
  66. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/cli/main.py +0 -0
  67. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/cli/telemetry.py +0 -0
  68. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/cli/variant_commands.py +0 -0
  69. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/cli/variant_configs.py +0 -0
  70. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/Readme.md +0 -0
  71. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/__init__.py +0 -0
  72. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/api.py +0 -0
  73. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/api_models.py +0 -0
  74. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/apps/__init__.py +0 -0
  75. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/bases/__init__.py +0 -0
  76. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/bases/client.py +0 -0
  77. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/configs/__init__.py +0 -0
  78. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/configs/client.py +0 -0
  79. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/containers/__init__.py +0 -0
  80. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/containers/types/__init__.py +0 -0
  81. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/containers/types/container_templates_response.py +0 -0
  82. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/api_error.py +0 -0
  83. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/datetime_utils.py +0 -0
  84. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/jsonable_encoder.py +0 -0
  85. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/query_encoder.py +0 -0
  86. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/core/remove_none_from_dict.py +0 -0
  87. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/environments/__init__.py +0 -0
  88. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/environments/client.py +0 -0
  89. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/errors/__init__.py +0 -0
  90. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/errors/unprocessable_entity_error.py +0 -0
  91. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/evaluations/__init__.py +0 -0
  92. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/evaluators/__init__.py +0 -0
  93. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/observability/__init__.py +0 -0
  94. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/testsets/__init__.py +0 -0
  95. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/aggregated_result.py +0 -0
  96. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/aggregated_result_evaluator_config.py +0 -0
  97. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/app_variant_revision.py +0 -0
  98. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/base_output.py +0 -0
  99. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/body_import_testset.py +0 -0
  100. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/config_db.py +0 -0
  101. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/correct_answer.py +0 -0
  102. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/create_app_output.py +0 -0
  103. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/create_trace_response.py +0 -0
  104. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/docker_env_vars.py +0 -0
  105. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/environment_revision.py +0 -0
  106. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/error.py +0 -0
  107. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_scenario.py +0 -0
  108. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_scenario_input.py +0 -0
  109. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_scenario_output.py +0 -0
  110. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_scenario_result.py +0 -0
  111. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_scenario_score_update.py +0 -0
  112. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_status_enum.py +0 -0
  113. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/evaluation_type.py +0 -0
  114. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/get_config_response.py +0 -0
  115. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/http_validation_error.py +0 -0
  116. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/human_evaluation_scenario.py +0 -0
  117. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/human_evaluation_scenario_input.py +0 -0
  118. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/human_evaluation_scenario_output.py +0 -0
  119. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/human_evaluation_scenario_update.py +0 -0
  120. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/human_evaluation_update.py +0 -0
  121. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/image.py +0 -0
  122. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/invite_request.py +0 -0
  123. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/list_api_keys_response.py +0 -0
  124. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/llm_run_rate_limit.py +0 -0
  125. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/lm_providers_enum.py +0 -0
  126. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/new_human_evaluation.py +0 -0
  127. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/new_testset.py +0 -0
  128. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/organization.py +0 -0
  129. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/organization_output.py +0 -0
  130. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/outputs.py +0 -0
  131. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/permission.py +0 -0
  132. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/result.py +0 -0
  133. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/score.py +0 -0
  134. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/simple_evaluation_output.py +0 -0
  135. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/span_status_code.py +0 -0
  136. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/span_variant.py +0 -0
  137. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/template.py +0 -0
  138. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/template_image_info.py +0 -0
  139. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/test_set_simple_response.py +0 -0
  140. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/update_app_output.py +0 -0
  141. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/uri.py +0 -0
  142. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/validation_error.py +0 -0
  143. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/validation_error_loc_item.py +0 -0
  144. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/variant_action.py +0 -0
  145. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/variant_action_enum.py +0 -0
  146. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/workspace_member_response.py +0 -0
  147. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/workspace_permission.py +0 -0
  148. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/workspace_response.py +0 -0
  149. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/workspace_role.py +0 -0
  150. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/types/workspace_role_response.py +0 -0
  151. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/variants/__init__.py +0 -0
  152. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/variants/types/__init__.py +0 -0
  153. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +0 -0
  154. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/client.py +0 -0
  155. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/client/exceptions.py +0 -0
  156. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/config.py +0 -0
  157. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/config.toml +0 -0
  158. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker-assets/Dockerfile.cloud.template +0 -0
  159. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker-assets/Dockerfile.template +0 -0
  160. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker-assets/README.md +0 -0
  161. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker-assets/entrypoint.sh +0 -0
  162. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker-assets/lambda_function.py +0 -0
  163. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker-assets/main.py +0 -0
  164. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/docker/docker_utils.py +0 -0
  165. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/assets.py +0 -0
  166. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/client.py +0 -0
  167. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/context/__init__.py +0 -0
  168. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/context/tracing.py +0 -0
  169. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/decorators/__init__.py +0 -0
  170. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/litellm/__init__.py +0 -0
  171. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/router.py +0 -0
  172. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/__init__.py +0 -0
  173. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/attributes.py +0 -0
  174. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/context.py +0 -0
  175. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/conventions.py +0 -0
  176. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/spans.py +0 -0
  177. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/tracing/tracing.py +0 -0
  178. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/__init__.py +0 -0
  179. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/costs.py +0 -0
  180. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/debug.py +0 -0
  181. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/globals.py +0 -0
  182. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/logging.py +0 -0
  183. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/preinit.py +0 -0
  184. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/sdk/utils/singleton.py +0 -0
  185. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/compose_email/README.md +0 -0
  186. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/compose_email/app.py +0 -0
  187. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/compose_email/env.example +0 -0
  188. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/compose_email/requirements.txt +0 -0
  189. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/compose_email/template.toml +0 -0
  190. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/extract_data_to_json/README.md +0 -0
  191. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/extract_data_to_json/app.py +0 -0
  192. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/extract_data_to_json/env.example +0 -0
  193. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/extract_data_to_json/requirements.txt +0 -0
  194. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/extract_data_to_json/template.toml +0 -0
  195. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/simple_prompt/README.md +0 -0
  196. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/simple_prompt/app.py +0 -0
  197. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/simple_prompt/env.example +0 -0
  198. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/simple_prompt/requirements.txt +0 -0
  199. {agenta-0.27.0a9 → agenta-0.27.0a12}/agenta/templates/simple_prompt/template.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: agenta
3
- Version: 0.27.0a9
3
+ Version: 0.27.0a12
4
4
  Summary: The SDK for agenta is an open-source LLMOps platform.
5
5
  Home-page: https://agenta.ai
6
6
  Keywords: LLMOps,LLM,evaluation,prompt engineering
@@ -1,4 +1,7 @@
1
1
  from .sdk.utils.preinit import PreInitObject
2
+
3
+ import agenta.client.backend.types as client_types # pylint: disable=wrong-import-order
4
+
2
5
  from .sdk.types import (
3
6
  DictInput,
4
7
  MultipleChoice,
@@ -18,14 +21,29 @@ from .sdk.tracing import Tracing
18
21
  from .sdk.decorators.tracing import instrument
19
22
  from .sdk.tracing.conventions import Reference
20
23
  from .sdk.decorators.routing import entrypoint, app, route
21
- from .sdk.agenta_init import Config, AgentaSingleton, init
24
+ from .sdk.agenta_init import Config, AgentaSingleton, init as _init
22
25
  from .sdk.utils.costs import calculate_token_usage
23
26
  from .sdk.client import Agenta
24
27
  from .sdk.litellm import litellm as callbacks
25
- from .sdk.config_manager import ConfigManager
28
+ from .sdk.managers.config import ConfigManager
29
+ from .sdk.managers.variant import VariantManager
30
+ from .sdk.managers.deployment import DeploymentManager
26
31
  from .sdk import assets as assets
27
32
  from .sdk import tracer
28
33
 
29
34
  config = PreInitObject("agenta.config", Config)
30
35
  DEFAULT_AGENTA_SINGLETON_INSTANCE = AgentaSingleton()
31
- tracing = DEFAULT_AGENTA_SINGLETON_INSTANCE.tracing # type: ignore
36
+
37
+ types = client_types
38
+ tracing = None
39
+ api = None
40
+ async_api = None
41
+
42
+
43
+ def init(*args, **kwargs):
44
+ global api, async_api, tracing, config
45
+ _init(*args, **kwargs)
46
+
47
+ tracing = DEFAULT_AGENTA_SINGLETON_INSTANCE.tracing # type: ignore
48
+ api = DEFAULT_AGENTA_SINGLETON_INSTANCE.api # type: ignore
49
+ async_api = DEFAULT_AGENTA_SINGLETON_INSTANCE.async_api # type: ignore
@@ -9,6 +9,8 @@ from .types import (
9
9
  BaseOutput,
10
10
  BodyImportTestset,
11
11
  ConfigDb,
12
+ ConfigDto,
13
+ ConfigResponseModel,
12
14
  CorrectAnswer,
13
15
  CreateAppOutput,
14
16
  CreateSpan,
@@ -28,6 +30,8 @@ from .types import (
28
30
  EvaluationType,
29
31
  Evaluator,
30
32
  EvaluatorConfig,
33
+ EvaluatorMappingOutputInterface,
34
+ EvaluatorOutputInterface,
31
35
  GetConfigResponse,
32
36
  HttpValidationError,
33
37
  HumanEvaluation,
@@ -38,6 +42,7 @@ from .types import (
38
42
  HumanEvaluationUpdate,
39
43
  Image,
40
44
  InviteRequest,
45
+ LifecycleDto,
41
46
  ListApiKeysResponse,
42
47
  LlmRunRateLimit,
43
48
  LlmTokens,
@@ -48,6 +53,8 @@ from .types import (
48
53
  OrganizationOutput,
49
54
  Outputs,
50
55
  Permission,
56
+ ReferenceDto,
57
+ ReferenceRequestModel,
51
58
  Result,
52
59
  Score,
53
60
  SimpleEvaluationOutput,
@@ -102,6 +109,8 @@ __all__ = [
102
109
  "BaseOutput",
103
110
  "BodyImportTestset",
104
111
  "ConfigDb",
112
+ "ConfigDto",
113
+ "ConfigResponseModel",
105
114
  "ContainerTemplatesResponse",
106
115
  "CorrectAnswer",
107
116
  "CreateAppOutput",
@@ -122,6 +131,8 @@ __all__ = [
122
131
  "EvaluationType",
123
132
  "Evaluator",
124
133
  "EvaluatorConfig",
134
+ "EvaluatorMappingOutputInterface",
135
+ "EvaluatorOutputInterface",
125
136
  "GetConfigResponse",
126
137
  "HttpValidationError",
127
138
  "HumanEvaluation",
@@ -132,6 +143,7 @@ __all__ = [
132
143
  "HumanEvaluationUpdate",
133
144
  "Image",
134
145
  "InviteRequest",
146
+ "LifecycleDto",
135
147
  "ListApiKeysResponse",
136
148
  "LlmRunRateLimit",
137
149
  "LlmTokens",
@@ -142,6 +154,8 @@ __all__ = [
142
154
  "OrganizationOutput",
143
155
  "Outputs",
144
156
  "Permission",
157
+ "ReferenceDto",
158
+ "ReferenceRequestModel",
145
159
  "Result",
146
160
  "Score",
147
161
  "SimpleEvaluationOutput",
@@ -176,7 +176,6 @@ class AppsClient:
176
176
  self,
177
177
  *,
178
178
  app_name: typing.Optional[str] = None,
179
- org_id: typing.Optional[str] = None,
180
179
  workspace_id: typing.Optional[str] = None,
181
180
  request_options: typing.Optional[RequestOptions] = None,
182
181
  ) -> typing.List[App]:
@@ -198,8 +197,6 @@ class AppsClient:
198
197
  ----------
199
198
  app_name : typing.Optional[str]
200
199
 
201
- org_id : typing.Optional[str]
202
-
203
200
  workspace_id : typing.Optional[str]
204
201
 
205
202
  request_options : typing.Optional[RequestOptions]
@@ -225,7 +222,6 @@ class AppsClient:
225
222
  method="GET",
226
223
  params={
227
224
  "app_name": app_name,
228
- "org_id": org_id,
229
225
  "workspace_id": workspace_id,
230
226
  },
231
227
  request_options=request_options,
@@ -258,8 +254,9 @@ class AppsClient:
258
254
  self,
259
255
  *,
260
256
  app_name: str,
261
- organization_id: typing.Optional[str] = OMIT,
257
+ project_id: typing.Optional[str] = OMIT,
262
258
  workspace_id: typing.Optional[str] = OMIT,
259
+ organization_id: typing.Optional[str] = OMIT,
263
260
  request_options: typing.Optional[RequestOptions] = None,
264
261
  ) -> CreateAppOutput:
265
262
  """
@@ -279,10 +276,12 @@ class AppsClient:
279
276
  ----------
280
277
  app_name : str
281
278
 
282
- organization_id : typing.Optional[str]
279
+ project_id : typing.Optional[str]
283
280
 
284
281
  workspace_id : typing.Optional[str]
285
282
 
283
+ organization_id : typing.Optional[str]
284
+
286
285
  request_options : typing.Optional[RequestOptions]
287
286
  Request-specific configuration.
288
287
 
@@ -308,8 +307,9 @@ class AppsClient:
308
307
  method="POST",
309
308
  json={
310
309
  "app_name": app_name,
311
- "organization_id": organization_id,
310
+ "project_id": project_id,
312
311
  "workspace_id": workspace_id,
312
+ "organization_id": organization_id,
313
313
  },
314
314
  request_options=request_options,
315
315
  omit=OMIT,
@@ -586,8 +586,9 @@ class AppsClient:
586
586
  app_name: str,
587
587
  template_id: str,
588
588
  env_vars: typing.Dict[str, str],
589
- organization_id: typing.Optional[str] = OMIT,
589
+ project_id: typing.Optional[str] = OMIT,
590
590
  workspace_id: typing.Optional[str] = OMIT,
591
+ organization_id: typing.Optional[str] = OMIT,
591
592
  request_options: typing.Optional[RequestOptions] = None,
592
593
  ) -> AppVariantResponse:
593
594
  """
@@ -611,10 +612,12 @@ class AppsClient:
611
612
 
612
613
  env_vars : typing.Dict[str, str]
613
614
 
614
- organization_id : typing.Optional[str]
615
+ project_id : typing.Optional[str]
615
616
 
616
617
  workspace_id : typing.Optional[str]
617
618
 
619
+ organization_id : typing.Optional[str]
620
+
618
621
  request_options : typing.Optional[RequestOptions]
619
622
  Request-specific configuration.
620
623
 
@@ -643,9 +646,10 @@ class AppsClient:
643
646
  json={
644
647
  "app_name": app_name,
645
648
  "template_id": template_id,
649
+ "project_id": project_id,
650
+ "workspace_id": workspace_id,
646
651
  "env_vars": env_vars,
647
652
  "organization_id": organization_id,
648
- "workspace_id": workspace_id,
649
653
  },
650
654
  request_options=request_options,
651
655
  omit=OMIT,
@@ -976,7 +980,6 @@ class AsyncAppsClient:
976
980
  self,
977
981
  *,
978
982
  app_name: typing.Optional[str] = None,
979
- org_id: typing.Optional[str] = None,
980
983
  workspace_id: typing.Optional[str] = None,
981
984
  request_options: typing.Optional[RequestOptions] = None,
982
985
  ) -> typing.List[App]:
@@ -998,8 +1001,6 @@ class AsyncAppsClient:
998
1001
  ----------
999
1002
  app_name : typing.Optional[str]
1000
1003
 
1001
- org_id : typing.Optional[str]
1002
-
1003
1004
  workspace_id : typing.Optional[str]
1004
1005
 
1005
1006
  request_options : typing.Optional[RequestOptions]
@@ -1033,7 +1034,6 @@ class AsyncAppsClient:
1033
1034
  method="GET",
1034
1035
  params={
1035
1036
  "app_name": app_name,
1036
- "org_id": org_id,
1037
1037
  "workspace_id": workspace_id,
1038
1038
  },
1039
1039
  request_options=request_options,
@@ -1066,8 +1066,9 @@ class AsyncAppsClient:
1066
1066
  self,
1067
1067
  *,
1068
1068
  app_name: str,
1069
- organization_id: typing.Optional[str] = OMIT,
1069
+ project_id: typing.Optional[str] = OMIT,
1070
1070
  workspace_id: typing.Optional[str] = OMIT,
1071
+ organization_id: typing.Optional[str] = OMIT,
1071
1072
  request_options: typing.Optional[RequestOptions] = None,
1072
1073
  ) -> CreateAppOutput:
1073
1074
  """
@@ -1087,10 +1088,12 @@ class AsyncAppsClient:
1087
1088
  ----------
1088
1089
  app_name : str
1089
1090
 
1090
- organization_id : typing.Optional[str]
1091
+ project_id : typing.Optional[str]
1091
1092
 
1092
1093
  workspace_id : typing.Optional[str]
1093
1094
 
1095
+ organization_id : typing.Optional[str]
1096
+
1094
1097
  request_options : typing.Optional[RequestOptions]
1095
1098
  Request-specific configuration.
1096
1099
 
@@ -1124,8 +1127,9 @@ class AsyncAppsClient:
1124
1127
  method="POST",
1125
1128
  json={
1126
1129
  "app_name": app_name,
1127
- "organization_id": organization_id,
1130
+ "project_id": project_id,
1128
1131
  "workspace_id": workspace_id,
1132
+ "organization_id": organization_id,
1129
1133
  },
1130
1134
  request_options=request_options,
1131
1135
  omit=OMIT,
@@ -1426,8 +1430,9 @@ class AsyncAppsClient:
1426
1430
  app_name: str,
1427
1431
  template_id: str,
1428
1432
  env_vars: typing.Dict[str, str],
1429
- organization_id: typing.Optional[str] = OMIT,
1433
+ project_id: typing.Optional[str] = OMIT,
1430
1434
  workspace_id: typing.Optional[str] = OMIT,
1435
+ organization_id: typing.Optional[str] = OMIT,
1431
1436
  request_options: typing.Optional[RequestOptions] = None,
1432
1437
  ) -> AppVariantResponse:
1433
1438
  """
@@ -1451,10 +1456,12 @@ class AsyncAppsClient:
1451
1456
 
1452
1457
  env_vars : typing.Dict[str, str]
1453
1458
 
1454
- organization_id : typing.Optional[str]
1459
+ project_id : typing.Optional[str]
1455
1460
 
1456
1461
  workspace_id : typing.Optional[str]
1457
1462
 
1463
+ organization_id : typing.Optional[str]
1464
+
1458
1465
  request_options : typing.Optional[RequestOptions]
1459
1466
  Request-specific configuration.
1460
1467
 
@@ -1491,9 +1498,10 @@ class AsyncAppsClient:
1491
1498
  json={
1492
1499
  "app_name": app_name,
1493
1500
  "template_id": template_id,
1501
+ "project_id": project_id,
1502
+ "workspace_id": workspace_id,
1494
1503
  "env_vars": env_vars,
1495
1504
  "organization_id": organization_id,
1496
- "workspace_id": workspace_id,
1497
1505
  },
1498
1506
  request_options=request_options,
1499
1507
  omit=OMIT,
@@ -24,6 +24,7 @@ from .core.jsonable_encoder import jsonable_encoder
24
24
  from .types.organization import Organization
25
25
  from .types.organization_output import OrganizationOutput
26
26
  from .types.invite_request import InviteRequest
27
+ from .core.serialization import convert_and_respect_annotation_metadata
27
28
  from .types.workspace_response import WorkspaceResponse
28
29
  import datetime as dt
29
30
  from .types.workspace_role_response import WorkspaceRoleResponse
@@ -732,7 +733,11 @@ class AgentaApi:
732
733
  _response = self._client_wrapper.httpx_client.request(
733
734
  f"organizations/{jsonable_encoder(org_id)}/workspaces/{jsonable_encoder(workspace_id)}/invite",
734
735
  method="POST",
735
- json=request,
736
+ json=convert_and_respect_annotation_metadata(
737
+ object_=request,
738
+ annotation=typing.Sequence[InviteRequest],
739
+ direction="write",
740
+ ),
736
741
  request_options=request_options,
737
742
  omit=OMIT,
738
743
  )
@@ -847,6 +852,7 @@ class AgentaApi:
847
852
  org_id: str,
848
853
  workspace_id: str,
849
854
  *,
855
+ project_id: str,
850
856
  token: str,
851
857
  request_options: typing.Optional[RequestOptions] = None,
852
858
  ) -> typing.Optional[typing.Any]:
@@ -867,6 +873,8 @@ class AgentaApi:
867
873
 
868
874
  workspace_id : str
869
875
 
876
+ project_id : str
877
+
870
878
  token : str
871
879
 
872
880
  request_options : typing.Optional[RequestOptions]
@@ -888,12 +896,16 @@ class AgentaApi:
888
896
  client.accept_invitation(
889
897
  org_id="org_id",
890
898
  workspace_id="workspace_id",
899
+ project_id="project_id",
891
900
  token="token",
892
901
  )
893
902
  """
894
903
  _response = self._client_wrapper.httpx_client.request(
895
904
  f"organizations/{jsonable_encoder(org_id)}/workspaces/{jsonable_encoder(workspace_id)}/invite/accept",
896
905
  method="POST",
906
+ params={
907
+ "project_id": project_id,
908
+ },
897
909
  json={
898
910
  "token": token,
899
911
  },
@@ -2333,7 +2345,11 @@ class AsyncAgentaApi:
2333
2345
  _response = await self._client_wrapper.httpx_client.request(
2334
2346
  f"organizations/{jsonable_encoder(org_id)}/workspaces/{jsonable_encoder(workspace_id)}/invite",
2335
2347
  method="POST",
2336
- json=request,
2348
+ json=convert_and_respect_annotation_metadata(
2349
+ object_=request,
2350
+ annotation=typing.Sequence[InviteRequest],
2351
+ direction="write",
2352
+ ),
2337
2353
  request_options=request_options,
2338
2354
  omit=OMIT,
2339
2355
  )
@@ -2456,6 +2472,7 @@ class AsyncAgentaApi:
2456
2472
  org_id: str,
2457
2473
  workspace_id: str,
2458
2474
  *,
2475
+ project_id: str,
2459
2476
  token: str,
2460
2477
  request_options: typing.Optional[RequestOptions] = None,
2461
2478
  ) -> typing.Optional[typing.Any]:
@@ -2476,6 +2493,8 @@ class AsyncAgentaApi:
2476
2493
 
2477
2494
  workspace_id : str
2478
2495
 
2496
+ project_id : str
2497
+
2479
2498
  token : str
2480
2499
 
2481
2500
  request_options : typing.Optional[RequestOptions]
@@ -2502,6 +2521,7 @@ class AsyncAgentaApi:
2502
2521
  await client.accept_invitation(
2503
2522
  org_id="org_id",
2504
2523
  workspace_id="workspace_id",
2524
+ project_id="project_id",
2505
2525
  token="token",
2506
2526
  )
2507
2527
 
@@ -2511,6 +2531,9 @@ class AsyncAgentaApi:
2511
2531
  _response = await self._client_wrapper.httpx_client.request(
2512
2532
  f"organizations/{jsonable_encoder(org_id)}/workspaces/{jsonable_encoder(workspace_id)}/invite/accept",
2513
2533
  method="POST",
2534
+ params={
2535
+ "project_id": project_id,
2536
+ },
2514
2537
  json={
2515
2538
  "token": token,
2516
2539
  },
@@ -387,7 +387,11 @@ class AsyncContainersClient:
387
387
  files={
388
388
  "tar_file": tar_file,
389
389
  },
390
- request_options=request_options,
390
+ request_options=(
391
+ {**request_options, "timeout_in_seconds": 600}
392
+ if request_options
393
+ else {"timeout_in_seconds": 600}
394
+ ),
391
395
  omit=OMIT,
392
396
  )
393
397
  try:
@@ -3,7 +3,7 @@
3
3
  from .api_error import ApiError
4
4
  from .client_wrapper import AsyncClientWrapper, BaseClientWrapper, SyncClientWrapper
5
5
  from .datetime_utils import serialize_datetime
6
- from .file import File, convert_file_dict_to_httpx_tuples
6
+ from .file import File, convert_file_dict_to_httpx_tuples, with_content_type
7
7
  from .http_client import AsyncHttpClient, HttpClient
8
8
  from .jsonable_encoder import jsonable_encoder
9
9
  from .pydantic_utilities import (
@@ -43,4 +43,5 @@ __all__ = [
43
43
  "universal_field_validator",
44
44
  "universal_root_validator",
45
45
  "update_forward_refs",
46
+ "with_content_type",
46
47
  ]
@@ -40,9 +40,9 @@ class SyncClientWrapper(BaseClientWrapper):
40
40
  super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
41
41
  self.httpx_client = HttpClient(
42
42
  httpx_client=httpx_client,
43
- base_headers=self.get_headers(),
44
- base_timeout=self.get_timeout(),
45
- base_url=self.get_base_url(),
43
+ base_headers=self.get_headers,
44
+ base_timeout=self.get_timeout,
45
+ base_url=self.get_base_url,
46
46
  )
47
47
 
48
48
 
@@ -58,7 +58,7 @@ class AsyncClientWrapper(BaseClientWrapper):
58
58
  super().__init__(api_key=api_key, base_url=base_url, timeout=timeout)
59
59
  self.httpx_client = AsyncHttpClient(
60
60
  httpx_client=httpx_client,
61
- base_headers=self.get_headers(),
62
- base_timeout=self.get_timeout(),
63
- base_url=self.get_base_url(),
61
+ base_headers=self.get_headers,
62
+ base_timeout=self.get_timeout,
63
+ base_url=self.get_base_url,
64
64
  )
@@ -0,0 +1,65 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from typing import IO, Dict, List, Mapping, Optional, Tuple, Union, cast
4
+
5
+ # File typing inspired by the flexibility of types within the httpx library
6
+ # https://github.com/encode/httpx/blob/master/httpx/_types.py
7
+ FileContent = Union[IO[bytes], bytes, str]
8
+ File = Union[
9
+ # file (or bytes)
10
+ FileContent,
11
+ # (filename, file (or bytes))
12
+ Tuple[Optional[str], FileContent],
13
+ # (filename, file (or bytes), content_type)
14
+ Tuple[Optional[str], FileContent, Optional[str]],
15
+ # (filename, file (or bytes), content_type, headers)
16
+ Tuple[
17
+ Optional[str],
18
+ FileContent,
19
+ Optional[str],
20
+ Mapping[str, str],
21
+ ],
22
+ ]
23
+
24
+
25
+ def convert_file_dict_to_httpx_tuples(
26
+ d: Dict[str, Union[File, List[File]]],
27
+ ) -> List[Tuple[str, File]]:
28
+ """
29
+ The format we use is a list of tuples, where the first element is the
30
+ name of the file and the second is the file object. Typically HTTPX wants
31
+ a dict, but to be able to send lists of files, you have to use the list
32
+ approach (which also works for non-lists)
33
+ https://github.com/encode/httpx/pull/1032
34
+ """
35
+
36
+ httpx_tuples = []
37
+ for key, file_like in d.items():
38
+ if isinstance(file_like, list):
39
+ for file_like_item in file_like:
40
+ httpx_tuples.append((key, file_like_item))
41
+ else:
42
+ httpx_tuples.append((key, file_like))
43
+ return httpx_tuples
44
+
45
+
46
+ def with_content_type(*, file: File, content_type: str) -> File:
47
+ """ """
48
+ if isinstance(file, tuple):
49
+ if len(file) == 2:
50
+ filename, content = cast(Tuple[Optional[str], FileContent], file) # type: ignore
51
+ return (filename, content, content_type)
52
+ elif len(file) == 3:
53
+ filename, content, _ = cast(
54
+ Tuple[Optional[str], FileContent, Optional[str]], file
55
+ ) # type: ignore
56
+ return (filename, content, content_type)
57
+ elif len(file) == 4:
58
+ filename, content, _, headers = cast( # type: ignore
59
+ Tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]],
60
+ file,
61
+ )
62
+ return (filename, content, content_type, headers)
63
+ else:
64
+ raise ValueError(f"Unexpected tuple length: {len(file)}")
65
+ return (None, file, content_type)
@@ -158,9 +158,9 @@ class HttpClient:
158
158
  self,
159
159
  *,
160
160
  httpx_client: httpx.Client,
161
- base_timeout: typing.Optional[float],
162
- base_headers: typing.Dict[str, str],
163
- base_url: typing.Optional[str] = None,
161
+ base_timeout: typing.Callable[[], typing.Optional[float]],
162
+ base_headers: typing.Callable[[], typing.Dict[str, str]],
163
+ base_url: typing.Optional[typing.Callable[[], str]] = None,
164
164
  ):
165
165
  self.base_url = base_url
166
166
  self.base_timeout = base_timeout
@@ -168,7 +168,10 @@ class HttpClient:
168
168
  self.httpx_client = httpx_client
169
169
 
170
170
  def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
171
- base_url = self.base_url if maybe_base_url is None else maybe_base_url
171
+ base_url = maybe_base_url
172
+ if self.base_url is not None and base_url is None:
173
+ base_url = self.base_url()
174
+
172
175
  if base_url is None:
173
176
  raise ValueError(
174
177
  "A base_url is required to make this request, please provide one and try again."
@@ -200,7 +203,7 @@ class HttpClient:
200
203
  request_options.get("timeout_in_seconds")
201
204
  if request_options is not None
202
205
  and request_options.get("timeout_in_seconds") is not None
203
- else self.base_timeout
206
+ else self.base_timeout()
204
207
  )
205
208
 
206
209
  json_body, data_body = get_request_body(
@@ -213,7 +216,7 @@ class HttpClient:
213
216
  headers=jsonable_encoder(
214
217
  remove_none_from_dict(
215
218
  {
216
- **self.base_headers,
219
+ **self.base_headers(),
217
220
  **(headers if headers is not None else {}),
218
221
  **(
219
222
  request_options.get("additional_headers", {}) or {}
@@ -248,7 +251,7 @@ class HttpClient:
248
251
  content=content,
249
252
  files=(
250
253
  convert_file_dict_to_httpx_tuples(remove_none_from_dict(files))
251
- if files is not None
254
+ if (files is not None and files is not omit)
252
255
  else None
253
256
  ),
254
257
  timeout=timeout,
@@ -302,7 +305,7 @@ class HttpClient:
302
305
  request_options.get("timeout_in_seconds")
303
306
  if request_options is not None
304
307
  and request_options.get("timeout_in_seconds") is not None
305
- else self.base_timeout
308
+ else self.base_timeout()
306
309
  )
307
310
 
308
311
  json_body, data_body = get_request_body(
@@ -315,7 +318,7 @@ class HttpClient:
315
318
  headers=jsonable_encoder(
316
319
  remove_none_from_dict(
317
320
  {
318
- **self.base_headers,
321
+ **self.base_headers(),
319
322
  **(headers if headers is not None else {}),
320
323
  **(
321
324
  request_options.get("additional_headers", {})
@@ -349,7 +352,7 @@ class HttpClient:
349
352
  content=content,
350
353
  files=(
351
354
  convert_file_dict_to_httpx_tuples(remove_none_from_dict(files))
352
- if files is not None
355
+ if (files is not None and files is not omit)
353
356
  else None
354
357
  ),
355
358
  timeout=timeout,
@@ -362,9 +365,9 @@ class AsyncHttpClient:
362
365
  self,
363
366
  *,
364
367
  httpx_client: httpx.AsyncClient,
365
- base_timeout: typing.Optional[float],
366
- base_headers: typing.Dict[str, str],
367
- base_url: typing.Optional[str] = None,
368
+ base_timeout: typing.Callable[[], typing.Optional[float]],
369
+ base_headers: typing.Callable[[], typing.Dict[str, str]],
370
+ base_url: typing.Optional[typing.Callable[[], str]] = None,
368
371
  ):
369
372
  self.base_url = base_url
370
373
  self.base_timeout = base_timeout
@@ -372,7 +375,10 @@ class AsyncHttpClient:
372
375
  self.httpx_client = httpx_client
373
376
 
374
377
  def get_base_url(self, maybe_base_url: typing.Optional[str]) -> str:
375
- base_url = self.base_url if maybe_base_url is None else maybe_base_url
378
+ base_url = maybe_base_url
379
+ if self.base_url is not None and base_url is None:
380
+ base_url = self.base_url()
381
+
376
382
  if base_url is None:
377
383
  raise ValueError(
378
384
  "A base_url is required to make this request, please provide one and try again."
@@ -404,7 +410,7 @@ class AsyncHttpClient:
404
410
  request_options.get("timeout_in_seconds")
405
411
  if request_options is not None
406
412
  and request_options.get("timeout_in_seconds") is not None
407
- else self.base_timeout
413
+ else self.base_timeout()
408
414
  )
409
415
 
410
416
  json_body, data_body = get_request_body(
@@ -418,7 +424,7 @@ class AsyncHttpClient:
418
424
  headers=jsonable_encoder(
419
425
  remove_none_from_dict(
420
426
  {
421
- **self.base_headers,
427
+ **self.base_headers(),
422
428
  **(headers if headers is not None else {}),
423
429
  **(
424
430
  request_options.get("additional_headers", {}) or {}
@@ -506,7 +512,7 @@ class AsyncHttpClient:
506
512
  request_options.get("timeout_in_seconds")
507
513
  if request_options is not None
508
514
  and request_options.get("timeout_in_seconds") is not None
509
- else self.base_timeout
515
+ else self.base_timeout()
510
516
  )
511
517
 
512
518
  json_body, data_body = get_request_body(
@@ -519,7 +525,7 @@ class AsyncHttpClient:
519
525
  headers=jsonable_encoder(
520
526
  remove_none_from_dict(
521
527
  {
522
- **self.base_headers,
528
+ **self.base_headers(),
523
529
  **(headers if headers is not None else {}),
524
530
  **(
525
531
  request_options.get("additional_headers", {})