agenta 0.27.5__tar.gz → 0.27.5a1__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 (198) hide show
  1. {agenta-0.27.5 → agenta-0.27.5a1}/PKG-INFO +1 -4
  2. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/__init__.py +29 -6
  3. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/__init__.py +8 -4
  4. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/agenta_init.py +10 -3
  5. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/decorators/tracing.py +31 -7
  6. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/litellm/litellm.py +36 -25
  7. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/middleware/auth.py +14 -8
  8. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/tracing.py +7 -1
  9. {agenta-0.27.5 → agenta-0.27.5a1}/pyproject.toml +1 -4
  10. {agenta-0.27.5 → agenta-0.27.5a1}/README.md +0 -0
  11. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/cli/evaluation_commands.py +0 -0
  12. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/cli/helper.py +0 -0
  13. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/cli/main.py +0 -0
  14. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/cli/telemetry.py +0 -0
  15. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/cli/variant_commands.py +0 -0
  16. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/cli/variant_configs.py +0 -0
  17. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/Readme.md +0 -0
  18. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/__init__.py +0 -0
  19. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/api.py +0 -0
  20. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/api_models.py +0 -0
  21. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/__init__.py +0 -0
  22. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/apps/__init__.py +0 -0
  23. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/apps/client.py +0 -0
  24. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/bases/__init__.py +0 -0
  25. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/bases/client.py +0 -0
  26. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/client.py +0 -0
  27. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/configs/__init__.py +0 -0
  28. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/configs/client.py +0 -0
  29. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/containers/__init__.py +0 -0
  30. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/containers/client.py +0 -0
  31. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/containers/types/__init__.py +0 -0
  32. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/containers/types/container_templates_response.py +0 -0
  33. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/__init__.py +0 -0
  34. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/api_error.py +0 -0
  35. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/client_wrapper.py +0 -0
  36. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/datetime_utils.py +0 -0
  37. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/file.py +0 -0
  38. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/http_client.py +0 -0
  39. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/jsonable_encoder.py +0 -0
  40. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/pydantic_utilities.py +0 -0
  41. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/query_encoder.py +0 -0
  42. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/remove_none_from_dict.py +0 -0
  43. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/request_options.py +0 -0
  44. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/core/serialization.py +0 -0
  45. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/environments/__init__.py +0 -0
  46. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/environments/client.py +0 -0
  47. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/errors/__init__.py +0 -0
  48. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/errors/unprocessable_entity_error.py +0 -0
  49. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/evaluations/__init__.py +0 -0
  50. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/evaluations/client.py +0 -0
  51. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/evaluators/__init__.py +0 -0
  52. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/evaluators/client.py +0 -0
  53. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/observability/__init__.py +0 -0
  54. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/observability/client.py +0 -0
  55. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/testsets/__init__.py +0 -0
  56. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/testsets/client.py +0 -0
  57. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/__init__.py +0 -0
  58. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/aggregated_result.py +0 -0
  59. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/aggregated_result_evaluator_config.py +0 -0
  60. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/app.py +0 -0
  61. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/app_variant_response.py +0 -0
  62. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/app_variant_revision.py +0 -0
  63. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/base_output.py +0 -0
  64. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/body_import_testset.py +0 -0
  65. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/config_db.py +0 -0
  66. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/config_dto.py +0 -0
  67. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/config_response_model.py +0 -0
  68. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/correct_answer.py +0 -0
  69. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/create_app_output.py +0 -0
  70. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/create_span.py +0 -0
  71. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/create_trace_response.py +0 -0
  72. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/docker_env_vars.py +0 -0
  73. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/environment_output.py +0 -0
  74. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/environment_output_extended.py +0 -0
  75. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/environment_revision.py +0 -0
  76. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/error.py +0 -0
  77. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation.py +0 -0
  78. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_scenario.py +0 -0
  79. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_scenario_input.py +0 -0
  80. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_scenario_output.py +0 -0
  81. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_scenario_result.py +0 -0
  82. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_scenario_score_update.py +0 -0
  83. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_status_enum.py +0 -0
  84. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluation_type.py +0 -0
  85. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluator.py +0 -0
  86. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluator_config.py +0 -0
  87. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluator_mapping_output_interface.py +0 -0
  88. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/evaluator_output_interface.py +0 -0
  89. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/get_config_response.py +0 -0
  90. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/http_validation_error.py +0 -0
  91. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/human_evaluation.py +0 -0
  92. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/human_evaluation_scenario.py +0 -0
  93. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/human_evaluation_scenario_input.py +0 -0
  94. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/human_evaluation_scenario_output.py +0 -0
  95. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/human_evaluation_scenario_update.py +0 -0
  96. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/human_evaluation_update.py +0 -0
  97. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/image.py +0 -0
  98. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/invite_request.py +0 -0
  99. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/lifecycle_dto.py +0 -0
  100. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/list_api_keys_response.py +0 -0
  101. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/llm_run_rate_limit.py +0 -0
  102. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/llm_tokens.py +0 -0
  103. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/lm_providers_enum.py +0 -0
  104. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/new_human_evaluation.py +0 -0
  105. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/new_testset.py +0 -0
  106. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/organization.py +0 -0
  107. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/organization_output.py +0 -0
  108. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/outputs.py +0 -0
  109. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/permission.py +0 -0
  110. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/reference_dto.py +0 -0
  111. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/reference_request_model.py +0 -0
  112. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/result.py +0 -0
  113. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/score.py +0 -0
  114. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/simple_evaluation_output.py +0 -0
  115. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/span.py +0 -0
  116. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/span_detail.py +0 -0
  117. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/span_status_code.py +0 -0
  118. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/span_variant.py +0 -0
  119. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/template.py +0 -0
  120. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/template_image_info.py +0 -0
  121. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/test_set_output_response.py +0 -0
  122. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/test_set_simple_response.py +0 -0
  123. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/trace_detail.py +0 -0
  124. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/update_app_output.py +0 -0
  125. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/uri.py +0 -0
  126. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/validation_error.py +0 -0
  127. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/validation_error_loc_item.py +0 -0
  128. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/variant_action.py +0 -0
  129. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/variant_action_enum.py +0 -0
  130. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/with_pagination.py +0 -0
  131. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/workspace_member_response.py +0 -0
  132. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/workspace_permission.py +0 -0
  133. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/workspace_response.py +0 -0
  134. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/workspace_role.py +0 -0
  135. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/types/workspace_role_response.py +0 -0
  136. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/variants/__init__.py +0 -0
  137. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/variants/client.py +0 -0
  138. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/variants/types/__init__.py +0 -0
  139. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +0 -0
  140. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/client.py +0 -0
  141. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/client/exceptions.py +0 -0
  142. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/config.py +0 -0
  143. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/config.toml +0 -0
  144. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker-assets/Dockerfile.cloud.template +0 -0
  145. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker-assets/Dockerfile.template +0 -0
  146. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker-assets/README.md +0 -0
  147. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker-assets/entrypoint.sh +0 -0
  148. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker-assets/lambda_function.py +0 -0
  149. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker-assets/main.py +0 -0
  150. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/docker/docker_utils.py +0 -0
  151. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/assets.py +0 -0
  152. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/client.py +0 -0
  153. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/context/__init__.py +0 -0
  154. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/context/routing.py +0 -0
  155. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/context/tracing.py +0 -0
  156. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/decorators/__init__.py +0 -0
  157. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/decorators/routing.py +0 -0
  158. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/litellm/__init__.py +0 -0
  159. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/managers/__init__.py +0 -0
  160. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/managers/config.py +0 -0
  161. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/managers/deployment.py +0 -0
  162. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/managers/shared.py +0 -0
  163. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/managers/variant.py +0 -0
  164. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/middleware/__init__.py +0 -0
  165. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/middleware/cache.py +0 -0
  166. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/router.py +0 -0
  167. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/__init__.py +0 -0
  168. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/attributes.py +0 -0
  169. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/context.py +0 -0
  170. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/conventions.py +0 -0
  171. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/exporters.py +0 -0
  172. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/inline.py +0 -0
  173. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/processors.py +0 -0
  174. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/tracing/spans.py +0 -0
  175. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/types.py +0 -0
  176. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/__init__.py +0 -0
  177. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/costs.py +0 -0
  178. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/debug.py +0 -0
  179. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/exceptions.py +0 -0
  180. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/globals.py +0 -0
  181. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/logging.py +0 -0
  182. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/preinit.py +0 -0
  183. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/sdk/utils/singleton.py +0 -0
  184. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/compose_email/README.md +0 -0
  185. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/compose_email/app.py +0 -0
  186. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/compose_email/env.example +0 -0
  187. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/compose_email/requirements.txt +0 -0
  188. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/compose_email/template.toml +0 -0
  189. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/extract_data_to_json/README.md +0 -0
  190. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/extract_data_to_json/app.py +0 -0
  191. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/extract_data_to_json/env.example +0 -0
  192. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/extract_data_to_json/requirements.txt +0 -0
  193. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/extract_data_to_json/template.toml +0 -0
  194. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/simple_prompt/README.md +0 -0
  195. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/simple_prompt/app.py +0 -0
  196. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/simple_prompt/env.example +0 -0
  197. {agenta-0.27.5 → agenta-0.27.5a1}/agenta/templates/simple_prompt/requirements.txt +0 -0
  198. {agenta-0.27.5 → agenta-0.27.5a1}/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.5
