agenta 0.27.7a2__tar.gz → 0.27.8a2__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.
- {agenta-0.27.7a2 → agenta-0.27.8a2}/PKG-INFO +1 -1
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/evaluations/client.py +0 -11
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/testsets/client.py +8 -40
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/agenta_init.py +4 -9
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/decorators/routing.py +22 -40
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/litellm/litellm.py +30 -75
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/middleware/auth.py +5 -5
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/context.py +6 -6
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/inline.py +12 -7
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/processors.py +1 -3
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/tracing.py +1 -5
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/exceptions.py +15 -9
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/logging.py +5 -1
- {agenta-0.27.7a2 → agenta-0.27.8a2}/pyproject.toml +1 -1
- agenta-0.27.7a2/agenta/sdk/utils/debug.py +0 -68
- {agenta-0.27.7a2 → agenta-0.27.8a2}/README.md +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/cli/evaluation_commands.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/cli/helper.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/cli/main.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/cli/telemetry.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/cli/variant_commands.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/cli/variant_configs.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/Readme.md +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/api.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/api_models.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/apps/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/apps/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/bases/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/bases/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/configs/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/configs/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/containers/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/containers/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/containers/types/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/containers/types/container_templates_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/api_error.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/client_wrapper.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/datetime_utils.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/file.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/http_client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/jsonable_encoder.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/pydantic_utilities.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/query_encoder.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/remove_none_from_dict.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/request_options.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/core/serialization.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/environments/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/environments/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/errors/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/errors/unprocessable_entity_error.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/evaluations/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/evaluators/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/evaluators/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability_v_1/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability_v_1/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability_v_1/types/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability_v_1/types/format.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/observability_v_1/types/query_traces_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/testsets/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_node_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_node_dto_nodes_value.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_nodes_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_root_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_roots_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_tree_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/agenta_trees_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/aggregated_result.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/aggregated_result_evaluator_config.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/app.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/app_variant_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/app_variant_revision.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/base_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/body_import_testset.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/collect_status_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/config_db.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/config_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/config_response_model.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/correct_answer.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/create_app_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/create_span.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/create_trace_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/docker_env_vars.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/environment_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/environment_output_extended.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/environment_revision.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/error.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_scenario.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_scenario_input.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_scenario_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_scenario_result.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_scenario_score_update.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_status_enum.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluation_type.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluator.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluator_config.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluator_mapping_output_interface.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/evaluator_output_interface.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/exception_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/get_config_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/http_validation_error.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/human_evaluation.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/human_evaluation_scenario.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/human_evaluation_scenario_input.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/human_evaluation_scenario_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/human_evaluation_scenario_update.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/human_evaluation_update.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/image.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/invite_request.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/lifecycle_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/link_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/list_api_keys_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/llm_run_rate_limit.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/llm_tokens.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/lm_providers_enum.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/new_human_evaluation.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/new_testset.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/node_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/node_type.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_context_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_event_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_extra_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_link_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_span_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_span_kind.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_spans_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/o_tel_status_code.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/organization.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/organization_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/outputs.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/parent_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/permission.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/reference_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/reference_request_model.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/result.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/root_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/score.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/simple_evaluation_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/span.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/span_detail.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/span_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/span_dto_nodes_value.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/span_status_code.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/span_variant.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/status_code.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/status_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/template.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/template_image_info.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/test_set_output_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/test_set_simple_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/time_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/trace_detail.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/tree_dto.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/tree_type.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/update_app_output.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/uri.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/validation_error.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/validation_error_loc_item.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/variant_action.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/variant_action_enum.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/with_pagination.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/workspace_member_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/workspace_permission.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/workspace_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/workspace_role.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/types/workspace_role_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/variants/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/variants/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/variants/types/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/backend/variants/types/add_variant_from_base_and_config_response.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/client/exceptions.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/config.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/config.toml +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker-assets/Dockerfile.cloud.template +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker-assets/Dockerfile.template +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker-assets/README.md +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker-assets/entrypoint.sh +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker-assets/lambda_function.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker-assets/main.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/docker/docker_utils.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/assets.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/client.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/context/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/context/routing.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/context/tracing.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/decorators/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/decorators/tracing.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/litellm/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/managers/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/managers/config.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/managers/deployment.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/managers/shared.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/managers/variant.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/middleware/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/middleware/cache.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/router.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/attributes.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/conventions.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/exporters.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/tracing/spans.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/types.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/__init__.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/costs.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/globals.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/preinit.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/sdk/utils/singleton.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/compose_email/README.md +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/compose_email/app.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/compose_email/env.example +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/compose_email/requirements.txt +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/compose_email/template.toml +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/extract_data_to_json/README.md +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/extract_data_to_json/app.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/extract_data_to_json/env.example +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/extract_data_to_json/requirements.txt +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/extract_data_to_json/template.toml +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/simple_prompt/README.md +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/simple_prompt/app.py +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/simple_prompt/env.example +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/simple_prompt/requirements.txt +0 -0
- {agenta-0.27.7a2 → agenta-0.27.8a2}/agenta/templates/simple_prompt/template.toml +0 -0
|
@@ -26,7 +26,6 @@ class EvaluationsClient:
|
|
|
26
26
|
def fetch_evaluation_ids(
|
|
27
27
|
self,
|
|
28
28
|
*,
|
|
29
|
-
app_id: str,
|
|
30
29
|
resource_type: str,
|
|
31
30
|
resource_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
32
31
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -35,7 +34,6 @@ class EvaluationsClient:
|
|
|
35
34
|
Fetches evaluation ids for a given resource type and id.
|
|
36
35
|
|
|
37
36
|
Arguments:
|
|
38
|
-
app_id (str): The ID of the app for which to fetch evaluations.
|
|
39
37
|
resource_type (str): The type of resource for which to fetch evaluations.
|
|
40
38
|
resource_ids List[ObjectId]: The IDs of resource for which to fetch evaluations.
|
|
41
39
|
|
|
@@ -47,8 +45,6 @@ class EvaluationsClient:
|
|
|
47
45
|
|
|
48
46
|
Parameters
|
|
49
47
|
----------
|
|
50
|
-
app_id : str
|
|
51
|
-
|
|
52
48
|
resource_type : str
|
|
53
49
|
|
|
54
50
|
resource_ids : typing.Optional[typing.Union[str, typing.Sequence[str]]]
|
|
@@ -70,7 +66,6 @@ class EvaluationsClient:
|
|
|
70
66
|
base_url="https://yourhost.com/path/to/api",
|
|
71
67
|
)
|
|
72
68
|
client.evaluations.fetch_evaluation_ids(
|
|
73
|
-
app_id="app_id",
|
|
74
69
|
resource_type="resource_type",
|
|
75
70
|
)
|
|
76
71
|
"""
|
|
@@ -78,7 +73,6 @@ class EvaluationsClient:
|
|
|
78
73
|
"evaluations/by_resource",
|
|
79
74
|
method="GET",
|
|
80
75
|
params={
|
|
81
|
-
"app_id": app_id,
|
|
82
76
|
"resource_type": resource_type,
|
|
83
77
|
"resource_ids": resource_ids,
|
|
84
78
|
},
|
|
@@ -714,7 +708,6 @@ class AsyncEvaluationsClient:
|
|
|
714
708
|
async def fetch_evaluation_ids(
|
|
715
709
|
self,
|
|
716
710
|
*,
|
|
717
|
-
app_id: str,
|
|
718
711
|
resource_type: str,
|
|
719
712
|
resource_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
|
|
720
713
|
request_options: typing.Optional[RequestOptions] = None,
|
|
@@ -723,7 +716,6 @@ class AsyncEvaluationsClient:
|
|
|
723
716
|
Fetches evaluation ids for a given resource type and id.
|
|
724
717
|
|
|
725
718
|
Arguments:
|
|
726
|
-
app_id (str): The ID of the app for which to fetch evaluations.
|
|
727
719
|
resource_type (str): The type of resource for which to fetch evaluations.
|
|
728
720
|
resource_ids List[ObjectId]: The IDs of resource for which to fetch evaluations.
|
|
729
721
|
|
|
@@ -735,7 +727,6 @@ class AsyncEvaluationsClient:
|
|
|
735
727
|
|
|
736
728
|
Parameters
|
|
737
729
|
----------
|
|
738
|
-
app_id : str
|
|
739
730
|
|
|
740
731
|
resource_type : str
|
|
741
732
|
|
|
@@ -763,7 +754,6 @@ class AsyncEvaluationsClient:
|
|
|
763
754
|
|
|
764
755
|
async def main() -> None:
|
|
765
756
|
await client.evaluations.fetch_evaluation_ids(
|
|
766
|
-
app_id="app_id",
|
|
767
757
|
resource_type="resource_type",
|
|
768
758
|
)
|
|
769
759
|
|
|
@@ -774,7 +764,6 @@ class AsyncEvaluationsClient:
|
|
|
774
764
|
"evaluations/by_resource",
|
|
775
765
|
method="GET",
|
|
776
766
|
params={
|
|
777
|
-
"app_id": app_id,
|
|
778
767
|
"resource_type": resource_type,
|
|
779
768
|
"resource_ids": resource_ids,
|
|
780
769
|
},
|
|
@@ -28,7 +28,6 @@ class TestsetsClient:
|
|
|
28
28
|
file: core.File,
|
|
29
29
|
upload_type: typing.Optional[str] = OMIT,
|
|
30
30
|
testset_name: typing.Optional[str] = OMIT,
|
|
31
|
-
app_id: typing.Optional[str] = OMIT,
|
|
32
31
|
request_options: typing.Optional[RequestOptions] = None,
|
|
33
32
|
) -> TestSetSimpleResponse:
|
|
34
33
|
"""
|
|
@@ -51,8 +50,6 @@ class TestsetsClient:
|
|
|
51
50
|
|
|
52
51
|
testset_name : typing.Optional[str]
|
|
53
52
|
|
|
54
|
-
app_id : typing.Optional[str]
|
|
55
|
-
|
|
56
53
|
request_options : typing.Optional[RequestOptions]
|
|
57
54
|
Request-specific configuration.
|
|
58
55
|
|
|
@@ -77,7 +74,6 @@ class TestsetsClient:
|
|
|
77
74
|
data={
|
|
78
75
|
"upload_type": upload_type,
|
|
79
76
|
"testset_name": testset_name,
|
|
80
|
-
"app_id": app_id,
|
|
81
77
|
},
|
|
82
78
|
files={
|
|
83
79
|
"file": file,
|
|
@@ -173,18 +169,16 @@ class TestsetsClient:
|
|
|
173
169
|
|
|
174
170
|
def create_testset(
|
|
175
171
|
self,
|
|
176
|
-
app_id: str,
|
|
177
172
|
*,
|
|
178
173
|
name: str,
|
|
179
174
|
csvdata: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
|
180
175
|
request_options: typing.Optional[RequestOptions] = None,
|
|
181
176
|
) -> TestSetSimpleResponse:
|
|
182
177
|
"""
|
|
183
|
-
Create a testset with given name
|
|
178
|
+
Create a testset with given name, save the testset to MongoDB.
|
|
184
179
|
|
|
185
180
|
Args:
|
|
186
181
|
name (str): name of the test set.
|
|
187
|
-
app_name (str): name of the application.
|
|
188
182
|
testset (Dict[str, str]): test set data.
|
|
189
183
|
|
|
190
184
|
Returns:
|
|
@@ -192,8 +186,6 @@ class TestsetsClient:
|
|
|
192
186
|
|
|
193
187
|
Parameters
|
|
194
188
|
----------
|
|
195
|
-
app_id : str
|
|
196
|
-
|
|
197
189
|
name : str
|
|
198
190
|
|
|
199
191
|
csvdata : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
@@ -215,13 +207,12 @@ class TestsetsClient:
|
|
|
215
207
|
base_url="https://yourhost.com/path/to/api",
|
|
216
208
|
)
|
|
217
209
|
client.testsets.create_testset(
|
|
218
|
-
app_id="app_id",
|
|
219
210
|
name="name",
|
|
220
211
|
csvdata=[{"key": "value"}],
|
|
221
212
|
)
|
|
222
213
|
"""
|
|
223
214
|
_response = self._client_wrapper.httpx_client.request(
|
|
224
|
-
|
|
215
|
+
"testsets",
|
|
225
216
|
method="POST",
|
|
226
217
|
json={
|
|
227
218
|
"name": name,
|
|
@@ -405,7 +396,7 @@ class TestsetsClient:
|
|
|
405
396
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
406
397
|
|
|
407
398
|
def get_testsets(
|
|
408
|
-
self, *,
|
|
399
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
409
400
|
) -> typing.List[TestSetOutputResponse]:
|
|
410
401
|
"""
|
|
411
402
|
Get all testsets.
|
|
@@ -420,8 +411,6 @@ class TestsetsClient:
|
|
|
420
411
|
|
|
421
412
|
Parameters
|
|
422
413
|
----------
|
|
423
|
-
app_id : str
|
|
424
|
-
|
|
425
414
|
request_options : typing.Optional[RequestOptions]
|
|
426
415
|
Request-specific configuration.
|
|
427
416
|
|
|
@@ -438,16 +427,11 @@ class TestsetsClient:
|
|
|
438
427
|
api_key="YOUR_API_KEY",
|
|
439
428
|
base_url="https://yourhost.com/path/to/api",
|
|
440
429
|
)
|
|
441
|
-
client.testsets.get_testsets(
|
|
442
|
-
app_id="app_id",
|
|
443
|
-
)
|
|
430
|
+
client.testsets.get_testsets()
|
|
444
431
|
"""
|
|
445
432
|
_response = self._client_wrapper.httpx_client.request(
|
|
446
433
|
"testsets",
|
|
447
434
|
method="GET",
|
|
448
|
-
params={
|
|
449
|
-
"app_id": app_id,
|
|
450
|
-
},
|
|
451
435
|
request_options=request_options,
|
|
452
436
|
)
|
|
453
437
|
try:
|
|
@@ -557,7 +541,6 @@ class AsyncTestsetsClient:
|
|
|
557
541
|
file: core.File,
|
|
558
542
|
upload_type: typing.Optional[str] = OMIT,
|
|
559
543
|
testset_name: typing.Optional[str] = OMIT,
|
|
560
|
-
app_id: typing.Optional[str] = OMIT,
|
|
561
544
|
request_options: typing.Optional[RequestOptions] = None,
|
|
562
545
|
) -> TestSetSimpleResponse:
|
|
563
546
|
"""
|
|
@@ -580,8 +563,6 @@ class AsyncTestsetsClient:
|
|
|
580
563
|
|
|
581
564
|
testset_name : typing.Optional[str]
|
|
582
565
|
|
|
583
|
-
app_id : typing.Optional[str]
|
|
584
|
-
|
|
585
566
|
request_options : typing.Optional[RequestOptions]
|
|
586
567
|
Request-specific configuration.
|
|
587
568
|
|
|
@@ -614,7 +595,6 @@ class AsyncTestsetsClient:
|
|
|
614
595
|
data={
|
|
615
596
|
"upload_type": upload_type,
|
|
616
597
|
"testset_name": testset_name,
|
|
617
|
-
"app_id": app_id,
|
|
618
598
|
},
|
|
619
599
|
files={
|
|
620
600
|
"file": file,
|
|
@@ -718,18 +698,16 @@ class AsyncTestsetsClient:
|
|
|
718
698
|
|
|
719
699
|
async def create_testset(
|
|
720
700
|
self,
|
|
721
|
-
app_id: str,
|
|
722
701
|
*,
|
|
723
702
|
name: str,
|
|
724
703
|
csvdata: typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]],
|
|
725
704
|
request_options: typing.Optional[RequestOptions] = None,
|
|
726
705
|
) -> TestSetSimpleResponse:
|
|
727
706
|
"""
|
|
728
|
-
Create a testset with given name
|
|
707
|
+
Create a testset with given name, save the testset to MongoDB.
|
|
729
708
|
|
|
730
709
|
Args:
|
|
731
710
|
name (str): name of the test set.
|
|
732
|
-
app_name (str): name of the application.
|
|
733
711
|
testset (Dict[str, str]): test set data.
|
|
734
712
|
|
|
735
713
|
Returns:
|
|
@@ -737,8 +715,6 @@ class AsyncTestsetsClient:
|
|
|
737
715
|
|
|
738
716
|
Parameters
|
|
739
717
|
----------
|
|
740
|
-
app_id : str
|
|
741
|
-
|
|
742
718
|
name : str
|
|
743
719
|
|
|
744
720
|
csvdata : typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]
|
|
@@ -765,7 +741,6 @@ class AsyncTestsetsClient:
|
|
|
765
741
|
|
|
766
742
|
async def main() -> None:
|
|
767
743
|
await client.testsets.create_testset(
|
|
768
|
-
app_id="app_id",
|
|
769
744
|
name="name",
|
|
770
745
|
csvdata=[{"key": "value"}],
|
|
771
746
|
)
|
|
@@ -774,7 +749,7 @@ class AsyncTestsetsClient:
|
|
|
774
749
|
asyncio.run(main())
|
|
775
750
|
"""
|
|
776
751
|
_response = await self._client_wrapper.httpx_client.request(
|
|
777
|
-
|
|
752
|
+
"testsets",
|
|
778
753
|
method="POST",
|
|
779
754
|
json={
|
|
780
755
|
"name": name,
|
|
@@ -974,7 +949,7 @@ class AsyncTestsetsClient:
|
|
|
974
949
|
raise ApiError(status_code=_response.status_code, body=_response_json)
|
|
975
950
|
|
|
976
951
|
async def get_testsets(
|
|
977
|
-
self, *,
|
|
952
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
978
953
|
) -> typing.List[TestSetOutputResponse]:
|
|
979
954
|
"""
|
|
980
955
|
Get all testsets.
|
|
@@ -989,8 +964,6 @@ class AsyncTestsetsClient:
|
|
|
989
964
|
|
|
990
965
|
Parameters
|
|
991
966
|
----------
|
|
992
|
-
app_id : str
|
|
993
|
-
|
|
994
967
|
request_options : typing.Optional[RequestOptions]
|
|
995
968
|
Request-specific configuration.
|
|
996
969
|
|
|
@@ -1012,9 +985,7 @@ class AsyncTestsetsClient:
|
|
|
1012
985
|
|
|
1013
986
|
|
|
1014
987
|
async def main() -> None:
|
|
1015
|
-
await client.testsets.get_testsets(
|
|
1016
|
-
app_id="app_id",
|
|
1017
|
-
)
|
|
988
|
+
await client.testsets.get_testsets()
|
|
1018
989
|
|
|
1019
990
|
|
|
1020
991
|
asyncio.run(main())
|
|
@@ -1022,9 +993,6 @@ class AsyncTestsetsClient:
|
|
|
1022
993
|
_response = await self._client_wrapper.httpx_client.request(
|
|
1023
994
|
"testsets",
|
|
1024
995
|
method="GET",
|
|
1025
|
-
params={
|
|
1026
|
-
"app_id": app_id,
|
|
1027
|
-
},
|
|
1028
996
|
request_options=request_options,
|
|
1029
997
|
)
|
|
1030
998
|
try:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import logging
|
|
2
1
|
import toml
|
|
3
2
|
from os import getenv
|
|
4
3
|
from typing import Optional, Callable, Any
|
|
@@ -11,10 +10,6 @@ from agenta.sdk.tracing import Tracing
|
|
|
11
10
|
from agenta.client.exceptions import APIRequestError
|
|
12
11
|
|
|
13
12
|
|
|
14
|
-
logger = logging.getLogger(__name__)
|
|
15
|
-
logger.setLevel(logging.DEBUG)
|
|
16
|
-
|
|
17
|
-
|
|
18
13
|
class AgentaSingleton:
|
|
19
14
|
"""Singleton class to save all the "global variables" for the sdk."""
|
|
20
15
|
|
|
@@ -164,7 +159,7 @@ class Config:
|
|
|
164
159
|
try:
|
|
165
160
|
self.push(config_name="default", overwrite=overwrite, **kwargs)
|
|
166
161
|
except Exception as ex:
|
|
167
|
-
|
|
162
|
+
log.warning(
|
|
168
163
|
"Unable to push the default configuration to the server. %s", str(ex)
|
|
169
164
|
)
|
|
170
165
|
|
|
@@ -185,7 +180,7 @@ class Config:
|
|
|
185
180
|
overwrite=overwrite,
|
|
186
181
|
)
|
|
187
182
|
except Exception as ex:
|
|
188
|
-
|
|
183
|
+
log.warning(
|
|
189
184
|
"Failed to push the configuration to the server with error: %s", ex
|
|
190
185
|
)
|
|
191
186
|
|
|
@@ -212,14 +207,14 @@ class Config:
|
|
|
212
207
|
config_name=config_name,
|
|
213
208
|
)
|
|
214
209
|
except Exception as ex:
|
|
215
|
-
|
|
210
|
+
log.warning(
|
|
216
211
|
"Failed to pull the configuration from the server with error: %s",
|
|
217
212
|
str(ex),
|
|
218
213
|
)
|
|
219
214
|
try:
|
|
220
215
|
self.set(**{"current_version": config.current_version, **config.parameters})
|
|
221
216
|
except Exception as ex:
|
|
222
|
-
|
|
217
|
+
log.warning("Failed to set the configuration with error: %s", str(ex))
|
|
223
218
|
|
|
224
219
|
def all(self):
|
|
225
220
|
"""Returns all the parameters for the app variant"""
|
|
@@ -143,9 +143,7 @@ class entrypoint:
|
|
|
143
143
|
_MIDDLEWARES = False
|
|
144
144
|
|
|
145
145
|
except: # pylint: disable=bare-except
|
|
146
|
-
log.
|
|
147
|
-
log.error("Agenta SDK - failed to secure route: %s", route_path)
|
|
148
|
-
log.error("------------------------------------")
|
|
146
|
+
log.warning("Agenta SDK - failed to secure route: %s", route_path)
|
|
149
147
|
### --- Update Middleware --- #
|
|
150
148
|
|
|
151
149
|
DEFAULT_PATH = "generate"
|
|
@@ -357,9 +355,7 @@ class entrypoint:
|
|
|
357
355
|
*args,
|
|
358
356
|
**func_params,
|
|
359
357
|
):
|
|
360
|
-
log.info("
|
|
361
|
-
log.info(f"Agenta SDK - running route: {repr(self.route_path or '/')}")
|
|
362
|
-
log.info("---------------------------")
|
|
358
|
+
log.info("Agenta SDK - handling route: %s", repr(self.route_path or "/"))
|
|
363
359
|
|
|
364
360
|
tracing_context.set(routing_context.get())
|
|
365
361
|
|
|
@@ -377,7 +373,7 @@ class entrypoint:
|
|
|
377
373
|
|
|
378
374
|
async def handle_success(self, result: Any, inline_trace: bool):
|
|
379
375
|
data = None
|
|
380
|
-
trace =
|
|
376
|
+
trace = None
|
|
381
377
|
|
|
382
378
|
with suppress():
|
|
383
379
|
data = self.patch_result(result)
|
|
@@ -392,21 +388,17 @@ class entrypoint:
|
|
|
392
388
|
return BaseResponse(data=data, tree=trace)
|
|
393
389
|
|
|
394
390
|
def handle_failure(self, error: Exception):
|
|
395
|
-
log.
|
|
396
|
-
log.
|
|
397
|
-
log.
|
|
398
|
-
log.
|
|
399
|
-
log.
|
|
391
|
+
log.warning("--------------------------------------------------")
|
|
392
|
+
log.warning("Agenta SDK - handling application exception below:")
|
|
393
|
+
log.warning("--------------------------------------------------")
|
|
394
|
+
log.warning(format_exc().strip("\n"))
|
|
395
|
+
log.warning("--------------------------------------------------")
|
|
400
396
|
|
|
401
397
|
status_code = error.status_code if hasattr(error, "status_code") else 500
|
|
402
398
|
message = str(error)
|
|
403
399
|
stacktrace = format_exception(error, value=error, tb=error.__traceback__) # type: ignore
|
|
404
400
|
detail = {"message": message, "stacktrace": stacktrace}
|
|
405
401
|
|
|
406
|
-
log.error(f"----------------------------------")
|
|
407
|
-
log.error(f"Agenta SDK - exiting with failure: {status_code}")
|
|
408
|
-
log.error(f"----------------------------------")
|
|
409
|
-
|
|
410
402
|
raise HTTPException(status_code=status_code, detail=detail)
|
|
411
403
|
|
|
412
404
|
def patch_result(self, result: Any):
|
|
@@ -683,10 +675,7 @@ class entrypoint:
|
|
|
683
675
|
|
|
684
676
|
loop = get_event_loop()
|
|
685
677
|
|
|
686
|
-
with routing_context_manager(
|
|
687
|
-
config=args_config_params,
|
|
688
|
-
environment="terminal",
|
|
689
|
-
):
|
|
678
|
+
with routing_context_manager(config=args_config_params):
|
|
690
679
|
result = loop.run_until_complete(
|
|
691
680
|
self.execute_function(
|
|
692
681
|
func,
|
|
@@ -695,30 +684,23 @@ class entrypoint:
|
|
|
695
684
|
)
|
|
696
685
|
)
|
|
697
686
|
|
|
698
|
-
SHOW_DETAILS = True
|
|
699
|
-
SHOW_DATA = False
|
|
700
|
-
SHOW_TRACE = False
|
|
701
|
-
|
|
702
687
|
if result.trace:
|
|
703
688
|
log.info("\n========= Result =========\n")
|
|
704
689
|
|
|
705
690
|
log.info(f"trace_id: {result.trace['trace_id']}")
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
log.info(f"----------------")
|
|
720
|
-
log.info(dumps(result.trace.get("spans", []), indent=2))
|
|
721
|
-
log.info(f"----------------")
|
|
691
|
+
log.info(f"latency: {result.trace.get('latency')}")
|
|
692
|
+
log.info(f"cost: {result.trace.get('cost')}")
|
|
693
|
+
log.info(f"usage: {list(result.trace.get('usage', {}).values())}")
|
|
694
|
+
|
|
695
|
+
log.info(" ")
|
|
696
|
+
log.info("data:")
|
|
697
|
+
log.info(dumps(result.data, indent=2))
|
|
698
|
+
|
|
699
|
+
log.info(" ")
|
|
700
|
+
log.info("trace:")
|
|
701
|
+
log.info("----------------")
|
|
702
|
+
log.info(dumps(result.trace.get("spans", []), indent=2))
|
|
703
|
+
log.info("----------------")
|
|
722
704
|
|
|
723
705
|
log.info("\n==========================\n")
|
|
724
706
|
|
|
@@ -60,7 +60,11 @@ def litellm_handler():
|
|
|
60
60
|
)
|
|
61
61
|
|
|
62
62
|
if not self.span:
|
|
63
|
-
log.
|
|
63
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
64
|
+
return
|
|
65
|
+
|
|
66
|
+
if not self.span.is_recording():
|
|
67
|
+
log.error("Agenta SDK - litellm span not recording.")
|
|
64
68
|
return
|
|
65
69
|
|
|
66
70
|
self.span.set_attributes(
|
|
@@ -86,43 +90,11 @@ def litellm_handler():
|
|
|
86
90
|
end_time,
|
|
87
91
|
):
|
|
88
92
|
if not self.span:
|
|
89
|
-
log.
|
|
93
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
90
94
|
return
|
|
91
95
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
for choice in response_obj.choices:
|
|
95
|
-
message = choice.message.__dict__
|
|
96
|
-
result.append(message)
|
|
97
|
-
|
|
98
|
-
outputs = {"completion": result}
|
|
99
|
-
self.span.set_attributes(
|
|
100
|
-
attributes={"outputs": outputs},
|
|
101
|
-
namespace="data",
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
except Exception as e:
|
|
105
|
-
pass
|
|
106
|
-
|
|
107
|
-
self.span.set_attributes(
|
|
108
|
-
attributes={"total": kwargs.get("response_cost")},
|
|
109
|
-
namespace="metrics.unit.costs",
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
self.span.set_attributes(
|
|
113
|
-
attributes=(
|
|
114
|
-
{
|
|
115
|
-
"prompt": response_obj.usage.prompt_tokens,
|
|
116
|
-
"completion": response_obj.usage.completion_tokens,
|
|
117
|
-
"total": response_obj.usage.total_tokens,
|
|
118
|
-
}
|
|
119
|
-
),
|
|
120
|
-
namespace="metrics.unit.tokens",
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
self.span.set_status(status="OK")
|
|
124
|
-
|
|
125
|
-
self.span.end()
|
|
96
|
+
if not self.span.is_recording():
|
|
97
|
+
return
|
|
126
98
|
|
|
127
99
|
def log_success_event(
|
|
128
100
|
self,
|
|
@@ -131,8 +103,14 @@ def litellm_handler():
|
|
|
131
103
|
start_time,
|
|
132
104
|
end_time,
|
|
133
105
|
):
|
|
106
|
+
if kwargs.get("stream"):
|
|
107
|
+
return
|
|
108
|
+
|
|
134
109
|
if not self.span:
|
|
135
|
-
log.
|
|
110
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
111
|
+
return
|
|
112
|
+
|
|
113
|
+
if not self.span.is_recording():
|
|
136
114
|
return
|
|
137
115
|
|
|
138
116
|
try:
|
|
@@ -178,7 +156,10 @@ def litellm_handler():
|
|
|
178
156
|
end_time,
|
|
179
157
|
):
|
|
180
158
|
if not self.span:
|
|
181
|
-
log.
|
|
159
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
160
|
+
return
|
|
161
|
+
|
|
162
|
+
if not self.span.is_recording():
|
|
182
163
|
return
|
|
183
164
|
|
|
184
165
|
self.span.record_exception(kwargs["exception"])
|
|
@@ -195,43 +176,11 @@ def litellm_handler():
|
|
|
195
176
|
end_time,
|
|
196
177
|
):
|
|
197
178
|
if not self.span:
|
|
198
|
-
log.
|
|
179
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
199
180
|
return
|
|
200
181
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
for choice in response_obj.choices:
|
|
204
|
-
message = choice.message.__dict__
|
|
205
|
-
result.append(message)
|
|
206
|
-
|
|
207
|
-
outputs = {"completion": result}
|
|
208
|
-
self.span.set_attributes(
|
|
209
|
-
attributes={"outputs": outputs},
|
|
210
|
-
namespace="data",
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
except Exception as e:
|
|
214
|
-
pass
|
|
215
|
-
|
|
216
|
-
self.span.set_attributes(
|
|
217
|
-
attributes={"total": kwargs.get("response_cost")},
|
|
218
|
-
namespace="metrics.unit.costs",
|
|
219
|
-
)
|
|
220
|
-
|
|
221
|
-
self.span.set_attributes(
|
|
222
|
-
attributes=(
|
|
223
|
-
{
|
|
224
|
-
"prompt": response_obj.usage.prompt_tokens,
|
|
225
|
-
"completion": response_obj.usage.completion_tokens,
|
|
226
|
-
"total": response_obj.usage.total_tokens,
|
|
227
|
-
}
|
|
228
|
-
),
|
|
229
|
-
namespace="metrics.unit.tokens",
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
self.span.set_status(status="OK")
|
|
233
|
-
|
|
234
|
-
self.span.end()
|
|
182
|
+
if not self.span.is_recording():
|
|
183
|
+
return
|
|
235
184
|
|
|
236
185
|
async def async_log_success_event(
|
|
237
186
|
self,
|
|
@@ -241,7 +190,10 @@ def litellm_handler():
|
|
|
241
190
|
end_time,
|
|
242
191
|
):
|
|
243
192
|
if not self.span:
|
|
244
|
-
log.
|
|
193
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
194
|
+
return
|
|
195
|
+
|
|
196
|
+
if not self.span.is_recording():
|
|
245
197
|
return
|
|
246
198
|
|
|
247
199
|
try:
|
|
@@ -287,7 +239,10 @@ def litellm_handler():
|
|
|
287
239
|
end_time,
|
|
288
240
|
):
|
|
289
241
|
if not self.span:
|
|
290
|
-
log.
|
|
242
|
+
log.warning("Agenta SDK - litellm tracing failed")
|
|
243
|
+
return
|
|
244
|
+
|
|
245
|
+
if not self.span.is_recording():
|
|
291
246
|
return
|
|
292
247
|
|
|
293
248
|
self.span.record_exception(kwargs["exception"])
|
|
@@ -133,10 +133,10 @@ class AuthorizationMiddleware(BaseHTTPMiddleware):
|
|
|
133
133
|
return await call_next(request)
|
|
134
134
|
|
|
135
135
|
except: # pylint: disable=bare-except
|
|
136
|
-
log.
|
|
137
|
-
log.
|
|
138
|
-
log.
|
|
139
|
-
log.
|
|
140
|
-
log.
|
|
136
|
+
log.warning("------------------------------------------------------")
|
|
137
|
+
log.warning("Agenta SDK - handling auth middleware exception below:")
|
|
138
|
+
log.warning("------------------------------------------------------")
|
|
139
|
+
log.warning(format_exc().strip("\n"))
|
|
140
|
+
log.warning("------------------------------------------------------")
|
|
141
141
|
|
|
142
142
|
return Deny()
|
|
@@ -14,11 +14,11 @@ def tracing_context_manager():
|
|
|
14
14
|
token = tracing_context.set(_tracing_context)
|
|
15
15
|
try:
|
|
16
16
|
yield
|
|
17
|
-
except
|
|
18
|
-
log.
|
|
19
|
-
log.
|
|
20
|
-
log.
|
|
21
|
-
log.
|
|
22
|
-
log.
|
|
17
|
+
except: # pylint: disable=bare-except
|
|
18
|
+
log.warning("----------------------------------------------")
|
|
19
|
+
log.warning("Agenta SDK - handling tracing exception below:")
|
|
20
|
+
log.warning("----------------------------------------------")
|
|
21
|
+
log.warning(format_exc().strip("\n"))
|
|
22
|
+
log.warning("----------------------------------------------")
|
|
23
23
|
finally:
|
|
24
24
|
tracing_context.reset(token)
|
|
@@ -1118,13 +1118,15 @@ def calculate_costs(span_idx: Dict[str, SpanDTO]):
|
|
|
1118
1118
|
and span.meta
|
|
1119
1119
|
and span.metrics
|
|
1120
1120
|
):
|
|
1121
|
+
model = span.meta.get("response.model")
|
|
1122
|
+
prompt_tokens = span.metrics.get("unit.tokens.prompt", 0.0)
|
|
1123
|
+
completion_tokens = span.metrics.get("unit.tokens.completion", 0.0)
|
|
1124
|
+
|
|
1121
1125
|
try:
|
|
1122
1126
|
costs = cost_calculator.cost_per_token(
|
|
1123
|
-
model=
|
|
1124
|
-
prompt_tokens=
|
|
1125
|
-
completion_tokens=
|
|
1126
|
-
call_type=span.node.type.name.lower(),
|
|
1127
|
-
response_time_ms=span.time.span // 1_000,
|
|
1127
|
+
model=model,
|
|
1128
|
+
prompt_tokens=prompt_tokens,
|
|
1129
|
+
completion_tokens=completion_tokens,
|
|
1128
1130
|
)
|
|
1129
1131
|
|
|
1130
1132
|
if not costs:
|
|
@@ -1137,5 +1139,8 @@ def calculate_costs(span_idx: Dict[str, SpanDTO]):
|
|
|
1137
1139
|
span.metrics["unit.costs.completion"] = completion_cost
|
|
1138
1140
|
span.metrics["unit.costs.total"] = total_cost
|
|
1139
1141
|
|
|
1140
|
-
except:
|
|
1141
|
-
|
|
1142
|
+
except: # pylint: disable=bare-except
|
|
1143
|
+
print("Failed to calculate costs:")
|
|
1144
|
+
print(
|
|
1145
|
+
f"model={model}, prompt_tokens={prompt_tokens}, completion_tokens={completion_tokens}"
|
|
1146
|
+
)
|