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,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
nat/cli/commands/sizing/calc.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
nat/cli/commands/start.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
nat/cli/commands/uninstall.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
nat/cli/commands/validate.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -19,6 +19,7 @@ import shutil
|
|
|
19
19
|
import subprocess
|
|
20
20
|
from pathlib import Path
|
|
21
21
|
from urllib.parse import urlparse
|
|
22
|
+
from urllib.request import url2pathname
|
|
22
23
|
|
|
23
24
|
import click
|
|
24
25
|
from jinja2 import Environment
|
|
@@ -151,7 +152,7 @@ def find_package_root(package_name: str) -> Path | None:
|
|
|
151
152
|
logger.error("Invalid URL scheme in direct_url.json: %s", url)
|
|
152
153
|
return None
|
|
153
154
|
|
|
154
|
-
package_root = Path(parsed_url.path).resolve()
|
|
155
|
+
package_root = Path(url2pathname(parsed_url.path)).resolve()
|
|
155
156
|
|
|
156
157
|
# Ensure the path exists and is within an allowed base directory
|
|
157
158
|
if not package_root.exists() or not package_root.is_dir():
|
nat/cli/entrypoint.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
16
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
17
17
|
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
|
18
18
|
#
|
|
19
19
|
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
|
@@ -28,39 +28,25 @@ import sys
|
|
|
28
28
|
import time
|
|
29
29
|
|
|
30
30
|
import click
|
|
31
|
-
import
|
|
31
|
+
import nest_asyncio2
|
|
32
32
|
from dotenv import load_dotenv
|
|
33
33
|
|
|
34
34
|
from nat.utils.log_levels import LOG_LEVELS
|
|
35
|
+
from nat.utils.log_utils import setup_logging as log_utils_setup_logging
|
|
35
36
|
|
|
36
|
-
from .
|
|
37
|
-
from .commands.evaluate import eval_command
|
|
38
|
-
from .commands.info.info import info_command
|
|
39
|
-
from .commands.mcp.mcp import mcp_command
|
|
40
|
-
from .commands.object_store.object_store import object_store_command
|
|
41
|
-
from .commands.optimize import optimizer_command
|
|
42
|
-
from .commands.registry.registry import registry_command
|
|
43
|
-
from .commands.sizing.sizing import sizing
|
|
44
|
-
from .commands.start import start_command
|
|
45
|
-
from .commands.uninstall import uninstall_command
|
|
46
|
-
from .commands.validate import validate_command
|
|
47
|
-
from .commands.workflow.workflow import workflow_command
|
|
37
|
+
from .plugin_loader import discover_and_load_cli_plugins
|
|
48
38
|
|
|
49
39
|
# Load environment variables from .env file, if it exists
|
|
50
40
|
load_dotenv()
|
|
51
41
|
|
|
52
42
|
# Apply at the beginning of the file to avoid issues with asyncio
|
|
53
|
-
|
|
43
|
+
nest_asyncio2.apply()
|
|
54
44
|
|
|
55
45
|
|
|
56
46
|
def setup_logging(log_level: str):
|
|
57
47
|
"""Configure logging with the specified level"""
|
|
58
48
|
numeric_level = LOG_LEVELS.get(log_level.upper(), logging.INFO)
|
|
59
|
-
|
|
60
|
-
level=numeric_level,
|
|
61
|
-
format="%(asctime)s - %(levelname)-8s - %(name)s:%(lineno)d - %(message)s",
|
|
62
|
-
datefmt="%Y-%m-%d %H:%M:%S",
|
|
63
|
-
)
|
|
49
|
+
log_utils_setup_logging(numeric_level)
|
|
64
50
|
return numeric_level
|
|
65
51
|
|
|
66
52
|
|
|
@@ -102,22 +88,14 @@ def cli(ctx: click.Context, log_level: str):
|
|
|
102
88
|
ctx_dict["log_level"] = log_level
|
|
103
89
|
|
|
104
90
|
|
|
105
|
-
|
|
106
|
-
cli
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
cli.
|
|
110
|
-
|
|
111
|
-
cli.add_command(
|
|
112
|
-
cli.add_command(
|
|
113
|
-
cli.add_command(sizing, name="sizing")
|
|
114
|
-
cli.add_command(optimizer_command, name="optimize")
|
|
115
|
-
cli.add_command(object_store_command, name="object-store")
|
|
116
|
-
cli.add_command(mcp_command, name="mcp")
|
|
117
|
-
|
|
118
|
-
# Aliases
|
|
119
|
-
cli.add_command(start_command.get_command(None, "console"), name="run") # type: ignore
|
|
120
|
-
cli.add_command(start_command.get_command(None, "fastapi"), name="serve") # type: ignore
|
|
91
|
+
# Discover and load ALL CLI commands (core + plugins) via entry points
|
|
92
|
+
discover_and_load_cli_plugins(cli)
|
|
93
|
+
|
|
94
|
+
# Aliases - need to get start_command from the loaded commands
|
|
95
|
+
start_cmd = cli.commands.get("start")
|
|
96
|
+
if start_cmd and hasattr(start_cmd, "get_command"):
|
|
97
|
+
cli.add_command(start_cmd.get_command(None, "console"), name="run") # type: ignore
|
|
98
|
+
cli.add_command(start_cmd.get_command(None, "fastapi"), name="serve") # type: ignore
|
|
121
99
|
|
|
122
100
|
|
|
123
101
|
@cli.result_callback()
|
nat/cli/main.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
16
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
17
17
|
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
|
|
18
18
|
#
|
|
19
19
|
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
|
nat/cli/plugin_loader.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2026, 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
|
+
"""CLI plugin discovery system for loading plugin-specific commands."""
|
|
16
|
+
|
|
17
|
+
import logging
|
|
18
|
+
from importlib.metadata import entry_points
|
|
19
|
+
|
|
20
|
+
import click
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger(__name__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def discover_and_load_cli_plugins(cli_group: click.Group) -> None:
|
|
26
|
+
"""Discover and load CLI command plugins from installed packages.
|
|
27
|
+
|
|
28
|
+
This function uses Python entry points to discover CLI commands provided by
|
|
29
|
+
plugin packages. Plugins register their commands under the 'nat.cli' entry
|
|
30
|
+
point group in their pyproject.toml.
|
|
31
|
+
|
|
32
|
+
The function handles import errors gracefully - if a plugin cannot be loaded
|
|
33
|
+
(e.g., due to missing dependencies), it logs a debug message but continues
|
|
34
|
+
loading other plugins.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
cli_group: The Click group to add discovered commands to
|
|
38
|
+
|
|
39
|
+
Example plugin registration in pyproject.toml:
|
|
40
|
+
[project.entry-points.'nat.cli']
|
|
41
|
+
mcp = "nat.plugins.mcp.cli.commands:mcp_command"
|
|
42
|
+
"""
|
|
43
|
+
discovered_eps = entry_points(group='nat.cli')
|
|
44
|
+
|
|
45
|
+
for ep in discovered_eps:
|
|
46
|
+
try:
|
|
47
|
+
# Load the command from the entry point
|
|
48
|
+
command = ep.load()
|
|
49
|
+
|
|
50
|
+
# Verify it's a Click command or group
|
|
51
|
+
if not isinstance(command, click.Command | click.Group):
|
|
52
|
+
logger.warning("CLI plugin '%s' from '%s' is not a Click command/group, skipping", ep.name, ep.value)
|
|
53
|
+
continue
|
|
54
|
+
|
|
55
|
+
# Add the command to the CLI group
|
|
56
|
+
cli_group.add_command(command, name=ep.name)
|
|
57
|
+
logger.debug("Loaded CLI plugin: %s from %s", ep.name, ep.value)
|
|
58
|
+
|
|
59
|
+
except ImportError as e:
|
|
60
|
+
# Plugin package not installed or missing dependencies - this is expected
|
|
61
|
+
logger.debug(
|
|
62
|
+
"Could not load CLI plugin '%s' from '%s': %s. "
|
|
63
|
+
"This is expected if the plugin package is not installed.",
|
|
64
|
+
ep.name,
|
|
65
|
+
ep.value,
|
|
66
|
+
e)
|
|
67
|
+
except Exception as e: # noqa: BLE001
|
|
68
|
+
# Unexpected error - log as warning but continue
|
|
69
|
+
logger.warning("Error loading CLI plugin '%s' from '%s': %s", ep.name, ep.value, e, exc_info=True)
|
nat/cli/register_workflow.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2024-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
#
|
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
from contextlib import asynccontextmanager
|
|
17
17
|
|
|
18
|
+
from pydantic import BaseModel
|
|
19
|
+
|
|
18
20
|
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
19
21
|
from nat.cli.type_registry import AuthProviderBuildCallableT
|
|
20
22
|
from nat.cli.type_registry import AuthProviderRegisteredCallableT
|
|
@@ -38,6 +40,8 @@ from nat.cli.type_registry import LoggingMethodConfigT
|
|
|
38
40
|
from nat.cli.type_registry import LoggingMethodRegisteredCallableT
|
|
39
41
|
from nat.cli.type_registry import MemoryBuildCallableT
|
|
40
42
|
from nat.cli.type_registry import MemoryRegisteredCallableT
|
|
43
|
+
from nat.cli.type_registry import MiddlewareBuildCallableT
|
|
44
|
+
from nat.cli.type_registry import MiddlewareRegisteredCallableT
|
|
41
45
|
from nat.cli.type_registry import ObjectStoreBuildCallableT
|
|
42
46
|
from nat.cli.type_registry import ObjectStoreRegisteredCallableT
|
|
43
47
|
from nat.cli.type_registry import RegisteredLoggingMethod
|
|
@@ -53,21 +57,33 @@ from nat.cli.type_registry import TeleExporterRegisteredCallableT
|
|
|
53
57
|
from nat.cli.type_registry import TelemetryExporterBuildCallableT
|
|
54
58
|
from nat.cli.type_registry import TelemetryExporterConfigT
|
|
55
59
|
from nat.cli.type_registry import ToolWrapperBuildCallableT
|
|
60
|
+
from nat.cli.type_registry import TrainerAdapterBuildCallableT
|
|
61
|
+
from nat.cli.type_registry import TrainerAdapterRegisteredCallableT
|
|
62
|
+
from nat.cli.type_registry import TrainerBuildCallableT
|
|
63
|
+
from nat.cli.type_registry import TrainerRegisteredCallableT
|
|
64
|
+
from nat.cli.type_registry import TrajectoryBuilderBuildCallableT
|
|
65
|
+
from nat.cli.type_registry import TrajectoryBuilderRegisteredCallableT
|
|
56
66
|
from nat.cli.type_registry import TTCStrategyBuildCallableT
|
|
57
|
-
from nat.cli.type_registry import
|
|
67
|
+
from nat.cli.type_registry import TTCStrategyRegisteredCallableT
|
|
58
68
|
from nat.data_models.authentication import AuthProviderBaseConfigT
|
|
59
69
|
from nat.data_models.component import ComponentEnum
|
|
60
70
|
from nat.data_models.discovery_metadata import DiscoveryMetadata
|
|
61
71
|
from nat.data_models.embedder import EmbedderBaseConfigT
|
|
62
72
|
from nat.data_models.evaluator import EvaluatorBaseConfigT
|
|
73
|
+
from nat.data_models.finetuning import TrainerAdapterConfigT
|
|
74
|
+
from nat.data_models.finetuning import TrainerConfigT
|
|
75
|
+
from nat.data_models.finetuning import TrajectoryBuilderConfigT
|
|
63
76
|
from nat.data_models.front_end import FrontEndConfigT
|
|
64
77
|
from nat.data_models.function import FunctionConfigT
|
|
65
78
|
from nat.data_models.function import FunctionGroupConfigT
|
|
66
79
|
from nat.data_models.llm import LLMBaseConfigT
|
|
67
80
|
from nat.data_models.memory import MemoryBaseConfigT
|
|
81
|
+
from nat.data_models.middleware import MiddlewareBaseConfigT
|
|
68
82
|
from nat.data_models.object_store import ObjectStoreBaseConfigT
|
|
69
83
|
from nat.data_models.registry_handler import RegistryHandlerBaseConfigT
|
|
70
84
|
from nat.data_models.retriever import RetrieverBaseConfigT
|
|
85
|
+
from nat.data_models.ttc_strategy import TTCStrategyBaseConfigT
|
|
86
|
+
from nat.utils.type_utils import DecomposedType
|
|
71
87
|
|
|
72
88
|
|
|
73
89
|
def register_telemetry_exporter(config_type: type[TelemetryExporterConfigT]):
|
|
@@ -149,6 +165,10 @@ def register_function(config_type: type[FunctionConfigT],
|
|
|
149
165
|
framework_wrappers: list[LLMFrameworkEnum | str] | None = None):
|
|
150
166
|
"""
|
|
151
167
|
Register a workflow with optional framework_wrappers for automatic profiler hooking.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
config_type: The function configuration type
|
|
171
|
+
framework_wrappers: Optional list of framework wrappers for automatic profiler hooking
|
|
152
172
|
"""
|
|
153
173
|
|
|
154
174
|
def register_function_inner(
|
|
@@ -177,6 +197,64 @@ def register_function(config_type: type[FunctionConfigT],
|
|
|
177
197
|
return register_function_inner
|
|
178
198
|
|
|
179
199
|
|
|
200
|
+
def register_per_user_function(config_type: type[FunctionConfigT],
|
|
201
|
+
input_type: type | type[BaseModel],
|
|
202
|
+
single_output_type: type | type[BaseModel] | None = None,
|
|
203
|
+
streaming_output_type: type | type[BaseModel] | None = None,
|
|
204
|
+
framework_wrappers: list[LLMFrameworkEnum | str] | None = None):
|
|
205
|
+
"""
|
|
206
|
+
Register a per-user function with optional framework_wrappers for automatic profiler hooking.
|
|
207
|
+
|
|
208
|
+
The per-user function is instantiated lazily on user's first invocation. Each user will have a separate instance of
|
|
209
|
+
the function. Schemas must be provided to enable OpenAPI documentation generation without a concrete instance.
|
|
210
|
+
|
|
211
|
+
Args:
|
|
212
|
+
config_type: The function configuration type
|
|
213
|
+
input_type: The input type for the function (can be a type or a Pydantic model)
|
|
214
|
+
single_output_type: The single output type for the function (can be a type or a Pydantic model)
|
|
215
|
+
streaming_output_type: The streaming output type for the function (can be a type or a Pydantic model)
|
|
216
|
+
framework_wrappers: Optional list of framework wrappers for automatic profiler hooking
|
|
217
|
+
"""
|
|
218
|
+
|
|
219
|
+
def register_per_user_function_inner(
|
|
220
|
+
fn: FunctionBuildCallableT[FunctionConfigT]) -> FunctionRegisteredCallableT[FunctionConfigT]:
|
|
221
|
+
from .type_registry import GlobalTypeRegistry
|
|
222
|
+
from .type_registry import RegisteredFunctionInfo
|
|
223
|
+
|
|
224
|
+
if not input_type:
|
|
225
|
+
raise ValueError("input_type must be provided to register a per-user function")
|
|
226
|
+
|
|
227
|
+
context_manager_fn = asynccontextmanager(fn)
|
|
228
|
+
|
|
229
|
+
framework_wrappers_list = list(framework_wrappers or [])
|
|
230
|
+
|
|
231
|
+
discovery_metadata = DiscoveryMetadata.from_config_type(config_type=config_type,
|
|
232
|
+
component_type=ComponentEnum.FUNCTION)
|
|
233
|
+
|
|
234
|
+
# Convert types to Pydantic models if they are not already
|
|
235
|
+
input_schema = DecomposedType(input_type).get_pydantic_schema()
|
|
236
|
+
single_output_schema = DecomposedType(single_output_type).get_pydantic_schema() if single_output_type else None
|
|
237
|
+
streaming_output_schema = DecomposedType(
|
|
238
|
+
streaming_output_type).get_pydantic_schema() if streaming_output_type else None
|
|
239
|
+
|
|
240
|
+
GlobalTypeRegistry.get().register_function(
|
|
241
|
+
RegisteredFunctionInfo(
|
|
242
|
+
full_type=config_type.full_type,
|
|
243
|
+
config_type=config_type,
|
|
244
|
+
build_fn=context_manager_fn,
|
|
245
|
+
framework_wrappers=framework_wrappers_list,
|
|
246
|
+
discovery_metadata=discovery_metadata,
|
|
247
|
+
is_per_user=True,
|
|
248
|
+
per_user_function_input_schema=input_schema,
|
|
249
|
+
per_user_function_single_output_schema=single_output_schema,
|
|
250
|
+
per_user_function_streaming_output_schema=streaming_output_schema,
|
|
251
|
+
))
|
|
252
|
+
|
|
253
|
+
return context_manager_fn
|
|
254
|
+
|
|
255
|
+
return register_per_user_function_inner
|
|
256
|
+
|
|
257
|
+
|
|
180
258
|
def register_function_group(config_type: type[FunctionGroupConfigT],
|
|
181
259
|
framework_wrappers: list[LLMFrameworkEnum | str] | None = None):
|
|
182
260
|
"""
|
|
@@ -211,6 +289,86 @@ def register_function_group(config_type: type[FunctionGroupConfigT],
|
|
|
211
289
|
return register_function_group_inner
|
|
212
290
|
|
|
213
291
|
|
|
292
|
+
def register_per_user_function_group(config_type: type[FunctionGroupConfigT],
|
|
293
|
+
framework_wrappers: list[LLMFrameworkEnum | str] | None = None):
|
|
294
|
+
"""
|
|
295
|
+
Register a per-user function group with optional framework_wrappers for automatic profiler hooking.
|
|
296
|
+
|
|
297
|
+
Per-user function groups are instantiated separately for each user, allowing for user-specific
|
|
298
|
+
shared state across multiple functions within the group.
|
|
299
|
+
"""
|
|
300
|
+
|
|
301
|
+
def register_per_user_function_group_inner(
|
|
302
|
+
fn: FunctionGroupBuildCallableT[FunctionGroupConfigT]
|
|
303
|
+
) -> FunctionGroupRegisteredCallableT[FunctionGroupConfigT]:
|
|
304
|
+
from .type_registry import GlobalTypeRegistry
|
|
305
|
+
from .type_registry import RegisteredFunctionGroupInfo
|
|
306
|
+
|
|
307
|
+
context_manager_fn = asynccontextmanager(fn)
|
|
308
|
+
|
|
309
|
+
framework_wrappers_list = list(framework_wrappers or [])
|
|
310
|
+
|
|
311
|
+
discovery_metadata = DiscoveryMetadata.from_config_type(config_type=config_type,
|
|
312
|
+
component_type=ComponentEnum.FUNCTION_GROUP)
|
|
313
|
+
|
|
314
|
+
GlobalTypeRegistry.get().register_function_group(
|
|
315
|
+
RegisteredFunctionGroupInfo(
|
|
316
|
+
full_type=config_type.full_type,
|
|
317
|
+
config_type=config_type,
|
|
318
|
+
build_fn=context_manager_fn,
|
|
319
|
+
framework_wrappers=framework_wrappers_list,
|
|
320
|
+
discovery_metadata=discovery_metadata,
|
|
321
|
+
is_per_user=True,
|
|
322
|
+
))
|
|
323
|
+
|
|
324
|
+
return context_manager_fn
|
|
325
|
+
|
|
326
|
+
return register_per_user_function_group_inner
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def register_middleware(config_type: type[MiddlewareBaseConfigT]):
|
|
330
|
+
"""
|
|
331
|
+
Register a middleware component.
|
|
332
|
+
|
|
333
|
+
Middleware provides middleware-style wrapping of calls with
|
|
334
|
+
preprocessing and postprocessing logic. They are built as components that can
|
|
335
|
+
be configured in YAML and referenced by name in configurations.
|
|
336
|
+
|
|
337
|
+
Args:
|
|
338
|
+
config_type: The middleware configuration type to register
|
|
339
|
+
|
|
340
|
+
Returns:
|
|
341
|
+
A decorator that wraps the build function as an async context manager
|
|
342
|
+
"""
|
|
343
|
+
|
|
344
|
+
def register_middleware_inner(
|
|
345
|
+
fn: MiddlewareBuildCallableT[MiddlewareBaseConfigT]
|
|
346
|
+
) -> MiddlewareRegisteredCallableT[MiddlewareBaseConfigT]:
|
|
347
|
+
from .type_registry import GlobalTypeRegistry
|
|
348
|
+
from .type_registry import RegisteredMiddlewareInfo
|
|
349
|
+
|
|
350
|
+
context_manager_fn = asynccontextmanager(fn)
|
|
351
|
+
|
|
352
|
+
discovery_metadata = DiscoveryMetadata.from_config_type(config_type=config_type,
|
|
353
|
+
component_type=ComponentEnum.MIDDLEWARE)
|
|
354
|
+
|
|
355
|
+
GlobalTypeRegistry.get().register_middleware(
|
|
356
|
+
RegisteredMiddlewareInfo(
|
|
357
|
+
full_type=config_type.full_type,
|
|
358
|
+
config_type=config_type,
|
|
359
|
+
build_fn=context_manager_fn,
|
|
360
|
+
discovery_metadata=discovery_metadata,
|
|
361
|
+
))
|
|
362
|
+
|
|
363
|
+
return context_manager_fn
|
|
364
|
+
|
|
365
|
+
return register_middleware_inner
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
# Compatibility alias for backwards compatibility
|
|
369
|
+
register_function_middleware = register_middleware
|
|
370
|
+
|
|
371
|
+
|
|
214
372
|
def register_llm_provider(config_type: type[LLMBaseConfigT]):
|
|
215
373
|
|
|
216
374
|
def register_llm_provider_inner(
|
|
@@ -405,11 +563,11 @@ def register_object_store(config_type: type[ObjectStoreBaseConfigT]):
|
|
|
405
563
|
return register_kv_store_inner
|
|
406
564
|
|
|
407
565
|
|
|
408
|
-
def register_ttc_strategy(config_type: type[
|
|
566
|
+
def register_ttc_strategy(config_type: type[TTCStrategyBaseConfigT]):
|
|
409
567
|
|
|
410
568
|
def register_ttc_strategy_inner(
|
|
411
|
-
fn: TTCStrategyBuildCallableT[
|
|
412
|
-
) ->
|
|
569
|
+
fn: TTCStrategyBuildCallableT[TTCStrategyBaseConfigT]
|
|
570
|
+
) -> TTCStrategyRegisteredCallableT[TTCStrategyBaseConfigT]:
|
|
413
571
|
from .type_registry import GlobalTypeRegistry
|
|
414
572
|
from .type_registry import RegisteredTTCStrategyInfo
|
|
415
573
|
|
|
@@ -429,6 +587,76 @@ def register_ttc_strategy(config_type: type[TTCStrategyRegisterCallableT]):
|
|
|
429
587
|
return register_ttc_strategy_inner
|
|
430
588
|
|
|
431
589
|
|
|
590
|
+
def register_trainer(config_type: type[TrainerConfigT]):
|
|
591
|
+
|
|
592
|
+
def register_trainer_inner(fn: TrainerBuildCallableT[TrainerConfigT]) -> TrainerRegisteredCallableT[TrainerConfigT]:
|
|
593
|
+
from .type_registry import GlobalTypeRegistry
|
|
594
|
+
from .type_registry import RegisteredTrainerInfo
|
|
595
|
+
|
|
596
|
+
context_manager_fn = asynccontextmanager(fn)
|
|
597
|
+
|
|
598
|
+
discovery_metadata = DiscoveryMetadata.from_config_type(config_type=config_type,
|
|
599
|
+
component_type=ComponentEnum.TRAINER)
|
|
600
|
+
|
|
601
|
+
GlobalTypeRegistry.get().register_trainer(
|
|
602
|
+
RegisteredTrainerInfo(full_type=config_type.full_type,
|
|
603
|
+
config_type=config_type,
|
|
604
|
+
build_fn=context_manager_fn,
|
|
605
|
+
discovery_metadata=discovery_metadata))
|
|
606
|
+
|
|
607
|
+
return context_manager_fn
|
|
608
|
+
|
|
609
|
+
return register_trainer_inner
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
def register_trainer_adapter(config_type: type[TrainerAdapterConfigT]):
|
|
613
|
+
|
|
614
|
+
def register_trainer_adapter_inner(
|
|
615
|
+
fn: TrainerAdapterBuildCallableT[TrainerAdapterConfigT]
|
|
616
|
+
) -> TrainerAdapterRegisteredCallableT[TrainerAdapterConfigT]:
|
|
617
|
+
from .type_registry import GlobalTypeRegistry
|
|
618
|
+
from .type_registry import RegisteredTrainerAdapterInfo
|
|
619
|
+
|
|
620
|
+
context_manager_fn = asynccontextmanager(fn)
|
|
621
|
+
|
|
622
|
+
discovery_metadata = DiscoveryMetadata.from_config_type(config_type=config_type,
|
|
623
|
+
component_type=ComponentEnum.TRAINER_ADAPTER)
|
|
624
|
+
|
|
625
|
+
GlobalTypeRegistry.get().register_trainer_adapter(
|
|
626
|
+
RegisteredTrainerAdapterInfo(full_type=config_type.full_type,
|
|
627
|
+
config_type=config_type,
|
|
628
|
+
build_fn=context_manager_fn,
|
|
629
|
+
discovery_metadata=discovery_metadata))
|
|
630
|
+
|
|
631
|
+
return context_manager_fn
|
|
632
|
+
|
|
633
|
+
return register_trainer_adapter_inner
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
def register_trajectory_builder(config_type: type[TrajectoryBuilderConfigT]):
|
|
637
|
+
|
|
638
|
+
def register_trajectory_builder_inner(
|
|
639
|
+
fn: TrajectoryBuilderBuildCallableT[TrajectoryBuilderConfigT]
|
|
640
|
+
) -> TrajectoryBuilderRegisteredCallableT[TrajectoryBuilderConfigT]:
|
|
641
|
+
from .type_registry import GlobalTypeRegistry
|
|
642
|
+
from .type_registry import RegisteredTrajectoryBuilderInfo
|
|
643
|
+
|
|
644
|
+
context_manager_fn = asynccontextmanager(fn)
|
|
645
|
+
|
|
646
|
+
discovery_metadata = DiscoveryMetadata.from_config_type(config_type=config_type,
|
|
647
|
+
component_type=ComponentEnum.TRAJECTORY_BUILDER)
|
|
648
|
+
|
|
649
|
+
GlobalTypeRegistry.get().register_trajectory_builder(
|
|
650
|
+
RegisteredTrajectoryBuilderInfo(full_type=config_type.full_type,
|
|
651
|
+
config_type=config_type,
|
|
652
|
+
build_fn=context_manager_fn,
|
|
653
|
+
discovery_metadata=discovery_metadata))
|
|
654
|
+
|
|
655
|
+
return context_manager_fn
|
|
656
|
+
|
|
657
|
+
return register_trajectory_builder_inner
|
|
658
|
+
|
|
659
|
+
|
|
432
660
|
def register_retriever_provider(config_type: type[RetrieverBaseConfigT]):
|
|
433
661
|
|
|
434
662
|
def register_retriever_provider_inner(
|