3
+ Version: 0.27.5a1
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
@@ -22,16 +22,13 @@ Requires-Dist: docker (>=6.1.1,<8.0.0)
22
22
  Requires-Dist: fastapi (>=0.100.0)
23
23
  Requires-Dist: httpx (>=0.24,<0.28)
24
24
  Requires-Dist: importlib-metadata (>=8.0.0,<9.0)
25
- Requires-Dist: ipdb (>=0.13)
26
25
  Requires-Dist: litellm (>=1.48.0,<2.0.0)
27
26
  Requires-Dist: opentelemetry-api (>=1.27.0,<2.0.0)
28
27
  Requires-Dist: opentelemetry-exporter-otlp (>=1.27.0,<2.0.0)
29
28
  Requires-Dist: opentelemetry-sdk (>=1.27.0,<2.0.0)
30
29
  Requires-Dist: posthog (>=3.1.0,<4.0.0)
31
30
  Requires-Dist: pydantic (>=2)
32
- Requires-Dist: pymongo (>=4.6.3,<5.0.0)
33
31
  Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
34
- Requires-Dist: python-multipart (>=0.0.6,<0.0.10)
35
32
  Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
36
33
  Requires-Dist: questionary (>=1.10,<3.0)
37
34
  Requires-Dist: toml (>=0.10.2,<0.11.0)
