agenta 0.36.3__tar.gz → 0.36.5__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.36.3 → agenta-0.36.5}/PKG-INFO +1 -2
- {agenta-0.36.3 → agenta-0.36.5}/agenta/__init__.py +5 -5
- {agenta-0.36.3 → agenta-0.36.5}/agenta/client/Readme.md +3 -3
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/__init__.py +5 -5
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/agenta_init.py +28 -54
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/client.py +1 -1
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/shared.py +3 -3
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/auth.py +18 -9
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/config.py +0 -2
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/vault.py +3 -3
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/types.py +2 -2
- {agenta-0.36.3 → agenta-0.36.5}/pyproject.toml +1 -5
- agenta-0.36.3/agenta/cli/helper.py +0 -202
- agenta-0.36.3/agenta/cli/main.py +0 -229
- agenta-0.36.3/agenta/cli/telemetry.py +0 -50
- agenta-0.36.3/agenta/cli/variant_commands.py +0 -526
- agenta-0.36.3/agenta/cli/variant_configs.py +0 -49
- agenta-0.36.3/agenta/client/api.py +0 -74
- agenta-0.36.3/agenta/client/api_models.py +0 -34
- agenta-0.36.3/agenta/client/client.py +0 -563
- agenta-0.36.3/agenta/client/exceptions.py +0 -2
- agenta-0.36.3/agenta/docker/docker-assets/Dockerfile.cloud.template +0 -9
- agenta-0.36.3/agenta/docker/docker-assets/Dockerfile.oss.template +0 -13
- agenta-0.36.3/agenta/docker/docker-assets/Dockerfile.template +0 -13
- agenta-0.36.3/agenta/docker/docker-assets/README.md +0 -1
- agenta-0.36.3/agenta/docker/docker-assets/entrypoint.sh +0 -7
- agenta-0.36.3/agenta/docker/docker-assets/lambda_function.py +0 -6
- agenta-0.36.3/agenta/docker/docker-assets/main.py +0 -13
- agenta-0.36.3/agenta/docker/docker_utils.py +0 -100
- agenta-0.36.3/agenta/sdk/utils/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/README.md +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/access_control/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/access_control/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/admin/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/admin/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/apps/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/apps/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/bases/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/bases/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/configs/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/configs/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/containers/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/containers/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/containers/types/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/containers/types/container_templates_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/api_error.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/client_wrapper.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/datetime_utils.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/file.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/http_client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/jsonable_encoder.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/pydantic_utilities.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/query_encoder.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/remove_none_from_dict.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/request_options.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/core/serialization.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/environments/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/environments/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/errors/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/errors/unprocessable_entity_error.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/evaluations/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/evaluations/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/evaluators/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/evaluators/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/human_evaluations/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/human_evaluations/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/observability/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/observability/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/observability/types/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/observability/types/format.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/observability/types/query_analytics_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/observability/types/query_traces_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/scopes/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/scopes/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/testsets/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/testsets/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/account_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_node_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_node_dto_nodes_value.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_nodes_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_root_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_roots_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_tree_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/agenta_trees_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/aggregated_result.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/aggregated_result_evaluator_config.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/analytics_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/app.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/app_variant_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/app_variant_revision.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/base_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/body_import_testset.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/bucket_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/collect_status_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/config_db.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/config_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/config_response_model.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/correct_answer.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/create_app_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/delete_evaluation.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/docker_env_vars.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/environment_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/environment_output_extended.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/environment_revision.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/error.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation_scenario.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation_scenario_input.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation_scenario_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation_scenario_result.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation_status_enum.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluation_type.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluator.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluator_config.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluator_mapping_output_interface.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/evaluator_output_interface.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/exception_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/get_config_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/header_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/http_validation_error.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/human_evaluation.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/human_evaluation_scenario.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/human_evaluation_scenario_input.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/human_evaluation_scenario_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/image.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/invite_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/legacy_analytics_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/legacy_data_point.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/legacy_scope_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/legacy_scopes_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/legacy_user_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/legacy_user_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/lifecycle_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/link_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/list_api_keys_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/llm_run_rate_limit.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/metrics_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/new_testset.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/node_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/node_type.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_context_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_event_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_extra_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_link_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_span_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_span_kind.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_spans_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/o_tel_status_code.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/organization.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/organization_membership_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/organization_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/organization_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/parent_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/permission.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/project_membership_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/project_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/project_scope.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/projects_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/provider_key_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/provider_kind.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/reference.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/reference_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/reference_request_model.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/result.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/role.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/root_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/scopes_response_model.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/score.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/secret_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/secret_kind.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/secret_response_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/simple_evaluation_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/span_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/span_dto_nodes_value.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/status_code.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/status_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/template.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/template_image_info.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/test_set_output_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/test_set_simple_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/time_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/tree_dto.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/tree_type.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/update_app_output.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/uri.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/user_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/validation_error.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/validation_error_loc_item.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/variant_action.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/variant_action_enum.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_member_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_membership_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_permission.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_request.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_role.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/types/workspace_role_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/variants/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/variants/client.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/variants/types/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/variants/types/add_variant_from_base_and_config_response.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/vault/__init__.py +0 -0
- {agenta-0.36.3/agenta/client/backend → agenta-0.36.5/agenta/client}/vault/client.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/config.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/config.toml +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/assets.py +0 -0
- {agenta-0.36.3/agenta/client → agenta-0.36.5/agenta/sdk/context}/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/context/exporting.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/context/routing.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/context/tracing.py +0 -0
- {agenta-0.36.3/agenta/sdk/context → agenta-0.36.5/agenta/sdk/decorators}/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/decorators/routing.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/decorators/tracing.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/litellm/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/litellm/litellm.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/litellm/mockllm.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/litellm/mocks/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/apps.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/config.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/deployment.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/secrets.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/variant.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/managers/vault.py +0 -0
- {agenta-0.36.3/agenta/sdk/decorators → agenta-0.36.5/agenta/sdk/middleware}/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/cors.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/inline.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/mock.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/middleware/otel.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/router.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/attributes.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/conventions.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/exporters.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/inline.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/processors.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/propagation.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/spans.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/tracing/tracing.py +0 -0
- {agenta-0.36.3/agenta/sdk/middleware → agenta-0.36.5/agenta/sdk/utils}/__init__.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/cache.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/constants.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/costs.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/exceptions.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/globals.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/helpers.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/logging.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/preinit.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/singleton.py +0 -0
- {agenta-0.36.3 → agenta-0.36.5}/agenta/sdk/utils/timing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: agenta
|
|
3
|
-
Version: 0.36.
|
|
3
|
+
Version: 0.36.5
|
|
4
4
|
Summary: The SDK for agenta is an open-source LLMOps platform.
|
|
5
5
|
Keywords: LLMOps,LLM,evaluation,prompt engineering
|
|
6
6
|
Author: Mahmoud Mabrouk
|
|
@@ -16,7 +16,6 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Classifier: Topic :: Software Development :: Libraries
|
|
18
18
|
Requires-Dist: cachetools (>=5.3.3,<6.0.0)
|
|
19
|
-
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
20
19
|
Requires-Dist: docker (>=6.1.1,<8.0.0)
|
|
21
20
|
Requires-Dist: fastapi (>=0.100.0)
|
|
22
21
|
Requires-Dist: httpx (>=0.24,<0.28)
|
|
@@ -2,7 +2,7 @@ from typing import Any, Callable, Optional
|
|
|
2
2
|
|
|
3
3
|
from .sdk.utils.preinit import PreInitObject
|
|
4
4
|
|
|
5
|
-
import agenta.client.
|
|
5
|
+
import agenta.client.types as client_types # pylint: disable=wrong-import-order
|
|
6
6
|
|
|
7
7
|
from .sdk.types import (
|
|
8
8
|
MCField,
|
|
@@ -37,7 +37,6 @@ from .sdk.managers.variant import VariantManager
|
|
|
37
37
|
from .sdk.managers.deployment import DeploymentManager
|
|
38
38
|
from .sdk import assets as assets
|
|
39
39
|
from .sdk import tracer
|
|
40
|
-
from .client.exceptions import APIRequestError
|
|
41
40
|
|
|
42
41
|
config = PreInitObject("agenta.config", Config)
|
|
43
42
|
DEFAULT_AGENTA_SINGLETON_INSTANCE = AgentaSingleton()
|
|
@@ -57,8 +56,8 @@ def init(
|
|
|
57
56
|
config_fname: Optional[str] = None,
|
|
58
57
|
redact: Optional[Callable[..., Any]] = None,
|
|
59
58
|
redact_on_error: Optional[bool] = True,
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
scope_type: Optional[str] = None,
|
|
60
|
+
scope_id: Optional[str] = None,
|
|
62
61
|
):
|
|
63
62
|
global api, async_api, tracing, tracer # pylint: disable=global-statement
|
|
64
63
|
|
|
@@ -68,7 +67,8 @@ def init(
|
|
|
68
67
|
config_fname=config_fname,
|
|
69
68
|
redact=redact,
|
|
70
69
|
redact_on_error=redact_on_error,
|
|
71
|
-
|
|
70
|
+
scope_type=scope_type,
|
|
71
|
+
scope_id=scope_id,
|
|
72
72
|
)
|
|
73
73
|
|
|
74
74
|
api = DEFAULT_AGENTA_SINGLETON_INSTANCE.api # type: ignore
|
|
@@ -8,7 +8,7 @@ To generate the client code using Fern, follow the steps below.
|
|
|
8
8
|
|
|
9
9
|
1. Open a Terminal and navigate to the folder where this Readme.md file is. For example;
|
|
10
10
|
```bash
|
|
11
|
-
cd agenta/
|
|
11
|
+
cd agenta/sdk/agenta/client
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
2. Next ensure you have installed Fern by executing the command;
|
|
@@ -68,7 +68,7 @@ groups:
|
|
|
68
68
|
version: 3.10.6
|
|
69
69
|
output:
|
|
70
70
|
location: local-file-system
|
|
71
|
-
path:
|
|
71
|
+
path: ./
|
|
72
72
|
```
|
|
73
73
|
<img width="1001" alt="image" src="https://github.com/Agenta-AI/agenta/assets/56418363/f537691d-8dbb-4363-b7c0-ecef9f464053">
|
|
74
74
|
|
|
@@ -82,7 +82,7 @@ groups:
|
|
|
82
82
|
fern generate
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
10. Go to `./
|
|
85
|
+
10. Go to `./containers/client.py`, search for the `build_image` function in the AgentaApi class and update `timeout_in_seconds` to `600` in `request_options'. It should now look like this;
|
|
86
86
|
```python
|
|
87
87
|
_response = self._client_wrapper.httpx_client.request(
|
|
88
88
|
"containers/build_image",
|
|
@@ -2,7 +2,7 @@ from typing import Optional, Callable, Any
|
|
|
2
2
|
|
|
3
3
|
from .utils.preinit import PreInitObject # always the first import!
|
|
4
4
|
|
|
5
|
-
import agenta.client.
|
|
5
|
+
import agenta.client.types as client_types # pylint: disable=wrong-import-order
|
|
6
6
|
|
|
7
7
|
from .types import (
|
|
8
8
|
DictInput,
|
|
@@ -32,7 +32,6 @@ from .managers.secrets import SecretsManager
|
|
|
32
32
|
from .managers.config import ConfigManager
|
|
33
33
|
from .managers.variant import VariantManager
|
|
34
34
|
from .managers.deployment import DeploymentManager
|
|
35
|
-
from ..client.exceptions import APIRequestError
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
config = PreInitObject("agenta.config", Config)
|
|
@@ -53,8 +52,8 @@ def init(
|
|
|
53
52
|
config_fname: Optional[str] = None,
|
|
54
53
|
redact: Optional[Callable[..., Any]] = None,
|
|
55
54
|
redact_on_error: Optional[bool] = True,
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
scope_type: Optional[str] = None,
|
|
56
|
+
scope_id: Optional[str] = None,
|
|
58
57
|
):
|
|
59
58
|
global api, async_api, tracing, tracer # pylint: disable=global-statement
|
|
60
59
|
|
|
@@ -64,7 +63,8 @@ def init(
|
|
|
64
63
|
config_fname=config_fname,
|
|
65
64
|
redact=redact,
|
|
66
65
|
redact_on_error=redact_on_error,
|
|
67
|
-
|
|
66
|
+
scope_type=scope_type,
|
|
67
|
+
scope_id=scope_id,
|
|
68
68
|
)
|
|
69
69
|
|
|
70
70
|
api = DEFAULT_AGENTA_SINGLETON_INSTANCE.api # type: ignore
|
|
@@ -5,7 +5,7 @@ from importlib.metadata import version
|
|
|
5
5
|
|
|
6
6
|
from agenta.sdk.utils.logging import log
|
|
7
7
|
from agenta.sdk.utils.globals import set_global
|
|
8
|
-
from agenta.client.
|
|
8
|
+
from agenta.client.client import AgentaApi, AsyncAgentaApi
|
|
9
9
|
|
|
10
10
|
from agenta.sdk.tracing import Tracing
|
|
11
11
|
from agenta.sdk.context.routing import routing_context
|
|
@@ -21,6 +21,13 @@ class AgentaSingleton:
|
|
|
21
21
|
api = None
|
|
22
22
|
async_api = None
|
|
23
23
|
|
|
24
|
+
def __init__(self):
|
|
25
|
+
self.host = None
|
|
26
|
+
self.api_key = None
|
|
27
|
+
|
|
28
|
+
self.scope_type = None
|
|
29
|
+
self.scope_id = None
|
|
30
|
+
|
|
24
31
|
def __new__(cls):
|
|
25
32
|
if not cls._instance:
|
|
26
33
|
cls._instance = super(AgentaSingleton, cls).__new__(cls)
|
|
@@ -34,30 +41,27 @@ class AgentaSingleton:
|
|
|
34
41
|
config_fname: Optional[str] = None,
|
|
35
42
|
redact: Optional[Callable[..., Any]] = None,
|
|
36
43
|
redact_on_error: Optional[bool] = True,
|
|
37
|
-
|
|
38
|
-
|
|
44
|
+
scope_type: Optional[str] = None,
|
|
45
|
+
scope_id: Optional[str] = None,
|
|
39
46
|
) -> None:
|
|
40
47
|
"""
|
|
41
48
|
Main function to initialize the singleton.
|
|
42
49
|
|
|
43
|
-
Initializes the singleton with the given `
|
|
50
|
+
Initializes the singleton with the given `host`, and `api_key`. The order of precedence for these variables is:
|
|
44
51
|
1. Explicit argument provided in the function call.
|
|
45
52
|
2. Value from the configuration file specified by `config_fname`.
|
|
46
53
|
3. Environment variables.
|
|
47
54
|
|
|
48
55
|
Examples:
|
|
49
|
-
ag.init(
|
|
56
|
+
ag.init(api_key="xxx")
|
|
50
57
|
ag.init(config_fname="config.toml")
|
|
51
58
|
ag.init() #assuming env vars are set
|
|
52
59
|
|
|
53
60
|
Args:
|
|
54
|
-
app_id (Optional[str]): ID of the Agenta application. Defaults to None. If not provided, will look for "app_id" in the config file, then "AGENTA_APP_ID" in environment variables.
|
|
55
61
|
host (Optional[str]): Host name of the backend server. Defaults to None. If not provided, will look for "backend_host" in the config file, then "AGENTA_HOST" in environment variables.
|
|
56
62
|
api_key (Optional[str]): API Key to use with the host of the backend server. Defaults to None. If not provided, will look for "api_key" in the config file, then "AGENTA_API_KEY" in environment variables.
|
|
57
63
|
config_fname (Optional[str]): Path to the configuration file (relative or absolute). Defaults to None.
|
|
58
64
|
|
|
59
|
-
Raises:
|
|
60
|
-
ValueError: If `app_id` is not specified either as an argument, in the config file, or in the environment variables.
|
|
61
65
|
"""
|
|
62
66
|
|
|
63
67
|
log.info("Agenta - SDK version: %s", version("agenta"))
|
|
@@ -76,21 +80,21 @@ class AgentaSingleton:
|
|
|
76
80
|
|
|
77
81
|
log.info("Agenta - Host: %s", self.host)
|
|
78
82
|
|
|
79
|
-
self.app_id = app_id or config.get("app_id") or getenv("AGENTA_APP_ID")
|
|
80
|
-
# if not self.app_id:
|
|
81
|
-
# raise ValueError(
|
|
82
|
-
# "App ID must be specified. You can provide it in one of the following ways:\n"
|
|
83
|
-
# "1. As an argument when calling ag.init(app_id='your_app_id').\n"
|
|
84
|
-
# "2. In the configuration file specified by config_fname.\n"
|
|
85
|
-
# "3. As an environment variable 'AGENTA_APP_ID'."
|
|
86
|
-
# )
|
|
87
|
-
|
|
88
83
|
self.api_key = api_key or getenv("AGENTA_API_KEY") or config.get("api_key")
|
|
89
84
|
|
|
90
|
-
self.
|
|
85
|
+
self.scope_type = (
|
|
86
|
+
scope_type
|
|
87
|
+
or getenv("AGENTA_SCOPE_TYPE")
|
|
88
|
+
or config.get("scope_type")
|
|
89
|
+
or None
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
self.scope_id = (
|
|
93
|
+
scope_id or getenv("AGENTA_SCOPE_ID") or config.get("scope_id") or None
|
|
94
|
+
)
|
|
91
95
|
|
|
92
96
|
self.tracing = Tracing(
|
|
93
|
-
url=f"{self.host}/api/
|
|
97
|
+
url=f"{self.host}/api/otlp/v1/traces", # type: ignore
|
|
94
98
|
redact=redact,
|
|
95
99
|
redact_on_error=redact_on_error,
|
|
96
100
|
)
|
|
@@ -111,7 +115,6 @@ class AgentaSingleton:
|
|
|
111
115
|
|
|
112
116
|
self.config = Config(
|
|
113
117
|
host=self.host,
|
|
114
|
-
base_id=self.base_id,
|
|
115
118
|
api_key=self.api_key,
|
|
116
119
|
)
|
|
117
120
|
|
|
@@ -119,11 +122,6 @@ class AgentaSingleton:
|
|
|
119
122
|
class Config:
|
|
120
123
|
def __init__(
|
|
121
124
|
self,
|
|
122
|
-
# LEGACY
|
|
123
|
-
host: Optional[str] = None,
|
|
124
|
-
base_id: Optional[str] = None,
|
|
125
|
-
api_key: Optional[str] = None,
|
|
126
|
-
# LEGACY
|
|
127
125
|
**kwargs,
|
|
128
126
|
):
|
|
129
127
|
self.default_parameters = {**kwargs}
|
|
@@ -155,26 +153,6 @@ class Config:
|
|
|
155
153
|
|
|
156
154
|
return None
|
|
157
155
|
|
|
158
|
-
### --- LEGACY --- ###
|
|
159
|
-
|
|
160
|
-
def register_default(self, overwrite=False, **kwargs):
|
|
161
|
-
"""alias for default"""
|
|
162
|
-
return self.default(overwrite=overwrite, **kwargs)
|
|
163
|
-
|
|
164
|
-
def default(self, overwrite=False, **kwargs):
|
|
165
|
-
"""Saves the default parameters to the app_name and base_name in case they are not already saved.
|
|
166
|
-
Args:
|
|
167
|
-
overwrite: Whether to overwrite the existing configuration or not
|
|
168
|
-
**kwargs: A dict containing the parameters
|
|
169
|
-
"""
|
|
170
|
-
self.set(**kwargs)
|
|
171
|
-
|
|
172
|
-
def set(self, **kwargs):
|
|
173
|
-
self.set_default(**kwargs)
|
|
174
|
-
|
|
175
|
-
def all(self):
|
|
176
|
-
return self.default_parameters
|
|
177
|
-
|
|
178
156
|
|
|
179
157
|
def init(
|
|
180
158
|
host: Optional[str] = None,
|
|
@@ -182,29 +160,24 @@ def init(
|
|
|
182
160
|
config_fname: Optional[str] = None,
|
|
183
161
|
redact: Optional[Callable[..., Any]] = None,
|
|
184
162
|
redact_on_error: Optional[bool] = True,
|
|
185
|
-
|
|
186
|
-
|
|
163
|
+
scope_type: Optional[str] = None,
|
|
164
|
+
scope_id: Optional[str] = None,
|
|
187
165
|
):
|
|
188
166
|
"""Main function to initialize the agenta sdk.
|
|
189
167
|
|
|
190
|
-
Initializes agenta with the given `
|
|
168
|
+
Initializes agenta with the given `host`, and `api_key`. The order of precedence for these variables is:
|
|
191
169
|
1. Explicit argument provided in the function call.
|
|
192
170
|
2. Value from the configuration file specified by `config_fname`.
|
|
193
171
|
3. Environment variables.
|
|
194
172
|
|
|
195
|
-
- `app_id` is a required parameter (to be specified in one of the above ways)
|
|
196
173
|
- `host` is optional and defaults to "https://cloud.agenta.ai"
|
|
197
174
|
- `api_key` is optional and defaults to "". It is required only when using cloud or enterprise version of agenta.
|
|
198
175
|
|
|
199
176
|
|
|
200
177
|
Args:
|
|
201
|
-
app_id (Optional[str]): ID of the Agenta application. Defaults to None. If not provided, will look for "app_id" in the config file, then "AGENTA_APP_ID" in environment variables.
|
|
202
178
|
host (Optional[str]): Host name of the backend server. Defaults to None. If not provided, will look for "backend_host" in the config file, then "AGENTA_HOST" in environment variables.
|
|
203
179
|
api_key (Optional[str]): API Key to use with the host of the backend server. Defaults to None. If not provided, will look for "api_key" in the config file, then "AGENTA_API_KEY" in environment variables.
|
|
204
180
|
config_fname (Optional[str]): Path to the configuration file. Defaults to None.
|
|
205
|
-
|
|
206
|
-
Raises:
|
|
207
|
-
ValueError: If `app_id` is not specified either as an argument, in the config file, or in the environment variables.
|
|
208
181
|
"""
|
|
209
182
|
|
|
210
183
|
singleton = AgentaSingleton()
|
|
@@ -215,7 +188,8 @@ def init(
|
|
|
215
188
|
config_fname=config_fname,
|
|
216
189
|
redact=redact,
|
|
217
190
|
redact_on_error=redact_on_error,
|
|
218
|
-
|
|
191
|
+
scope_type=scope_type,
|
|
192
|
+
scope_id=scope_id,
|
|
219
193
|
)
|
|
220
194
|
|
|
221
195
|
set_global(
|
|
@@ -7,9 +7,9 @@ from agenta.sdk.types import (
|
|
|
7
7
|
ConfigurationResponse,
|
|
8
8
|
DeploymentResponse,
|
|
9
9
|
)
|
|
10
|
-
from agenta.client.
|
|
11
|
-
from agenta.client.
|
|
12
|
-
from agenta.client.
|
|
10
|
+
from agenta.client.types.config_dto import ConfigDto as ConfigRequest
|
|
11
|
+
from agenta.client.types.config_response_model import ConfigResponseModel
|
|
12
|
+
from agenta.client.types.reference_request_model import ReferenceRequestModel
|
|
13
13
|
|
|
14
14
|
import agenta as ag
|
|
15
15
|
|
|
@@ -55,6 +55,9 @@ class AuthMiddleware(BaseHTTPMiddleware):
|
|
|
55
55
|
|
|
56
56
|
self.host = ag.DEFAULT_AGENTA_SINGLETON_INSTANCE.host
|
|
57
57
|
|
|
58
|
+
self.scope_type = ag.DEFAULT_AGENTA_SINGLETON_INSTANCE.scope_type
|
|
59
|
+
self.scope_id = ag.DEFAULT_AGENTA_SINGLETON_INSTANCE.scope_id
|
|
60
|
+
|
|
58
61
|
async def dispatch(self, request: Request, call_next: Callable):
|
|
59
62
|
try:
|
|
60
63
|
if request.url.path in _ALWAYS_ALLOW_LIST:
|
|
@@ -85,33 +88,39 @@ class AuthMiddleware(BaseHTTPMiddleware):
|
|
|
85
88
|
|
|
86
89
|
async def _get_credentials(self, request: Request) -> Optional[str]:
|
|
87
90
|
try:
|
|
91
|
+
# HEADERS
|
|
88
92
|
authorization = request.headers.get("authorization", None)
|
|
89
|
-
|
|
90
93
|
headers = {"Authorization": authorization} if authorization else None
|
|
91
94
|
|
|
95
|
+
# COOKIES
|
|
92
96
|
access_token = request.cookies.get("sAccessToken", None)
|
|
93
|
-
|
|
94
97
|
cookies = {"sAccessToken": access_token} if access_token else None
|
|
95
98
|
|
|
96
99
|
if not headers and not cookies:
|
|
97
100
|
log.debug("No auth header nor auth cookie found in the request")
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
# PARAMS
|
|
103
|
+
params = {}
|
|
104
|
+
## PROJECT_ID
|
|
101
105
|
project_id = (
|
|
102
106
|
# CLEANEST
|
|
103
|
-
baggage.get("project_id")
|
|
107
|
+
request.state.otel["baggage"].get("project_id")
|
|
104
108
|
# ALTERNATIVE
|
|
105
109
|
or request.query_params.get("project_id")
|
|
106
110
|
)
|
|
107
|
-
|
|
108
111
|
if not project_id:
|
|
109
112
|
log.debug("No project ID found in request")
|
|
110
|
-
|
|
111
|
-
params = {"action": "run_service", "resource_type": "service"}
|
|
112
|
-
|
|
113
113
|
if project_id:
|
|
114
114
|
params["project_id"] = project_id
|
|
115
|
+
## SCOPE
|
|
116
|
+
if self.scope_type and self.scope_id:
|
|
117
|
+
params["scope_type"] = self.scope_type
|
|
118
|
+
params["scope_id"] = self.scope_id
|
|
119
|
+
## ACTION
|
|
120
|
+
params["action"] = "run_service"
|
|
121
|
+
## RESOURCE
|
|
122
|
+
params["resource_type"] = "service"
|
|
123
|
+
# params["resource_id"] = None
|
|
115
124
|
|
|
116
125
|
_hash = dumps(
|
|
117
126
|
{
|
|
@@ -33,7 +33,6 @@ class ConfigMiddleware(BaseHTTPMiddleware):
|
|
|
33
33
|
super().__init__(app)
|
|
34
34
|
|
|
35
35
|
self.host = ag.DEFAULT_AGENTA_SINGLETON_INSTANCE.host
|
|
36
|
-
self.application_id = ag.DEFAULT_AGENTA_SINGLETON_INSTANCE.app_id
|
|
37
36
|
|
|
38
37
|
async def dispatch(
|
|
39
38
|
self,
|
|
@@ -153,7 +152,6 @@ class ConfigMiddleware(BaseHTTPMiddleware):
|
|
|
153
152
|
# LEGACY
|
|
154
153
|
or baggage.get("application_id")
|
|
155
154
|
or request.query_params.get("app_id")
|
|
156
|
-
or self.application_id
|
|
157
155
|
)
|
|
158
156
|
application_slug = (
|
|
159
157
|
# CLEANEST
|
|
@@ -7,10 +7,10 @@ from fastapi import FastAPI, Request
|
|
|
7
7
|
from starlette.middleware.base import BaseHTTPMiddleware
|
|
8
8
|
|
|
9
9
|
from agenta.sdk.utils.constants import TRUTHY
|
|
10
|
-
from agenta.client.
|
|
10
|
+
from agenta.client.types.provider_kind import ProviderKind
|
|
11
11
|
from agenta.sdk.utils.exceptions import suppress, display_exception
|
|
12
|
-
from agenta.client.
|
|
13
|
-
from agenta.client.
|
|
12
|
+
from agenta.client.types.secret_dto import SecretDto as SecretDTO
|
|
13
|
+
from agenta.client.types.provider_key_dto import (
|
|
14
14
|
ProviderKeyDto as ProviderKeyDTO,
|
|
15
15
|
)
|
|
16
16
|
from agenta.sdk.utils.cache import TTLLRUCache
|
|
@@ -4,8 +4,8 @@ from typing import Dict, List, Optional, Any, Union
|
|
|
4
4
|
|
|
5
5
|
from pydantic import ConfigDict, BaseModel, HttpUrl
|
|
6
6
|
|
|
7
|
-
from agenta.client.
|
|
8
|
-
from agenta.client.
|
|
7
|
+
from agenta.client.types.agenta_node_dto import AgentaNodeDto
|
|
8
|
+
from agenta.client.types.agenta_nodes_response import AgentaNodesResponse
|
|
9
9
|
from typing import Annotated, List, Union, Optional, Dict, Literal, Any
|
|
10
10
|
from pydantic import BaseModel, Field, model_validator
|
|
11
11
|
from agenta.sdk.assets import supported_llm_models
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "agenta"
|
|
3
|
-
version = "0.36.
|
|
3
|
+
version = "0.36.5"
|
|
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>"]
|
|
@@ -22,7 +22,6 @@ exclude = [
|
|
|
22
22
|
[tool.poetry.dependencies]
|
|
23
23
|
python = "^3.9"
|
|
24
24
|
docker = ">=6.1.1,<8.0.0"
|
|
25
|
-
click = "^8.1.3"
|
|
26
25
|
fastapi = ">=0.100.0"
|
|
27
26
|
toml = "^0.10.2"
|
|
28
27
|
questionary = ">=1.10,<3.0"
|
|
@@ -53,6 +52,3 @@ boto3 = "^1.35.87"
|
|
|
53
52
|
[build-system]
|
|
54
53
|
requires = ["poetry-core"]
|
|
55
54
|
build-backend = "poetry.core.masonry.api"
|
|
56
|
-
|
|
57
|
-
[tool.poetry.scripts]
|
|
58
|
-
agenta = "agenta.cli.main:cli"
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
import toml
|
|
4
|
-
import click
|
|
5
|
-
import questionary
|
|
6
|
-
from pathlib import Path
|
|
7
|
-
from typing import Any, List, MutableMapping
|
|
8
|
-
from agenta.client.api_models import AppVariant
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from typing import Any, Optional
|
|
12
|
-
from pathlib import Path
|
|
13
|
-
import toml
|
|
14
|
-
|
|
15
|
-
from agenta.client.backend.client import AgentaApi
|
|
16
|
-
|
|
17
|
-
BACKEND_URL_SUFFIX = os.environ.get("BACKEND_URL_SUFFIX", "api")
|
|
18
|
-
POSTHOG_KEY = os.environ.get(
|
|
19
|
-
"POSTHOG_KEY", "phc_hmVSxIjTW1REBHXgj2aw4HW9X6CXb6FzerBgP9XenC7"
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def get_global_config(var_name: str) -> Optional[Any]:
|
|
24
|
-
"""
|
|
25
|
-
Get the value of a global configuration variable.
|
|
26
|
-
|
|
27
|
-
Args:
|
|
28
|
-
var_name: the name of the variable to get
|
|
29
|
-
|
|
30
|
-
Returns:
|
|
31
|
-
the value of the variable, or None if it doesn't exist
|
|
32
|
-
"""
|
|
33
|
-
agenta_dir = Path.home() / ".agenta"
|
|
34
|
-
if not agenta_dir.exists():
|
|
35
|
-
return None
|
|
36
|
-
agenta_config_file = agenta_dir / "config.toml"
|
|
37
|
-
if not agenta_config_file.exists():
|
|
38
|
-
return None
|
|
39
|
-
global_config = toml.load(agenta_config_file)
|
|
40
|
-
if var_name not in global_config:
|
|
41
|
-
return None
|
|
42
|
-
return global_config[var_name]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def set_global_config(var_name: str, var_value: Any) -> None:
|
|
46
|
-
"""
|
|
47
|
-
Set the value of a global configuration variable.
|
|
48
|
-
|
|
49
|
-
Args:
|
|
50
|
-
var_name: the name of the variable to set
|
|
51
|
-
var_value: the value to set the variable to
|
|
52
|
-
"""
|
|
53
|
-
agenta_dir = Path.home() / ".agenta"
|
|
54
|
-
if not agenta_dir.exists():
|
|
55
|
-
agenta_dir.mkdir(exist_ok=True)
|
|
56
|
-
agenta_config_file = agenta_dir / "config.toml"
|
|
57
|
-
if not agenta_config_file.exists():
|
|
58
|
-
config = {}
|
|
59
|
-
with agenta_config_file.open("w") as config_file:
|
|
60
|
-
toml.dump(config, config_file)
|
|
61
|
-
global_config = toml.load(agenta_config_file)
|
|
62
|
-
global_config[var_name] = var_value
|
|
63
|
-
with open(agenta_config_file, "w") as config_file:
|
|
64
|
-
toml.dump(global_config, config_file)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def get_api_key(backend_host: str) -> str:
|
|
68
|
-
"""
|
|
69
|
-
Retrieve or request the API key for accessing the Agenta platform.
|
|
70
|
-
|
|
71
|
-
This function first looks for an existing API key in the global config file.
|
|
72
|
-
If found, it prompts the user to confirm whether they'd like to use that key.
|
|
73
|
-
If not found, it asks the user to input a new key.
|
|
74
|
-
|
|
75
|
-
Args:
|
|
76
|
-
backend_host (str): The URL of the backend host.
|
|
77
|
-
|
|
78
|
-
Returns:
|
|
79
|
-
str: The API key to be used for accessing the Agenta platform.
|
|
80
|
-
|
|
81
|
-
Raises:
|
|
82
|
-
SystemExit: If the user cancels the input by pressing Ctrl+C.
|
|
83
|
-
"""
|
|
84
|
-
|
|
85
|
-
api_key = get_global_config("api_key")
|
|
86
|
-
if api_key:
|
|
87
|
-
# API key exists in the config file, ask for confirmation
|
|
88
|
-
confirm_api_key = questionary.confirm(
|
|
89
|
-
f"API Key found: {api_key}\nDo you want to use this API Key?"
|
|
90
|
-
).ask()
|
|
91
|
-
|
|
92
|
-
if confirm_api_key:
|
|
93
|
-
return api_key
|
|
94
|
-
elif confirm_api_key is None: # User pressed Ctrl+C
|
|
95
|
-
sys.exit(0)
|
|
96
|
-
|
|
97
|
-
api_key = questionary.text(
|
|
98
|
-
f"(You can get your API Key here: {backend_host}/settings?tab=apiKeys) "
|
|
99
|
-
"Please provide your API key:"
|
|
100
|
-
).ask()
|
|
101
|
-
|
|
102
|
-
if api_key:
|
|
103
|
-
set_global_config("api_key", api_key.strip())
|
|
104
|
-
|
|
105
|
-
return api_key
|
|
106
|
-
elif api_key is None: # User pressed Ctrl+C
|
|
107
|
-
sys.exit(0)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
def init_telemetry_config() -> None:
|
|
111
|
-
if (
|
|
112
|
-
get_global_config("telemetry_tracking_enabled") is None
|
|
113
|
-
or get_global_config("telemetry_api_key") is None
|
|
114
|
-
):
|
|
115
|
-
set_global_config("telemetry_tracking_enabled", True)
|
|
116
|
-
set_global_config(
|
|
117
|
-
"telemetry_api_key",
|
|
118
|
-
POSTHOG_KEY,
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def update_variants_from_backend(
|
|
123
|
-
app_id: str,
|
|
124
|
-
config: MutableMapping[str, Any],
|
|
125
|
-
host: str,
|
|
126
|
-
api_key: str = None,
|
|
127
|
-
) -> MutableMapping[str, Any]:
|
|
128
|
-
"""Reads the list of variants from the backend and updates the config accordingly
|
|
129
|
-
|
|
130
|
-
Arguments:
|
|
131
|
-
app_id -- the app id
|
|
132
|
-
config -- the config loaded using toml.load
|
|
133
|
-
api_key -- the api key to use for authentication
|
|
134
|
-
|
|
135
|
-
Returns:
|
|
136
|
-
a new config object later to be saved using toml.dump(config, config_file.open('w'))
|
|
137
|
-
"""
|
|
138
|
-
client = AgentaApi(
|
|
139
|
-
base_url=f"{host}/{BACKEND_URL_SUFFIX}",
|
|
140
|
-
api_key=api_key,
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
try:
|
|
144
|
-
variants: List[AppVariant] = client.apps.list_app_variants(app_id=app_id)
|
|
145
|
-
except Exception as ex:
|
|
146
|
-
raise ex
|
|
147
|
-
|
|
148
|
-
config["variants"] = [variant.variant_name for variant in variants]
|
|
149
|
-
config["variant_ids"] = [variant.variant_id for variant in variants]
|
|
150
|
-
return config
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
def update_config_from_backend(config_file: Path, host: str):
|
|
154
|
-
"""Updates the config file with new information from the backend
|
|
155
|
-
|
|
156
|
-
Arguments:
|
|
157
|
-
config_file -- the path to the config file
|
|
158
|
-
"""
|
|
159
|
-
assert config_file.exists(), "Config file does not exist!"
|
|
160
|
-
config = toml.load(config_file)
|
|
161
|
-
app_id = config["app_id"]
|
|
162
|
-
api_key = config.get("api_key", "")
|
|
163
|
-
if "variants" not in config:
|
|
164
|
-
config["variants"] = []
|
|
165
|
-
if "variant_ids" not in config:
|
|
166
|
-
config["variant_ids"] = []
|
|
167
|
-
config = update_variants_from_backend(app_id, config, host, api_key)
|
|
168
|
-
toml.dump(config, config_file.open("w"))
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
def display_app_variant(variant: AppVariant):
|
|
172
|
-
"""Prints a variant nicely in the terminal"""
|
|
173
|
-
click.echo(
|
|
174
|
-
click.style("App Name: ", bold=True, fg="green")
|
|
175
|
-
+ click.style(variant.app_name, fg="green")
|
|
176
|
-
)
|
|
177
|
-
click.echo(
|
|
178
|
-
click.style("Variant Name: ", bold=True, fg="blue")
|
|
179
|
-
+ click.style(variant.variant_name, fg="blue")
|
|
180
|
-
)
|
|
181
|
-
click.echo(click.style("Parameters: ", bold=True, fg="cyan"))
|
|
182
|
-
if variant.parameters:
|
|
183
|
-
for param, value in variant.parameters.items():
|
|
184
|
-
click.echo(
|
|
185
|
-
click.style(f" {param}: ", fg="cyan")
|
|
186
|
-
+ click.style(str(value), fg="cyan")
|
|
187
|
-
)
|
|
188
|
-
else:
|
|
189
|
-
click.echo(click.style(" Defaults from code", fg="cyan"))
|
|
190
|
-
if variant.previous_variant_name:
|
|
191
|
-
click.echo(
|
|
192
|
-
click.style("Template Variant Name: ", bold=True, fg="magenta")
|
|
193
|
-
+ click.style(variant.previous_variant_name, fg="magenta")
|
|
194
|
-
)
|
|
195
|
-
else:
|
|
196
|
-
click.echo(
|
|
197
|
-
click.style("Template Variant Name: ", bold=True, fg="magenta")
|
|
198
|
-
+ click.style("None", fg="magenta")
|
|
199
|
-
)
|
|
200
|
-
click.echo(
|
|
201
|
-
click.style("-" * 50, bold=True, fg="white")
|
|
202
|
-
) # a line for separating each variant
|