nvidia-nat 1.4.0a20251112__py3-none-any.whl → 1.4.0a20260113__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiq/__init__.py +1 -1
- nat/{front_ends/mcp → agent/auto_memory_wrapper}/__init__.py +1 -1
- nat/agent/auto_memory_wrapper/agent.py +278 -0
- nat/agent/auto_memory_wrapper/register.py +227 -0
- nat/agent/auto_memory_wrapper/state.py +30 -0
- nat/agent/base.py +1 -1
- nat/agent/dual_node.py +1 -1
- nat/agent/prompt_optimizer/prompt.py +1 -1
- nat/agent/prompt_optimizer/register.py +1 -1
- nat/agent/react_agent/agent.py +16 -9
- nat/agent/react_agent/output_parser.py +2 -2
- nat/agent/react_agent/prompt.py +3 -2
- nat/agent/react_agent/register.py +2 -2
- nat/agent/react_agent/register_per_user_agent.py +104 -0
- nat/agent/reasoning_agent/reasoning_agent.py +1 -1
- nat/agent/register.py +3 -1
- nat/agent/responses_api_agent/__init__.py +1 -1
- nat/agent/responses_api_agent/register.py +1 -1
- nat/agent/rewoo_agent/agent.py +9 -4
- nat/agent/rewoo_agent/prompt.py +1 -1
- nat/agent/rewoo_agent/register.py +1 -1
- nat/agent/tool_calling_agent/agent.py +5 -4
- nat/agent/tool_calling_agent/register.py +1 -1
- nat/authentication/__init__.py +1 -1
- nat/authentication/api_key/__init__.py +1 -1
- nat/authentication/api_key/api_key_auth_provider.py +1 -1
- nat/authentication/api_key/api_key_auth_provider_config.py +22 -7
- nat/authentication/api_key/register.py +1 -1
- nat/authentication/credential_validator/__init__.py +1 -1
- nat/authentication/credential_validator/bearer_token_validator.py +1 -1
- nat/authentication/exceptions/__init__.py +1 -1
- nat/authentication/exceptions/api_key_exceptions.py +1 -1
- nat/authentication/http_basic_auth/http_basic_auth_provider.py +1 -1
- nat/authentication/http_basic_auth/register.py +1 -1
- nat/authentication/interfaces.py +1 -1
- nat/authentication/oauth2/__init__.py +1 -1
- nat/authentication/oauth2/oauth2_auth_code_flow_provider.py +1 -1
- nat/authentication/oauth2/oauth2_auth_code_flow_provider_config.py +1 -1
- nat/authentication/oauth2/oauth2_resource_server_config.py +1 -1
- nat/authentication/oauth2/register.py +1 -1
- nat/authentication/register.py +1 -1
- nat/builder/builder.py +563 -1
- nat/builder/child_builder.py +385 -0
- nat/builder/component_utils.py +34 -4
- nat/builder/context.py +34 -1
- nat/builder/embedder.py +1 -1
- nat/builder/eval_builder.py +19 -7
- nat/builder/evaluator.py +1 -1
- nat/builder/framework_enum.py +3 -1
- nat/builder/front_end.py +1 -1
- nat/builder/function.py +113 -5
- nat/builder/function_base.py +1 -1
- nat/builder/function_info.py +1 -1
- nat/builder/intermediate_step_manager.py +1 -1
- nat/builder/llm.py +1 -1
- nat/builder/per_user_workflow_builder.py +843 -0
- nat/builder/retriever.py +1 -1
- nat/builder/sync_builder.py +571 -0
- nat/builder/user_interaction_manager.py +1 -1
- nat/builder/workflow.py +5 -3
- nat/builder/workflow_builder.py +619 -378
- nat/cli/__init__.py +1 -1
- nat/cli/cli_utils/config_override.py +1 -1
- nat/cli/cli_utils/validation.py +32 -1
- nat/cli/commands/configure/channel/add.py +1 -1
- nat/cli/commands/configure/channel/channel.py +1 -1
- nat/cli/commands/configure/channel/remove.py +1 -1
- nat/cli/commands/configure/channel/update.py +1 -1
- nat/cli/commands/configure/configure.py +1 -1
- nat/cli/commands/evaluate.py +87 -13
- nat/cli/commands/finetune.py +132 -0
- nat/cli/commands/info/__init__.py +1 -1
- nat/cli/commands/info/info.py +1 -1
- nat/cli/commands/info/list_channels.py +1 -1
- nat/cli/commands/info/list_components.py +1 -1
- nat/cli/commands/object_store/__init__.py +1 -1
- nat/cli/commands/object_store/object_store.py +1 -1
- nat/cli/commands/optimize.py +1 -1
- nat/cli/commands/{mcp → red_teaming}/__init__.py +1 -1
- nat/cli/commands/red_teaming/red_teaming.py +138 -0
- nat/cli/commands/red_teaming/red_teaming_utils.py +73 -0
- nat/cli/commands/registry/__init__.py +1 -1
- nat/cli/commands/registry/publish.py +1 -1
- nat/cli/commands/registry/pull.py +1 -1
- nat/cli/commands/registry/registry.py +1 -1
- nat/cli/commands/registry/remove.py +1 -1
- nat/cli/commands/registry/search.py +1 -1
- nat/cli/commands/sizing/__init__.py +1 -1
- nat/cli/commands/sizing/calc.py +1 -1
- nat/cli/commands/sizing/sizing.py +1 -1
- nat/cli/commands/start.py +1 -1
- nat/cli/commands/uninstall.py +1 -1
- nat/cli/commands/validate.py +1 -1
- nat/cli/commands/workflow/__init__.py +1 -1
- nat/cli/commands/workflow/workflow.py +1 -1
- nat/cli/commands/workflow/workflow_commands.py +3 -2
- nat/cli/entrypoint.py +15 -37
- nat/cli/main.py +2 -2
- nat/cli/plugin_loader.py +69 -0
- nat/cli/register_workflow.py +233 -5
- nat/cli/type_registry.py +237 -3
- nat/control_flow/register.py +1 -1
- nat/control_flow/router_agent/agent.py +1 -1
- nat/control_flow/router_agent/prompt.py +1 -1
- nat/control_flow/router_agent/register.py +1 -1
- nat/control_flow/sequential_executor.py +28 -7
- nat/data_models/__init__.py +1 -1
- nat/data_models/agent.py +1 -1
- nat/data_models/api_server.py +38 -3
- nat/data_models/authentication.py +1 -1
- nat/data_models/common.py +1 -1
- nat/data_models/component.py +9 -1
- nat/data_models/component_ref.py +45 -1
- nat/data_models/config.py +78 -1
- nat/data_models/dataset_handler.py +15 -2
- nat/data_models/discovery_metadata.py +1 -1
- nat/data_models/embedder.py +1 -1
- nat/data_models/evaluate.py +6 -1
- nat/data_models/evaluator.py +1 -1
- nat/data_models/finetuning.py +260 -0
- nat/data_models/front_end.py +1 -1
- nat/data_models/function.py +15 -2
- nat/data_models/function_dependencies.py +1 -1
- nat/data_models/gated_field_mixin.py +1 -1
- nat/data_models/interactive.py +1 -1
- nat/data_models/intermediate_step.py +29 -2
- nat/data_models/invocation_node.py +1 -1
- nat/data_models/llm.py +1 -1
- nat/data_models/logging.py +1 -1
- nat/data_models/memory.py +1 -1
- nat/data_models/middleware.py +37 -0
- nat/data_models/object_store.py +1 -1
- nat/data_models/openai_mcp.py +1 -1
- nat/data_models/optimizable.py +1 -1
- nat/data_models/optimizer.py +1 -1
- nat/data_models/profiler.py +1 -1
- nat/data_models/registry_handler.py +1 -1
- nat/data_models/retriever.py +1 -1
- nat/data_models/retry_mixin.py +1 -1
- nat/data_models/runtime_enum.py +26 -0
- nat/data_models/span.py +1 -1
- nat/data_models/step_adaptor.py +1 -1
- nat/data_models/streaming.py +1 -1
- nat/data_models/swe_bench_model.py +1 -1
- nat/data_models/telemetry_exporter.py +1 -1
- nat/data_models/thinking_mixin.py +1 -1
- nat/data_models/ttc_strategy.py +1 -1
- nat/embedder/azure_openai_embedder.py +1 -1
- nat/embedder/nim_embedder.py +1 -1
- nat/embedder/openai_embedder.py +1 -1
- nat/embedder/register.py +1 -1
- nat/eval/__init__.py +1 -1
- nat/eval/config.py +8 -1
- nat/eval/dataset_handler/dataset_downloader.py +1 -1
- nat/eval/dataset_handler/dataset_filter.py +1 -1
- nat/eval/dataset_handler/dataset_handler.py +4 -2
- nat/eval/evaluate.py +226 -81
- nat/eval/evaluator/__init__.py +1 -1
- nat/eval/evaluator/base_evaluator.py +2 -2
- nat/eval/evaluator/evaluator_model.py +3 -2
- nat/eval/intermediate_step_adapter.py +1 -1
- nat/eval/llm_validator.py +336 -0
- nat/eval/rag_evaluator/evaluate.py +17 -10
- nat/eval/rag_evaluator/register.py +1 -1
- nat/eval/red_teaming_evaluator/__init__.py +14 -0
- nat/eval/red_teaming_evaluator/data_models.py +66 -0
- nat/eval/red_teaming_evaluator/evaluate.py +327 -0
- nat/eval/red_teaming_evaluator/filter_conditions.py +75 -0
- nat/eval/red_teaming_evaluator/register.py +55 -0
- nat/eval/register.py +2 -1
- nat/eval/remote_workflow.py +1 -1
- nat/eval/runners/__init__.py +1 -1
- nat/eval/runners/config.py +1 -1
- nat/eval/runners/multi_eval_runner.py +1 -1
- nat/eval/runners/red_teaming_runner/__init__.py +24 -0
- nat/eval/runners/red_teaming_runner/config.py +282 -0
- nat/eval/runners/red_teaming_runner/report_utils.py +707 -0
- nat/eval/runners/red_teaming_runner/runner.py +867 -0
- nat/eval/runtime_evaluator/__init__.py +1 -1
- nat/eval/runtime_evaluator/evaluate.py +1 -1
- nat/eval/runtime_evaluator/register.py +1 -1
- nat/eval/runtime_event_subscriber.py +1 -1
- nat/eval/swe_bench_evaluator/evaluate.py +1 -1
- nat/eval/swe_bench_evaluator/register.py +1 -1
- nat/eval/trajectory_evaluator/evaluate.py +2 -2
- nat/eval/trajectory_evaluator/register.py +1 -1
- nat/eval/tunable_rag_evaluator/evaluate.py +5 -5
- nat/eval/tunable_rag_evaluator/register.py +1 -1
- nat/eval/usage_stats.py +1 -1
- nat/eval/utils/eval_trace_ctx.py +1 -1
- nat/eval/utils/output_uploader.py +1 -1
- nat/eval/utils/tqdm_position_registry.py +1 -1
- nat/eval/utils/weave_eval.py +1 -1
- nat/experimental/decorators/experimental_warning_decorator.py +1 -1
- nat/experimental/test_time_compute/editing/iterative_plan_refinement_editor.py +1 -1
- nat/experimental/test_time_compute/editing/llm_as_a_judge_editor.py +1 -1
- nat/experimental/test_time_compute/editing/motivation_aware_summarization.py +1 -1
- nat/experimental/test_time_compute/functions/execute_score_select_function.py +1 -1
- nat/experimental/test_time_compute/functions/multi_llm_judge_function.py +88 -0
- nat/experimental/test_time_compute/functions/plan_select_execute_function.py +1 -1
- nat/experimental/test_time_compute/functions/ttc_tool_orchestration_function.py +1 -1
- nat/experimental/test_time_compute/functions/ttc_tool_wrapper_function.py +1 -1
- nat/experimental/test_time_compute/models/editor_config.py +1 -1
- nat/experimental/test_time_compute/models/scoring_config.py +1 -1
- nat/experimental/test_time_compute/models/search_config.py +20 -2
- nat/experimental/test_time_compute/models/selection_config.py +33 -2
- nat/experimental/test_time_compute/models/stage_enums.py +1 -1
- nat/experimental/test_time_compute/models/strategy_base.py +1 -1
- nat/experimental/test_time_compute/models/tool_use_config.py +1 -1
- nat/experimental/test_time_compute/models/ttc_item.py +1 -1
- nat/experimental/test_time_compute/register.py +4 -1
- nat/experimental/test_time_compute/scoring/llm_based_agent_scorer.py +1 -1
- nat/experimental/test_time_compute/scoring/llm_based_plan_scorer.py +1 -1
- nat/experimental/test_time_compute/scoring/motivation_aware_scorer.py +1 -1
- nat/experimental/test_time_compute/search/multi_llm_generation.py +115 -0
- nat/experimental/test_time_compute/search/multi_llm_planner.py +1 -1
- nat/experimental/test_time_compute/search/multi_query_retrieval_search.py +1 -1
- nat/experimental/test_time_compute/search/single_shot_multi_plan_planner.py +1 -1
- nat/experimental/test_time_compute/selection/best_of_n_selector.py +1 -1
- nat/experimental/test_time_compute/selection/llm_based_agent_output_selector.py +1 -1
- nat/experimental/test_time_compute/selection/llm_based_output_merging_selector.py +1 -1
- nat/experimental/test_time_compute/selection/llm_based_plan_selector.py +1 -1
- nat/experimental/test_time_compute/selection/llm_judge_selection.py +127 -0
- nat/experimental/test_time_compute/selection/threshold_selector.py +1 -1
- nat/finetuning/__init__.py +24 -0
- nat/finetuning/finetuning_runtime.py +143 -0
- nat/finetuning/interfaces/__init__.py +24 -0
- nat/finetuning/interfaces/finetuning_runner.py +261 -0
- nat/finetuning/interfaces/trainer_adapter.py +103 -0
- nat/finetuning/interfaces/trajectory_builder.py +115 -0
- nat/finetuning/utils/__init__.py +15 -0
- nat/finetuning/utils/parsers/__init__.py +15 -0
- nat/finetuning/utils/parsers/adk_parser.py +141 -0
- nat/finetuning/utils/parsers/base_parser.py +238 -0
- nat/finetuning/utils/parsers/common.py +91 -0
- nat/finetuning/utils/parsers/langchain_parser.py +267 -0
- nat/finetuning/utils/parsers/llama_index_parser.py +218 -0
- nat/front_ends/__init__.py +1 -1
- nat/front_ends/console/__init__.py +1 -1
- nat/front_ends/console/authentication_flow_handler.py +1 -1
- nat/front_ends/console/console_front_end_config.py +4 -1
- nat/front_ends/console/console_front_end_plugin.py +5 -4
- nat/front_ends/console/register.py +1 -1
- nat/front_ends/cron/__init__.py +1 -1
- nat/front_ends/fastapi/__init__.py +1 -1
- nat/front_ends/fastapi/async_job.py +128 -0
- nat/front_ends/fastapi/auth_flow_handlers/http_flow_handler.py +1 -1
- nat/front_ends/fastapi/auth_flow_handlers/websocket_flow_handler.py +13 -9
- nat/front_ends/fastapi/dask_client_mixin.py +1 -1
- nat/front_ends/fastapi/fastapi_front_end_config.py +23 -1
- nat/front_ends/fastapi/fastapi_front_end_controller.py +1 -1
- nat/front_ends/fastapi/fastapi_front_end_plugin.py +25 -30
- nat/front_ends/fastapi/fastapi_front_end_plugin_worker.py +318 -59
- nat/front_ends/fastapi/html_snippets/__init__.py +1 -1
- nat/front_ends/fastapi/html_snippets/auth_code_grant_success.py +1 -1
- nat/front_ends/fastapi/intermediate_steps_subscriber.py +12 -1
- nat/front_ends/fastapi/job_store.py +23 -11
- nat/front_ends/fastapi/main.py +1 -1
- nat/front_ends/fastapi/message_handler.py +27 -4
- nat/front_ends/fastapi/message_validator.py +54 -2
- nat/front_ends/fastapi/register.py +1 -1
- nat/front_ends/fastapi/response_helpers.py +16 -15
- nat/front_ends/fastapi/step_adaptor.py +1 -1
- nat/front_ends/fastapi/utils.py +1 -1
- nat/front_ends/register.py +1 -2
- nat/front_ends/simple_base/__init__.py +1 -1
- nat/front_ends/simple_base/simple_front_end_plugin_base.py +6 -4
- nat/llm/aws_bedrock_llm.py +1 -1
- nat/llm/azure_openai_llm.py +10 -1
- nat/llm/dynamo_llm.py +363 -0
- nat/llm/huggingface_llm.py +177 -0
- nat/llm/litellm_llm.py +1 -1
- nat/llm/nim_llm.py +1 -1
- nat/llm/openai_llm.py +1 -1
- nat/llm/register.py +3 -1
- nat/llm/utils/__init__.py +1 -1
- nat/llm/utils/env_config_value.py +1 -1
- nat/llm/utils/error.py +1 -1
- nat/llm/utils/thinking.py +1 -1
- nat/memory/__init__.py +1 -1
- nat/memory/interfaces.py +1 -1
- nat/memory/models.py +1 -1
- nat/meta/pypi.md +1 -1
- nat/middleware/__init__.py +35 -0
- nat/middleware/cache/__init__.py +14 -0
- nat/middleware/cache/cache_middleware.py +253 -0
- nat/middleware/cache/cache_middleware_config.py +44 -0
- nat/middleware/cache/register.py +33 -0
- nat/middleware/defense/__init__.py +14 -0
- nat/middleware/defense/defense_middleware.py +362 -0
- nat/middleware/defense/defense_middleware_content_guard.py +455 -0
- nat/middleware/defense/defense_middleware_data_models.py +91 -0
- nat/middleware/defense/defense_middleware_output_verifier.py +440 -0
- nat/middleware/defense/defense_middleware_pii.py +356 -0
- nat/middleware/defense/register.py +82 -0
- nat/middleware/dynamic/__init__.py +14 -0
- nat/middleware/dynamic/dynamic_function_middleware.py +962 -0
- nat/middleware/dynamic/dynamic_middleware_config.py +132 -0
- nat/middleware/dynamic/register.py +34 -0
- nat/middleware/function_middleware.py +370 -0
- nat/middleware/logging/__init__.py +14 -0
- nat/middleware/logging/logging_middleware.py +67 -0
- nat/middleware/logging/logging_middleware_config.py +28 -0
- nat/middleware/logging/register.py +33 -0
- nat/middleware/middleware.py +298 -0
- nat/middleware/red_teaming/__init__.py +14 -0
- nat/middleware/red_teaming/red_teaming_middleware.py +344 -0
- nat/middleware/red_teaming/red_teaming_middleware_config.py +112 -0
- nat/middleware/red_teaming/register.py +47 -0
- nat/middleware/register.py +22 -0
- nat/middleware/utils/__init__.py +14 -0
- nat/middleware/utils/workflow_inventory.py +155 -0
- nat/object_store/__init__.py +1 -1
- nat/object_store/in_memory_object_store.py +1 -1
- nat/object_store/interfaces.py +1 -1
- nat/object_store/models.py +1 -1
- nat/object_store/register.py +1 -1
- nat/observability/__init__.py +1 -1
- nat/observability/exporter/__init__.py +1 -1
- nat/observability/exporter/base_exporter.py +1 -1
- nat/observability/exporter/exporter.py +1 -1
- nat/observability/exporter/file_exporter.py +1 -1
- nat/observability/exporter/processing_exporter.py +1 -1
- nat/observability/exporter/raw_exporter.py +1 -1
- nat/observability/exporter/span_exporter.py +7 -1
- nat/observability/exporter_manager.py +1 -1
- nat/observability/mixin/__init__.py +1 -1
- nat/observability/mixin/batch_config_mixin.py +1 -1
- nat/observability/mixin/collector_config_mixin.py +1 -1
- nat/observability/mixin/file_mixin.py +1 -1
- nat/observability/mixin/file_mode.py +1 -1
- nat/observability/mixin/redaction_config_mixin.py +1 -1
- nat/observability/mixin/resource_conflict_mixin.py +1 -1
- nat/observability/mixin/serialize_mixin.py +1 -1
- nat/observability/mixin/tagging_config_mixin.py +1 -1
- nat/observability/mixin/type_introspection_mixin.py +1 -1
- nat/observability/processor/__init__.py +1 -1
- nat/observability/processor/batching_processor.py +1 -1
- nat/observability/processor/callback_processor.py +1 -1
- nat/observability/processor/falsy_batch_filter_processor.py +1 -1
- nat/observability/processor/intermediate_step_serializer.py +1 -1
- nat/observability/processor/processor.py +1 -1
- nat/observability/processor/processor_factory.py +1 -1
- nat/observability/processor/redaction/__init__.py +1 -1
- nat/observability/processor/redaction/contextual_redaction_processor.py +1 -1
- nat/observability/processor/redaction/contextual_span_redaction_processor.py +1 -1
- nat/observability/processor/redaction/redaction_processor.py +1 -1
- nat/observability/processor/redaction/span_header_redaction_processor.py +1 -1
- nat/observability/processor/span_tagging_processor.py +1 -1
- nat/observability/register.py +1 -1
- nat/observability/utils/__init__.py +1 -1
- nat/observability/utils/dict_utils.py +1 -1
- nat/observability/utils/time_utils.py +1 -1
- nat/profiler/calc/__init__.py +1 -1
- nat/profiler/calc/calc_runner.py +3 -3
- nat/profiler/calc/calculations.py +1 -1
- nat/profiler/calc/data_models.py +1 -1
- nat/profiler/calc/plot.py +30 -3
- nat/profiler/callbacks/agno_callback_handler.py +1 -1
- nat/profiler/callbacks/base_callback_class.py +1 -1
- nat/profiler/callbacks/langchain_callback_handler.py +33 -3
- nat/profiler/callbacks/llama_index_callback_handler.py +13 -10
- nat/profiler/callbacks/semantic_kernel_callback_handler.py +1 -1
- nat/profiler/callbacks/token_usage_base_model.py +1 -1
- nat/profiler/data_frame_row.py +1 -1
- nat/profiler/data_models.py +1 -1
- nat/profiler/decorators/framework_wrapper.py +32 -1
- nat/profiler/decorators/function_tracking.py +1 -1
- nat/profiler/forecasting/config.py +1 -1
- nat/profiler/forecasting/model_trainer.py +1 -1
- nat/profiler/forecasting/models/__init__.py +1 -1
- nat/profiler/forecasting/models/forecasting_base_model.py +1 -1
- nat/profiler/forecasting/models/linear_model.py +1 -1
- nat/profiler/forecasting/models/random_forest_regressor.py +1 -1
- nat/profiler/inference_metrics_model.py +1 -1
- nat/profiler/inference_optimization/bottleneck_analysis/nested_stack_analysis.py +1 -1
- nat/profiler/inference_optimization/bottleneck_analysis/simple_stack_analysis.py +1 -1
- nat/profiler/inference_optimization/data_models.py +1 -1
- nat/profiler/inference_optimization/experimental/concurrency_spike_analysis.py +1 -1
- nat/profiler/inference_optimization/experimental/prefix_span_analysis.py +1 -1
- nat/profiler/inference_optimization/llm_metrics.py +1 -1
- nat/profiler/inference_optimization/prompt_caching.py +1 -1
- nat/profiler/inference_optimization/token_uniqueness.py +1 -1
- nat/profiler/inference_optimization/workflow_runtimes.py +1 -1
- nat/profiler/intermediate_property_adapter.py +1 -1
- nat/profiler/parameter_optimization/optimizable_utils.py +1 -1
- nat/profiler/parameter_optimization/optimizer_runtime.py +1 -1
- nat/profiler/parameter_optimization/parameter_optimizer.py +1 -1
- nat/profiler/parameter_optimization/parameter_selection.py +1 -1
- nat/profiler/parameter_optimization/pareto_visualizer.py +1 -1
- nat/profiler/parameter_optimization/prompt_optimizer.py +1 -1
- nat/profiler/parameter_optimization/update_helpers.py +1 -1
- nat/profiler/profile_runner.py +1 -1
- nat/profiler/utils.py +1 -1
- nat/registry_handlers/local/local_handler.py +1 -1
- nat/registry_handlers/local/register_local.py +1 -1
- nat/registry_handlers/metadata_factory.py +1 -1
- nat/registry_handlers/package_utils.py +1 -1
- nat/registry_handlers/pypi/pypi_handler.py +1 -1
- nat/registry_handlers/pypi/register_pypi.py +1 -1
- nat/registry_handlers/register.py +1 -1
- nat/registry_handlers/registry_handler_base.py +1 -1
- nat/registry_handlers/rest/register_rest.py +1 -1
- nat/registry_handlers/rest/rest_handler.py +1 -1
- nat/registry_handlers/schemas/headers.py +1 -1
- nat/registry_handlers/schemas/package.py +1 -1
- nat/registry_handlers/schemas/publish.py +1 -1
- nat/registry_handlers/schemas/pull.py +1 -1
- nat/registry_handlers/schemas/remove.py +1 -1
- nat/registry_handlers/schemas/search.py +1 -1
- nat/registry_handlers/schemas/status.py +1 -1
- nat/retriever/interface.py +1 -1
- nat/retriever/milvus/__init__.py +1 -1
- nat/retriever/milvus/register.py +12 -4
- nat/retriever/milvus/retriever.py +103 -41
- nat/retriever/models.py +1 -1
- nat/retriever/nemo_retriever/__init__.py +1 -1
- nat/retriever/nemo_retriever/register.py +1 -1
- nat/retriever/nemo_retriever/retriever.py +5 -5
- nat/retriever/register.py +1 -1
- nat/runtime/__init__.py +1 -1
- nat/runtime/loader.py +10 -3
- nat/runtime/metrics.py +180 -0
- nat/runtime/runner.py +13 -6
- nat/runtime/session.py +458 -32
- nat/runtime/user_metadata.py +1 -1
- nat/settings/global_settings.py +1 -1
- nat/tool/chat_completion.py +1 -1
- nat/tool/code_execution/README.md +1 -1
- nat/tool/code_execution/code_sandbox.py +2 -2
- nat/tool/code_execution/local_sandbox/Dockerfile.sandbox +1 -1
- nat/tool/code_execution/local_sandbox/__init__.py +1 -1
- nat/tool/code_execution/local_sandbox/local_sandbox_server.py +1 -1
- nat/tool/code_execution/local_sandbox/start_local_sandbox.sh +1 -1
- nat/tool/code_execution/register.py +1 -1
- nat/tool/code_execution/utils.py +1 -1
- nat/tool/datetime_tools.py +1 -1
- nat/tool/document_search.py +1 -1
- nat/tool/github_tools.py +1 -1
- nat/tool/memory_tools/add_memory_tool.py +1 -1
- nat/tool/memory_tools/delete_memory_tool.py +1 -1
- nat/tool/memory_tools/get_memory_tool.py +1 -1
- nat/tool/nvidia_rag.py +2 -2
- nat/tool/register.py +1 -1
- nat/tool/retriever.py +1 -1
- nat/tool/server_tools.py +1 -1
- nat/utils/__init__.py +8 -5
- nat/utils/callable_utils.py +1 -1
- nat/utils/data_models/schema_validator.py +1 -1
- nat/utils/debugging_utils.py +1 -1
- nat/utils/decorators.py +1 -1
- nat/utils/dump_distro_mapping.py +1 -1
- nat/utils/exception_handlers/automatic_retries.py +3 -3
- nat/utils/exception_handlers/schemas.py +1 -1
- nat/utils/io/model_processing.py +1 -1
- nat/utils/io/supress_logs.py +33 -0
- nat/utils/io/yaml_tools.py +1 -1
- nat/utils/log_levels.py +1 -1
- nat/utils/log_utils.py +13 -1
- nat/utils/metadata_utils.py +1 -1
- nat/utils/optional_imports.py +1 -1
- nat/utils/producer_consumer_queue.py +1 -1
- nat/utils/reactive/base/observable_base.py +1 -1
- nat/utils/reactive/base/observer_base.py +1 -1
- nat/utils/reactive/base/subject_base.py +1 -1
- nat/utils/reactive/observable.py +1 -1
- nat/utils/reactive/observer.py +1 -1
- nat/utils/reactive/subject.py +1 -1
- nat/utils/reactive/subscription.py +1 -1
- nat/utils/responses_api.py +1 -1
- nat/utils/settings/global_settings.py +1 -1
- nat/utils/string_utils.py +1 -1
- nat/utils/type_converter.py +18 -5
- nat/utils/type_utils.py +1 -1
- nat/utils/url_utils.py +1 -1
- {nvidia_nat-1.4.0a20251112.dist-info → nvidia_nat-1.4.0a20260113.dist-info}/METADATA +46 -15
- nvidia_nat-1.4.0a20260113.dist-info/RECORD +547 -0
- nvidia_nat-1.4.0a20260113.dist-info/entry_points.txt +38 -0
- nat/cli/commands/mcp/mcp.py +0 -986
- nat/front_ends/mcp/introspection_token_verifier.py +0 -73
- nat/front_ends/mcp/mcp_front_end_config.py +0 -109
- nat/front_ends/mcp/mcp_front_end_plugin.py +0 -151
- nat/front_ends/mcp/mcp_front_end_plugin_worker.py +0 -362
- nat/front_ends/mcp/memory_profiler.py +0 -320
- nat/front_ends/mcp/register.py +0 -27
- nat/front_ends/mcp/tool_converter.py +0 -321
- nvidia_nat-1.4.0a20251112.dist-info/RECORD +0 -481
- nvidia_nat-1.4.0a20251112.dist-info/entry_points.txt +0 -22
- {nvidia_nat-1.4.0a20251112.dist-info → nvidia_nat-1.4.0a20260113.dist-info}/WHEEL +0 -0
- {nvidia_nat-1.4.0a20251112.dist-info → nvidia_nat-1.4.0a20260113.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat-1.4.0a20251112.dist-info → nvidia_nat-1.4.0a20260113.dist-info}/licenses/LICENSE.md +0 -0
- {nvidia_nat-1.4.0a20251112.dist-info → nvidia_nat-1.4.0a20260113.dist-info}/top_level.txt +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
"""OAuth 2.0 Token Introspection verifier implementation for MCP servers."""
|
|
16
|
-
|
|
17
|
-
import logging
|
|
18
|
-
|
|
19
|
-
from mcp.server.auth.provider import AccessToken
|
|
20
|
-
from mcp.server.auth.provider import TokenVerifier
|
|
21
|
-
|
|
22
|
-
from nat.authentication.credential_validator.bearer_token_validator import BearerTokenValidator
|
|
23
|
-
from nat.authentication.oauth2.oauth2_resource_server_config import OAuth2ResourceServerConfig
|
|
24
|
-
|
|
25
|
-
logger = logging.getLogger(__name__)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class IntrospectionTokenVerifier(TokenVerifier):
|
|
29
|
-
"""Token verifier that delegates token verification to BearerTokenValidator."""
|
|
30
|
-
|
|
31
|
-
def __init__(self, config: OAuth2ResourceServerConfig):
|
|
32
|
-
"""Create IntrospectionTokenVerifier from OAuth2ResourceServerConfig.
|
|
33
|
-
|
|
34
|
-
Args:
|
|
35
|
-
config: OAuth2ResourceServerConfig
|
|
36
|
-
"""
|
|
37
|
-
issuer = config.issuer_url
|
|
38
|
-
scopes = config.scopes or []
|
|
39
|
-
audience = config.audience
|
|
40
|
-
jwks_uri = config.jwks_uri
|
|
41
|
-
introspection_endpoint = config.introspection_endpoint
|
|
42
|
-
discovery_url = config.discovery_url
|
|
43
|
-
client_id = config.client_id
|
|
44
|
-
client_secret = config.client_secret
|
|
45
|
-
|
|
46
|
-
self._bearer_token_validator = BearerTokenValidator(
|
|
47
|
-
issuer=issuer,
|
|
48
|
-
audience=audience,
|
|
49
|
-
scopes=scopes,
|
|
50
|
-
jwks_uri=jwks_uri,
|
|
51
|
-
introspection_endpoint=introspection_endpoint,
|
|
52
|
-
discovery_url=discovery_url,
|
|
53
|
-
client_id=client_id,
|
|
54
|
-
client_secret=client_secret,
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
async def verify_token(self, token: str) -> AccessToken | None:
|
|
58
|
-
"""Verify token by delegating to BearerTokenValidator.
|
|
59
|
-
|
|
60
|
-
Args:
|
|
61
|
-
token: The Bearer token to verify
|
|
62
|
-
|
|
63
|
-
Returns:
|
|
64
|
-
AccessToken | None: AccessToken if valid, None if invalid
|
|
65
|
-
"""
|
|
66
|
-
validation_result = await self._bearer_token_validator.verify(token)
|
|
67
|
-
|
|
68
|
-
if validation_result.active:
|
|
69
|
-
return AccessToken(token=token,
|
|
70
|
-
expires_at=validation_result.expires_at,
|
|
71
|
-
scopes=validation_result.scopes or [],
|
|
72
|
-
client_id=validation_result.client_id or "")
|
|
73
|
-
return None
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
import logging
|
|
17
|
-
from typing import Literal
|
|
18
|
-
|
|
19
|
-
from pydantic import Field
|
|
20
|
-
from pydantic import field_validator
|
|
21
|
-
from pydantic import model_validator
|
|
22
|
-
|
|
23
|
-
from nat.authentication.oauth2.oauth2_resource_server_config import OAuth2ResourceServerConfig
|
|
24
|
-
from nat.data_models.front_end import FrontEndBaseConfig
|
|
25
|
-
|
|
26
|
-
logger = logging.getLogger(__name__)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class MCPFrontEndConfig(FrontEndBaseConfig, name="mcp"):
|
|
30
|
-
"""MCP front end configuration.
|
|
31
|
-
|
|
32
|
-
A simple MCP (Model Context Protocol) front end for NeMo Agent toolkit.
|
|
33
|
-
"""
|
|
34
|
-
|
|
35
|
-
name: str = Field(default="NeMo Agent Toolkit MCP",
|
|
36
|
-
description="Name of the MCP server (default: NeMo Agent Toolkit MCP)")
|
|
37
|
-
host: str = Field(default="localhost", description="Host to bind the server to (default: localhost)")
|
|
38
|
-
port: int = Field(default=9901, description="Port to bind the server to (default: 9901)", ge=0, le=65535)
|
|
39
|
-
debug: bool = Field(default=False, description="Enable debug mode (default: False)")
|
|
40
|
-
log_level: str = Field(default="INFO", description="Log level for the MCP server (default: INFO)")
|
|
41
|
-
tool_names: list[str] = Field(
|
|
42
|
-
default_factory=list,
|
|
43
|
-
description="The list of tools MCP server will expose (default: all tools)."
|
|
44
|
-
"Tool names can be functions or function groups",
|
|
45
|
-
)
|
|
46
|
-
transport: Literal["sse", "streamable-http"] = Field(
|
|
47
|
-
default="streamable-http",
|
|
48
|
-
description="Transport type for the MCP server (default: streamable-http, backwards compatible with sse)")
|
|
49
|
-
runner_class: str | None = Field(
|
|
50
|
-
default=None, description="Custom worker class for handling MCP routes (default: built-in worker)")
|
|
51
|
-
base_path: str | None = Field(default=None,
|
|
52
|
-
description="Base path to mount the MCP server at (e.g., '/api/v1'). "
|
|
53
|
-
"If specified, the server will be accessible at http://host:port{base_path}/mcp. "
|
|
54
|
-
"If None, server runs at root path /mcp.")
|
|
55
|
-
|
|
56
|
-
server_auth: OAuth2ResourceServerConfig | None = Field(
|
|
57
|
-
default=None, description=("OAuth 2.0 Resource Server configuration for token verification."))
|
|
58
|
-
|
|
59
|
-
@field_validator('base_path')
|
|
60
|
-
@classmethod
|
|
61
|
-
def validate_base_path(cls, v: str | None) -> str | None:
|
|
62
|
-
"""Validate that base_path starts with '/' and doesn't end with '/'."""
|
|
63
|
-
if v is not None:
|
|
64
|
-
if not v.startswith('/'):
|
|
65
|
-
raise ValueError("base_path must start with '/'")
|
|
66
|
-
if v.endswith('/'):
|
|
67
|
-
raise ValueError("base_path must not end with '/'")
|
|
68
|
-
return v
|
|
69
|
-
|
|
70
|
-
# Memory profiling configuration
|
|
71
|
-
enable_memory_profiling: bool = Field(default=False,
|
|
72
|
-
description="Enable memory profiling and diagnostics (default: False)")
|
|
73
|
-
memory_profile_interval: int = Field(default=50,
|
|
74
|
-
description="Log memory stats every N requests (default: 50)",
|
|
75
|
-
ge=1)
|
|
76
|
-
memory_profile_top_n: int = Field(default=10,
|
|
77
|
-
description="Number of top memory allocations to log (default: 10)",
|
|
78
|
-
ge=1,
|
|
79
|
-
le=50)
|
|
80
|
-
memory_profile_log_level: str = Field(default="DEBUG",
|
|
81
|
-
description="Log level for memory profiling output (default: DEBUG)")
|
|
82
|
-
|
|
83
|
-
@model_validator(mode="after")
|
|
84
|
-
def validate_security_configuration(self):
|
|
85
|
-
"""Validate security configuration to prevent accidental misconfigurations."""
|
|
86
|
-
# Check if server is bound to a non-localhost interface without authentication
|
|
87
|
-
localhost_hosts = {"localhost", "127.0.0.1", "::1"}
|
|
88
|
-
if self.host not in localhost_hosts and self.server_auth is None:
|
|
89
|
-
logger.warning(
|
|
90
|
-
"MCP server is configured to bind to '%s' without authentication. "
|
|
91
|
-
"This may expose your server to unauthorized access. "
|
|
92
|
-
"Consider either: (1) binding to localhost for local-only access, "
|
|
93
|
-
"or (2) configuring server_auth for production deployments on public interfaces.",
|
|
94
|
-
self.host)
|
|
95
|
-
|
|
96
|
-
# Check if SSE transport is used (which doesn't support authentication)
|
|
97
|
-
if self.transport == "sse":
|
|
98
|
-
if self.server_auth is not None:
|
|
99
|
-
logger.warning("SSE transport does not support authentication. "
|
|
100
|
-
"The configured server_auth will be ignored. "
|
|
101
|
-
"For production use with authentication, use 'streamable-http' transport instead.")
|
|
102
|
-
elif self.host not in localhost_hosts:
|
|
103
|
-
logger.warning(
|
|
104
|
-
"SSE transport does not support authentication and is bound to '%s'. "
|
|
105
|
-
"This configuration is not recommended for production use. "
|
|
106
|
-
"For production deployments, use 'streamable-http' transport with server_auth configured.",
|
|
107
|
-
self.host)
|
|
108
|
-
|
|
109
|
-
return self
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
-
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
#
|
|
4
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
# you may not use this file except in compliance with the License.
|
|
6
|
-
# You may obtain a copy of the License at
|
|
7
|
-
#
|
|
8
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
#
|
|
10
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
# See the License for the specific language governing permissions and
|
|
14
|
-
# limitations under the License.
|
|
15
|
-
|
|
16
|
-
import logging
|
|
17
|
-
import typing
|
|
18
|
-
|
|
19
|
-
from nat.builder.front_end import FrontEndBase
|
|
20
|
-
from nat.builder.workflow_builder import WorkflowBuilder
|
|
21
|
-
from nat.front_ends.mcp.mcp_front_end_config import MCPFrontEndConfig
|
|
22
|
-
from nat.front_ends.mcp.mcp_front_end_plugin_worker import MCPFrontEndPluginWorkerBase
|
|
23
|
-
|
|
24
|
-
if typing.TYPE_CHECKING:
|
|
25
|
-
from mcp.server.fastmcp import FastMCP
|
|
26
|
-
|
|
27
|
-
logger = logging.getLogger(__name__)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class MCPFrontEndPlugin(FrontEndBase[MCPFrontEndConfig]):
|
|
31
|
-
"""MCP front end plugin implementation."""
|
|
32
|
-
|
|
33
|
-
def get_worker_class(self) -> type[MCPFrontEndPluginWorkerBase]:
|
|
34
|
-
"""Get the worker class for handling MCP routes."""
|
|
35
|
-
from nat.front_ends.mcp.mcp_front_end_plugin_worker import MCPFrontEndPluginWorker
|
|
36
|
-
|
|
37
|
-
return MCPFrontEndPluginWorker
|
|
38
|
-
|
|
39
|
-
@typing.final
|
|
40
|
-
def get_worker_class_name(self) -> str:
|
|
41
|
-
"""Get the worker class name from configuration or default."""
|
|
42
|
-
if self.front_end_config.runner_class:
|
|
43
|
-
return self.front_end_config.runner_class
|
|
44
|
-
|
|
45
|
-
worker_class = self.get_worker_class()
|
|
46
|
-
return f"{worker_class.__module__}.{worker_class.__qualname__}"
|
|
47
|
-
|
|
48
|
-
def _get_worker_instance(self):
|
|
49
|
-
"""Get an instance of the worker class."""
|
|
50
|
-
# Import the worker class dynamically if specified in config
|
|
51
|
-
if self.front_end_config.runner_class:
|
|
52
|
-
module_name, class_name = self.front_end_config.runner_class.rsplit(".", 1)
|
|
53
|
-
import importlib
|
|
54
|
-
module = importlib.import_module(module_name)
|
|
55
|
-
worker_class = getattr(module, class_name)
|
|
56
|
-
else:
|
|
57
|
-
worker_class = self.get_worker_class()
|
|
58
|
-
|
|
59
|
-
return worker_class(self.full_config)
|
|
60
|
-
|
|
61
|
-
async def run(self) -> None:
|
|
62
|
-
"""Run the MCP server."""
|
|
63
|
-
# Build the workflow and add routes using the worker
|
|
64
|
-
async with WorkflowBuilder.from_config(config=self.full_config) as builder:
|
|
65
|
-
|
|
66
|
-
# Get the worker instance
|
|
67
|
-
worker = self._get_worker_instance()
|
|
68
|
-
|
|
69
|
-
# Let the worker create the MCP server (allows plugins to customize)
|
|
70
|
-
mcp = await worker.create_mcp_server()
|
|
71
|
-
|
|
72
|
-
# Add routes through the worker (includes health endpoint and function registration)
|
|
73
|
-
await worker.add_routes(mcp, builder)
|
|
74
|
-
|
|
75
|
-
# Start the MCP server with configurable transport
|
|
76
|
-
# streamable-http is the default, but users can choose sse if preferred
|
|
77
|
-
try:
|
|
78
|
-
# If base_path is configured, mount server at sub-path using FastAPI wrapper
|
|
79
|
-
if self.front_end_config.base_path:
|
|
80
|
-
if self.front_end_config.transport == "sse":
|
|
81
|
-
logger.warning(
|
|
82
|
-
"base_path is configured but SSE transport does not support mounting at sub-paths. "
|
|
83
|
-
"Use streamable-http transport for base_path support.")
|
|
84
|
-
logger.info("Starting MCP server with SSE endpoint at /sse")
|
|
85
|
-
await mcp.run_sse_async()
|
|
86
|
-
else:
|
|
87
|
-
full_url = f"http://{self.front_end_config.host}:{self.front_end_config.port}{self.front_end_config.base_path}/mcp"
|
|
88
|
-
logger.info(
|
|
89
|
-
"Mounting MCP server at %s/mcp on %s:%s",
|
|
90
|
-
self.front_end_config.base_path,
|
|
91
|
-
self.front_end_config.host,
|
|
92
|
-
self.front_end_config.port,
|
|
93
|
-
)
|
|
94
|
-
logger.info("MCP server URL: %s", full_url)
|
|
95
|
-
await self._run_with_mount(mcp)
|
|
96
|
-
# Standard behavior - run at root path
|
|
97
|
-
elif self.front_end_config.transport == "sse":
|
|
98
|
-
logger.info("Starting MCP server with SSE endpoint at /sse")
|
|
99
|
-
await mcp.run_sse_async()
|
|
100
|
-
else: # streamable-http
|
|
101
|
-
full_url = f"http://{self.front_end_config.host}:{self.front_end_config.port}/mcp"
|
|
102
|
-
logger.info("MCP server URL: %s", full_url)
|
|
103
|
-
await mcp.run_streamable_http_async()
|
|
104
|
-
except KeyboardInterrupt:
|
|
105
|
-
logger.info("MCP server shutdown requested (Ctrl+C). Shutting down gracefully.")
|
|
106
|
-
|
|
107
|
-
async def _run_with_mount(self, mcp: "FastMCP") -> None:
|
|
108
|
-
"""Run MCP server mounted at configured base_path using FastAPI wrapper.
|
|
109
|
-
|
|
110
|
-
Args:
|
|
111
|
-
mcp: The FastMCP server instance to mount
|
|
112
|
-
"""
|
|
113
|
-
import contextlib
|
|
114
|
-
|
|
115
|
-
import uvicorn
|
|
116
|
-
from fastapi import FastAPI
|
|
117
|
-
|
|
118
|
-
@contextlib.asynccontextmanager
|
|
119
|
-
async def lifespan(_app: FastAPI):
|
|
120
|
-
"""Manage MCP server session lifecycle."""
|
|
121
|
-
logger.info("Starting MCP server session manager...")
|
|
122
|
-
async with contextlib.AsyncExitStack() as stack:
|
|
123
|
-
try:
|
|
124
|
-
# Initialize the MCP server's session manager
|
|
125
|
-
await stack.enter_async_context(mcp.session_manager.run())
|
|
126
|
-
logger.info("MCP server session manager started successfully")
|
|
127
|
-
yield
|
|
128
|
-
except Exception as e:
|
|
129
|
-
logger.error("Failed to start MCP server session manager: %s", e)
|
|
130
|
-
raise
|
|
131
|
-
logger.info("MCP server session manager stopped")
|
|
132
|
-
|
|
133
|
-
# Create a FastAPI wrapper app with lifespan management
|
|
134
|
-
app = FastAPI(
|
|
135
|
-
title=self.front_end_config.name,
|
|
136
|
-
description="MCP server mounted at custom base path",
|
|
137
|
-
lifespan=lifespan,
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
# Mount the MCP server's ASGI app at the configured base_path
|
|
141
|
-
app.mount(self.front_end_config.base_path, mcp.streamable_http_app())
|
|
142
|
-
|
|
143
|
-
# Configure and start uvicorn server
|
|
144
|
-
config = uvicorn.Config(
|
|
145
|
-
app,
|
|
146
|
-
host=self.front_end_config.host,
|
|
147
|
-
port=self.front_end_config.port,
|
|
148
|
-
log_level=self.front_end_config.log_level.lower(),
|
|
149
|
-
)
|
|
150
|
-
server = uvicorn.Server(config)
|
|
151
|
-
await server.serve()
|