@@ -1,3 +1,5 @@
1
+ from typing import Any, Callable, Optional
2
+
1
3
  from .sdk.utils.preinit import PreInitObject
2
4
 
3
5
  import agenta.client.backend.types as client_types # pylint: disable=wrong-import-order
@@ -18,7 +20,7 @@ from .sdk.types import (
18
20
  )
19
21
 
20
22
  from .sdk.utils.logging import log as logging
21
- from .sdk.tracing import Tracing
23
+ from .sdk.tracing import Tracing, get_tracer
22
24
  from .sdk.decorators.tracing import instrument
23
25
  from .sdk.tracing.conventions import Reference
24
26
  from .sdk.decorators.routing import entrypoint, app, route
@@ -36,15 +38,36 @@ config = PreInitObject("agenta.config", Config)
36
38
  DEFAULT_AGENTA_SINGLETON_INSTANCE = AgentaSingleton()
37
39
 
38
40
  types = client_types
39
- tracing = None
41
+
40
42
  api = None
41
43
  async_api = None
42
44
 
45
+ tracing = DEFAULT_AGENTA_SINGLETON_INSTANCE.tracing # type: ignore
46
+ tracer = get_tracer(tracing)
43
47
 
44
- def init(*args, **kwargs):
45
- global api, async_api, tracing, config
46
- _init(*args, **kwargs)
47
48
 
48
- tracing = DEFAULT_AGENTA_SINGLETON_INSTANCE.tracing # type: ignore
49
+ def init(
50
+ host: Optional[str] = None,
51
+ api_key: Optional[str] = None,
52
+ config_fname: Optional[str] = None,
53
+ redact: Optional[Callable[..., Any]] = None,
54
+ redact_on_error: Optional[bool] = True,
55
+ # DEPRECATING
56
+ app_id: Optional[str] = None,
57
+ ):
58
+ global api, async_api, tracing, tracer # pylint: disable=global-statement
59
+
60
+ _init(
61
+ host=host,
62
+ api_key=api_key,
63
+ config_fname=config_fname,
64
+ redact=redact,
65
+ redact_on_error=redact_on_error,
66
+ app_id=app_id,
67
+ )
68
+
49
69
  api = DEFAULT_AGENTA_SINGLETON_INSTANCE.api # type: ignore
50
70
  async_api = DEFAULT_AGENTA_SINGLETON_INSTANCE.async_api # type: ignore
