agenta 0.12.7__py3-none-any.whl → 0.13.0a0__py3-none-any.whl

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

Potentially problematic release.


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

Files changed (123) hide show
  1. agenta/__init__.py +3 -2
  2. agenta/cli/helper.py +1 -1
  3. agenta/cli/main.py +1 -1
  4. agenta/cli/variant_commands.py +7 -5
  5. agenta/client/api.py +1 -1
  6. agenta/client/backend/__init__.py +78 -18
  7. agenta/client/backend/client.py +961 -5575
  8. agenta/client/backend/core/api_error.py +1 -3
  9. agenta/client/backend/core/datetime_utils.py +1 -3
  10. agenta/client/backend/core/jsonable_encoder.py +3 -9
  11. agenta/client/backend/resources/__init__.py +20 -0
  12. agenta/client/backend/resources/apps/__init__.py +2 -0
  13. agenta/client/backend/resources/apps/client.py +915 -0
  14. agenta/client/backend/resources/bases/__init__.py +2 -0
  15. agenta/client/backend/resources/bases/client.py +121 -0
  16. agenta/client/backend/resources/configs/__init__.py +2 -0
  17. agenta/client/backend/resources/configs/client.py +333 -0
  18. agenta/client/backend/resources/containers/__init__.py +5 -0
  19. agenta/client/backend/resources/containers/client.py +351 -0
  20. agenta/client/backend/resources/containers/types/__init__.py +5 -0
  21. agenta/client/backend/{types → resources/containers/types}/container_templates_response.py +1 -1
  22. agenta/client/backend/resources/environments/__init__.py +2 -0
  23. agenta/client/backend/resources/environments/client.py +119 -0
  24. agenta/client/backend/resources/evaluations/__init__.py +2 -0
  25. agenta/client/backend/resources/evaluations/client.py +948 -0
  26. agenta/client/backend/resources/evaluators/__init__.py +2 -0
  27. agenta/client/backend/resources/evaluators/client.py +554 -0
  28. agenta/client/backend/resources/observability/__init__.py +2 -0
  29. agenta/client/backend/resources/observability/client.py +1114 -0
  30. agenta/client/backend/resources/testsets/__init__.py +2 -0
  31. agenta/client/backend/resources/testsets/client.py +649 -0
  32. agenta/client/backend/resources/variants/__init__.py +5 -0
  33. agenta/client/backend/resources/variants/client.py +730 -0
  34. agenta/client/backend/resources/variants/types/__init__.py +5 -0
  35. agenta/client/backend/resources/variants/types/add_variant_from_base_and_config_response.py +7 -0
  36. agenta/client/backend/types/__init__.py +54 -22
  37. agenta/client/backend/types/aggregated_result.py +4 -12
  38. agenta/client/backend/types/aggregated_result_evaluator_config.py +7 -0
  39. agenta/client/backend/types/app.py +2 -10
  40. agenta/client/backend/types/{app_variant_output.py → app_variant_response.py} +6 -12
  41. agenta/client/backend/types/app_variant_revision.py +2 -10
  42. agenta/client/backend/types/base_output.py +2 -10
  43. agenta/client/backend/types/body_import_testset.py +2 -10
  44. agenta/client/backend/types/config_db.py +2 -10
  45. agenta/client/backend/types/create_app_output.py +2 -10
  46. agenta/client/backend/types/{trace.py → create_span.py} +21 -20
  47. agenta/client/backend/types/{delete_evaluation.py → create_trace_response.py} +5 -12
  48. agenta/client/backend/types/docker_env_vars.py +2 -10
  49. agenta/client/backend/types/environment_output.py +5 -11
  50. agenta/client/backend/types/environment_output_extended.py +37 -0
  51. agenta/client/backend/types/environment_revision.py +33 -0
  52. agenta/client/backend/types/error.py +29 -0
  53. agenta/client/backend/types/evaluation.py +8 -13
  54. agenta/client/backend/types/evaluation_scenario.py +2 -10
  55. agenta/client/backend/types/evaluation_scenario_input.py +2 -10
  56. agenta/client/backend/types/evaluation_scenario_output.py +6 -12
  57. agenta/client/backend/types/evaluation_scenario_result.py +2 -10
  58. agenta/client/backend/types/evaluation_scenario_score_update.py +28 -0
  59. agenta/client/backend/types/evaluation_status_enum.py +4 -0
  60. agenta/client/backend/types/evaluation_type.py +1 -3
  61. agenta/client/backend/types/evaluation_webhook.py +2 -10
  62. agenta/client/backend/types/evaluator.py +3 -10
  63. agenta/client/backend/types/evaluator_config.py +2 -10
  64. agenta/client/backend/types/feedback.py +2 -10
  65. agenta/client/backend/types/{get_config_reponse.py → get_config_response.py} +4 -12
  66. agenta/client/backend/types/http_validation_error.py +2 -10
  67. agenta/client/backend/types/human_evaluation.py +2 -10
  68. agenta/client/backend/types/human_evaluation_scenario.py +4 -12
  69. agenta/client/backend/types/human_evaluation_scenario_input.py +2 -10
  70. agenta/client/backend/types/human_evaluation_scenario_output.py +2 -10
  71. agenta/client/backend/types/human_evaluation_scenario_update.py +37 -0
  72. agenta/client/backend/types/human_evaluation_update.py +29 -0
  73. agenta/client/backend/types/image.py +3 -10
  74. agenta/client/backend/types/invite_request.py +3 -10
  75. agenta/client/backend/types/{list_api_keys_output.py → list_api_keys_response.py} +3 -11
  76. agenta/client/backend/types/llm_run_rate_limit.py +2 -10
  77. agenta/client/backend/types/llm_tokens.py +30 -0
  78. agenta/client/backend/types/new_human_evaluation.py +34 -0
  79. agenta/client/backend/types/new_testset.py +2 -10
  80. agenta/client/backend/types/organization.py +3 -10
  81. agenta/client/backend/types/organization_output.py +2 -10
  82. agenta/client/backend/types/permission.py +141 -0
  83. agenta/client/backend/types/result.py +4 -10
  84. agenta/client/backend/types/{human_evaluation_scenario_score.py → score.py} +1 -1
  85. agenta/client/backend/types/simple_evaluation_output.py +2 -10
  86. agenta/client/backend/types/span.py +20 -26
  87. agenta/client/backend/types/span_detail.py +44 -0
  88. agenta/client/backend/types/span_kind.py +49 -0
  89. agenta/client/backend/types/span_status_code.py +29 -0
  90. agenta/client/backend/types/span_variant.py +30 -0
  91. agenta/client/backend/types/template.py +2 -10
  92. agenta/client/backend/types/template_image_info.py +2 -10
  93. agenta/client/backend/types/test_set_output_response.py +2 -10
  94. agenta/client/backend/types/test_set_simple_response.py +2 -10
  95. agenta/client/backend/types/trace_detail.py +44 -0
  96. agenta/client/backend/types/uri.py +2 -10
  97. agenta/client/backend/types/validation_error.py +2 -10
  98. agenta/client/backend/types/variant_action.py +2 -10
  99. agenta/client/backend/types/variant_action_enum.py +1 -3
  100. agenta/client/backend/types/with_pagination.py +32 -0
  101. agenta/client/backend/types/workspace_member_response.py +30 -0
  102. agenta/client/backend/types/workspace_permission.py +32 -0
  103. agenta/client/backend/types/workspace_response.py +36 -0
  104. agenta/client/backend/types/workspace_role.py +41 -0
  105. agenta/client/backend/types/workspace_role_response.py +30 -0
  106. agenta/docker/docker_utils.py +1 -5
  107. agenta/sdk/__init__.py +3 -2
  108. agenta/sdk/agenta_decorator.py +68 -26
  109. agenta/sdk/agenta_init.py +50 -20
  110. agenta/sdk/tracing/context_manager.py +13 -0
  111. agenta/sdk/tracing/decorators.py +41 -0
  112. agenta/sdk/tracing/llm_tracing.py +203 -0
  113. agenta/sdk/tracing/logger.py +19 -0
  114. agenta/sdk/tracing/tasks_manager.py +130 -0
  115. agenta/sdk/types.py +0 -38
  116. {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/METADATA +2 -1
  117. agenta-0.13.0a0.dist-info/RECORD +161 -0
  118. agenta/client/backend/types/add_variant_from_base_and_config_response.py +0 -7
  119. agenta/client/backend/types/app_variant_output_extended.py +0 -50
  120. agenta/client/backend/types/human_evaluation_scenario_update_score.py +0 -5
  121. agenta-0.12.7.dist-info/RECORD +0 -114
  122. {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/WHEEL +0 -0
  123. {agenta-0.12.7.dist-info → agenta-0.13.0a0.dist-info}/entry_points.txt +0 -0
@@ -7,9 +7,7 @@ class ApiError(Exception):
7
7
  status_code: typing.Optional[int]
8
8
  body: typing.Any
9
9
 
10
- def __init__(
11
- self, *, status_code: typing.Optional[int] = None, body: typing.Any = None
12
- ):
10
+ def __init__(self, *, status_code: typing.Optional[int] = None, body: typing.Any = None):
13
11
  self.status_code = status_code
14
12
  self.body = body
15
13
 
@@ -13,9 +13,7 @@ def serialize_datetime(v: dt.datetime) -> str:
13
13
  """
14
14
 
15
15
  def _serialize_zoned_datetime(v: dt.datetime) -> str:
16
- if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(
17
- None
18
- ):
16
+ if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None):
19
17
  # UTC is a special case where we use "Z" at the end instead of "+00:00"
20
18
  return v.isoformat().replace("+00:00", "Z")
21
19
  else:
@@ -30,22 +30,16 @@ DictIntStrAny = Dict[Union[int, str], Any]
30
30
  def generate_encoders_by_class_tuples(
31
31
  type_encoder_map: Dict[Any, Callable[[Any], Any]]
32
32
  ) -> Dict[Callable[[Any], Any], Tuple[Any, ...]]:
33
- encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(
34
- tuple
35
- )
33
+ encoders_by_class_tuples: Dict[Callable[[Any], Any], Tuple[Any, ...]] = defaultdict(tuple)
36
34
  for type_, encoder in type_encoder_map.items():
37
35
  encoders_by_class_tuples[encoder] += (type_,)
38
36
  return encoders_by_class_tuples
39
37
 
40
38
 
41
- encoders_by_class_tuples = generate_encoders_by_class_tuples(
42
- pydantic.json.ENCODERS_BY_TYPE
43
- )
39
+ encoders_by_class_tuples = generate_encoders_by_class_tuples(pydantic.json.ENCODERS_BY_TYPE)
44
40
 
45
41
 
46
- def jsonable_encoder(
47
- obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None
48
- ) -> Any:
42
+ def jsonable_encoder(obj: Any, custom_encoder: Optional[Dict[Any, Callable[[Any], Any]]] = None) -> Any:
49
43
  custom_encoder = custom_encoder or {}
50
44
  if custom_encoder:
51
45
  if type(obj) in custom_encoder:
@@ -0,0 +1,20 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ from . import apps, bases, configs, containers, environments, evaluations, evaluators, observability, testsets, variants
4
+ from .containers import ContainerTemplatesResponse
5
+ from .variants import AddVariantFromBaseAndConfigResponse
6
+
7
+ __all__ = [
8
+ "AddVariantFromBaseAndConfigResponse",
9
+ "ContainerTemplatesResponse",
10
+ "apps",
11
+ "bases",
12
+ "configs",
13
+ "containers",
14
+ "environments",
15
+ "evaluations",
16
+ "evaluators",
17
+ "observability",
18
+ "testsets",
19
+ "variants",
20
+ ]
@@ -0,0 +1,2 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+