71
+
72
+ tracing = DEFAULT_AGENTA_SINGLETON_INSTANCE.tracing # type: ignore
73
+ tracer = get_tracer(tracing)
@@ -1,4 +1,4 @@
1
- from typing import Optional
1
+ from typing import Optional, Callable, Any
2
2
 
3
3
  from .utils.preinit import PreInitObject # always the first import!
4
4
 
@@ -43,17 +43,21 @@ tracer = get_tracer(tracing)
43
43
 
44
44
  def init(
45
45
  host: Optional[str] = None,
46
- app_id: Optional[str] = None,
47
46
  api_key: Optional[str] = None,
48
47
  config_fname: Optional[str] = None,
48
+ redact: Optional[Callable[..., Any]] = None,
49
+ redact_on_error: Optional[bool] = True,
50
+ # DEPRECATING
51
+ app_id: Optional[str] = None,
49
52
  ):
50
- global api, async_api, tracing, tracer
53
+ global api, async_api, tracing, tracer # pylint: disable=global-statement
51
54
 
52
55
  _init(
53
56
  host=host,
54
57
  api_key=api_key,
55
58
  config_fname=config_fname,
56
- # DEPRECATING
59
+ redact=redact,
60
+ redact_on_error=redact_on_error,
57
61
  app_id=app_id,
58
62
  )
59
63
 
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
  import toml
3
3
  from os import getenv
4
- from typing import Optional
4
+ from typing import Optional, Callable, Any
5
5
  from importlib.metadata import version
6
6
 
7
7
  from agenta.sdk.utils.logging import log
@@ -36,6 +36,8 @@ class AgentaSingleton:
36
36
  host: Optional[str] = None,
37
37
  api_key: Optional[str] = None,
38
38
  config_fname: Optional[str] = None,
39
+ redact: Optional[Callable[..., Any]] = None,
40
+ redact_on_error: Optional[bool] = True,
39
41
  # DEPRECATING
40
42
  app_id: Optional[str] = None,
41
43
  ) -> None:
@@ -91,6 +93,8 @@ class AgentaSingleton:
91
93
 
92
94
  self.tracing = Tracing(
93
95
  url=f"{self.host}/api/observability/v1/otlp/traces", # type: ignore
96
+ redact=redact,
97
+ redact_on_error=redact_on_error,
94
98
  )
95
99
 
96
100
  self.tracing.configure(
@@ -258,7 +262,9 @@ def init(
258
262
  host: Optional[str] = None,
259
263
  api_key: Optional[str] = None,
260
264
  config_fname: Optional[str] = None,
261
- # DEPRECATED
265
+ redact: Optional[Callable[..., Any]] = None,
266
+ redact_on_error: Optional[bool] = True,
267
+ # DEPRECATING
262
268
  app_id: Optional[str] = None,
263
269
  ):
264
270
  """Main function to initialize the agenta sdk.
@@ -289,7 +295,8 @@ def init(
289
295
  host=host,
290
296
  api_key=api_key,
291
297
  config_fname=config_fname,
292
- # DEPRECATED
298
+ redact=redact,
299
+ redact_on_error=redact_on_error,
293
300
  app_id=app_id,
294
301
  )
295
302
 
@@ -19,6 +19,8 @@ class instrument: # pylint: disable=invalid-name
19
19
  config: Optional[Dict[str, Any]] = None,
20
20
  ignore_inputs: Optional[bool] = None,
21
21
  ignore_outputs: Optional[bool] = None,
22
+ redact: Optional[Callable[..., Any]] = None,
23
+ redact_on_error: Optional[bool] = True,
22
24
  max_depth: Optional[int] = 2,
23
25
  # DEPRECATING
24
26
  kind: str = "task",
@@ -29,6 +31,8 @@ class instrument: # pylint: disable=invalid-name
29
31
  self.config = config
30
32
  self.ignore_inputs = ignore_inputs
31
33
  self.ignore_outputs = ignore_outputs
34
+ self.redact = redact
35
+ self.redact_on_error = redact_on_error
32
36
  self.max_depth = max_depth
33
37
 
34
38
  def __call__(self, func: Callable[..., Any]):
@@ -109,12 +113,10 @@ class instrument: # pylint: disable=invalid-name
109
113
  )
110
114
 
111
115
  _inputs = self._redact(
112
- self._parse(
113
- func,
114
- *args,
115
- **kwargs,
116
- ),
117
- self.ignore_inputs,
116
+ name=span.name,
117
+ field="inputs",
118
+ io=self._parse(func, *args, **kwargs),
119
+ ignore=self.ignore_inputs,
118
120
  )
119
121
  span.set_attributes(
120
122
  attributes={"inputs": _inputs},
@@ -153,7 +155,12 @@ class instrument: # pylint: disable=invalid-name
153
155
  namespace="metrics.unit.tokens",
154
156
  )
155
157
 
156
- _outputs = self._redact(self._patch(result), self.ignore_outputs)
158
+ _outputs = self._redact(
159
+ name=span.name,
160
+ field="outputs",
161
+ io=self._patch(result),
162
+ ignore=self.ignore_outputs,
163
+ )
157
164
  span.set_attributes(
158
165
  attributes={"outputs": _outputs},
159
166
  namespace="data",
@@ -192,6 +199,9 @@ class instrument: # pylint: disable=invalid-name
192
199
 
193
200
  def _redact(
194
201
  self,
202
+ *,
203
+ name: str,
204
+ field: str,
195
205
  io: Dict[str, Any],
196
206
  ignore: Union[List[str], bool] = False,
197
207
  ) -> Dict[str, Any]:
@@ -220,6 +230,20 @@ class instrument: # pylint: disable=invalid-name
220
230
  )
221
231
  }
222
232
 
233
+ if self.redact is not None:
234
+ try:
235
+ io = self.redact(name, field, io)
236
+ except: # pylint: disable=bare-except
237
+ if self.redact_on_error:
238
+ io = {}
239
+
240
+ if ag.tracing.redact is not None:
241
+ try:
242
+ io = ag.tracing.redact(name, field, io)
243
+ except: # pylint: disable=bare-except
244
+ if ag.tracing.redact_on_error:
245
+ io = {}
246
+
223
247
  return io
224
248
 
225
249
  def _patch(
@@ -89,16 +89,20 @@ def litellm_handler():
89
89
  log.error("LiteLLM callback error: span not found.")
90
90
  return
91
91
 
92
- result = kwargs.get("complete_streaming_response")
92
+ try:
93
+ result = []
94
+ for choice in response_obj.choices:
95
+ message = choice.message.__dict__
96
+ result.append(message)
93
97
 
94
- outputs = (
95
- {"__default__": result} if not isinstance(result, dict) else result
96
- )
98
+ outputs = {"completion": result}
99
+ self.span.set_attributes(
100
+ attributes={"outputs": outputs},
101
+ namespace="data",
102
+ )
97
103
 
98
- self.span.set_attributes(
99
- attributes={"outputs": outputs},
100
- namespace="data",
101
- )
104
+ except Exception as e:
105
+ pass
102
106
 
103
107
  self.span.set_attributes(
104
108
  attributes={"total": kwargs.get("response_cost")},
@@ -194,16 +198,20 @@ def litellm_handler():
194
198
  log.error("LiteLLM callback error: span not found.")
195
199
  return
196
200
 
197
- result = kwargs.get("complete_streaming_response")
201
+ try:
202
+ result = []
203
+ for choice in response_obj.choices:
204
+ message = choice.message.__dict__
205
+ result.append(message)
198
206
 
199
- outputs = (
200
- {"__default__": result} if not isinstance(result, dict) else result
201
- )
207
+ outputs = {"completion": result}
208
+ self.span.set_attributes(
209
+ attributes={"outputs": outputs},
210
+ namespace="data",
211
+ )
202
212
 
203
- self.span.set_attributes(
204
- attributes={"outputs": outputs},
205
- namespace="data",
206
- )
213
+ except Exception as e:
214
+ pass
207
215
 
208
216
  self.span.set_attributes(
209
217
  attributes={"total": kwargs.get("response_cost")},
@@ -236,17 +244,20 @@ def litellm_handler():
236
244
  log.error("LiteLLM callback error: span not found.")
237
245
  return
238
246
 
239
- # result = kwargs.get("complete_streaming_response")
240
- result = response_obj.choices[0].message.content
247
+ try:
248
+ result = []
249
+ for choice in response_obj.choices:
250
+ message = choice.message.__dict__
251
+ result.append(message)
241
252
 
242
- outputs = (
243
- {"__default__": result} if not isinstance(result, dict) else result
244
- )
253
+ outputs = {"completion": result}
254
+ self.span.set_attributes(
255
+ attributes={"outputs": outputs},
256
+ namespace="data",
257
+ )
245
258
 
246
- self.span.set_attributes(
247
- attributes={"outputs": outputs},
248
- namespace="data",
249
- )
259
+ except Exception as e:
260
+ pass
250
261
 
251
262
  self.span.set_attributes(
252
263
  attributes={"total": kwargs.get("response_cost")},
@@ -21,6 +21,12 @@ AGENTA_SDK_AUTH_CACHE_TTL = environ.get(
21
21
  15 * 60, # 15 minutes
22
22
  )
23
23
 
24
+ AGENTA_SDK_AUTH_CACHE = str(environ.get("AGENTA_SDK_AUTH_CACHE", True)).lower() in (
25
+ "true",
26
+ "1",
27
+ "t",
28
+ )
29
+
24
30
  AGENTA_UNAUTHORIZED_EXECUTION_ALLOWED = str(
25
31
  environ.get("AGENTA_UNAUTHORIZED_EXECUTION_ALLOWED", False)
26
32
  ).lower() in ("true", "1", "t")
@@ -89,9 +95,11 @@ class AuthorizationMiddleware(BaseHTTPMiddleware):
89
95
  sort_keys=True,
90
96
  )
91
97
 
92
- cached_policy = cache.get(_hash)
98
+ policy = None
99
+ if AGENTA_SDK_AUTH_CACHE:
100
+ policy = cache.get(_hash)
93
101
 
94
- if not cached_policy:
102
+ if not policy:
95
103
  async with httpx.AsyncClient() as client:
96
104
  response = await client.get(
97
105
  f"{self.host}/api/permissions/verify",
@@ -110,19 +118,17 @@ class AuthorizationMiddleware(BaseHTTPMiddleware):
110
118
  cache.put(_hash, {"effect": "deny"})
111
119
  return Deny()
112
120
 
113
- cached_policy = {
121
+ policy = {
114
122
  "effect": "allow",
115
123
  "credentials": auth.get("credentials"),
116
124
  }
117
125
 
118
- cache.put(_hash, cached_policy)
126
+ cache.put(_hash, policy)
119
127
 
120
- if cached_policy.get("effect") == "deny":
128
+ if policy.get("effect") == "deny":
121
129
  return Deny()
122
130
 
123
- request.state.credentials = cached_policy.get("credentials")
124
-
125
- print(f"credentials: {request.state.credentials}")
131
+ request.state.credentials = policy.get("credentials")
126
132
 
127
133
  return await call_next(request)
128
134
 
@@ -1,4 +1,4 @@
1
- from typing import Optional, Any, Dict
1
+ from typing import Optional, Any, Dict, Callable
2
2
  from enum import Enum
3
3
 
4
4
  from httpx import get as check
@@ -32,6 +32,8 @@ class Tracing(metaclass=Singleton):
32
32
  def __init__(
33
33
  self,
34
34
  url: str,
35
+ redact: Optional[Callable[..., Any]] = None,
36
+ redact_on_error: Optional[bool] = True,
35
37
  ) -> None:
36
38
  # ENDPOINT (OTLP)
37
39
  self.otlp_url = url
@@ -49,6 +51,10 @@ class Tracing(metaclass=Singleton):
49
51
  # INLINE SPANS for INLINE TRACES (INLINE PROCESSOR)
50
52
  self.inline_spans: Dict[str, Any] = dict()
51
53
 
54
+ # REDACT
55
+ self.redact = redact
56
+ self.redact_on_error = redact_on_error
57
+
52
58
  # PUBLIC
53
59
 
54
60
  def configure(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "agenta"
3
- version = "0.27.5"
3
+ version = "0.27.5a1"
4
4
  description = "The SDK for agenta is an open-source LLMOps platform."
5
5
  readme = "README.md"
6
6
  authors = ["Mahmoud Mabrouk <mahmoud@agenta.ai>"]
@@ -26,14 +26,11 @@ click = "^8.1.3"
26
26
  fastapi = ">=0.100.0"
27
27
  toml = "^0.10.2"
28
28
  questionary = ">=1.10,<3.0"
29
- ipdb = ">=0.13"
30
29
  python-dotenv = "^1.0.0"
31
- python-multipart = ">=0.0.6,<0.0.10"
32
30
  importlib-metadata = ">=8.0.0,<9.0"
33
31
  posthog = "^3.1.0"
34
32
  pydantic = ">=2"
35
33
  httpx = ">=0.24, <0.28"
36
- pymongo = "^4.6.3"
37
34
  cachetools = "^5.3.3"
38
35
  pyyaml = "^6.0.2"
39
36
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes