nvidia-nat 1.2.0rc5__py3-none-any.whl → 1.2.0rc7__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 → nat}/agent/react_agent/agent.py +12 -12
- {aiq → nat}/agent/react_agent/register.py +20 -20
- {aiq → nat}/agent/reasoning_agent/reasoning_agent.py +14 -14
- {aiq → nat}/agent/rewoo_agent/agent.py +7 -7
- {aiq → nat}/agent/rewoo_agent/prompt.py +11 -12
- {aiq → nat}/agent/rewoo_agent/register.py +47 -49
- {aiq → nat}/agent/tool_calling_agent/agent.py +4 -4
- {aiq → nat}/agent/tool_calling_agent/register.py +8 -8
- {aiq → nat}/authentication/api_key/api_key_auth_provider.py +6 -6
- {aiq → nat}/authentication/api_key/api_key_auth_provider_config.py +5 -5
- {aiq → nat}/authentication/api_key/register.py +4 -4
- {aiq → nat}/authentication/http_basic_auth/http_basic_auth_provider.py +10 -10
- {aiq → nat}/authentication/http_basic_auth/register.py +4 -4
- {aiq → nat}/authentication/interfaces.py +6 -6
- {aiq → nat}/authentication/oauth2/oauth2_auth_code_flow_provider.py +11 -11
- {aiq → nat}/authentication/oauth2/oauth2_auth_code_flow_provider_config.py +1 -1
- {aiq → nat}/authentication/oauth2/register.py +4 -4
- {aiq → nat}/authentication/register.py +3 -3
- {aiq → nat}/builder/builder.py +30 -30
- {aiq → nat}/builder/component_utils.py +23 -23
- {aiq → nat}/builder/context.py +35 -29
- {aiq → nat}/builder/embedder.py +1 -1
- {aiq → nat}/builder/eval_builder.py +13 -13
- {aiq → nat}/builder/evaluator.py +3 -3
- {aiq → nat}/builder/front_end.py +11 -11
- {aiq → nat}/builder/function.py +8 -8
- {aiq → nat}/builder/function_base.py +6 -6
- {aiq → nat}/builder/function_info.py +3 -3
- {aiq → nat}/builder/intermediate_step_manager.py +13 -13
- {aiq → nat}/builder/llm.py +1 -1
- {aiq → nat}/builder/retriever.py +1 -1
- {aiq → nat}/builder/user_interaction_manager.py +14 -10
- {aiq → nat}/builder/workflow.py +25 -25
- {aiq → nat}/builder/workflow_builder.py +86 -86
- {aiq → nat}/cli/cli_utils/config_override.py +2 -2
- {aiq → nat}/cli/cli_utils/validation.py +4 -4
- {aiq → nat}/cli/commands/configure/channel/add.py +2 -2
- {aiq → nat}/cli/commands/configure/channel/channel.py +4 -6
- {aiq → nat}/cli/commands/configure/channel/remove.py +2 -2
- {aiq → nat}/cli/commands/configure/channel/update.py +2 -2
- {aiq → nat}/cli/commands/configure/configure.py +3 -3
- {aiq → nat}/cli/commands/evaluate.py +3 -3
- {aiq → nat}/cli/commands/info/info.py +5 -7
- {aiq → nat}/cli/commands/info/list_channels.py +1 -1
- {aiq → nat}/cli/commands/info/list_components.py +14 -14
- {aiq → nat}/cli/commands/info/list_mcp.py +106 -15
- {aiq → nat}/cli/commands/registry/publish.py +9 -9
- {aiq → nat}/cli/commands/registry/pull.py +10 -10
- {aiq → nat}/cli/commands/registry/registry.py +5 -7
- {aiq → nat}/cli/commands/registry/remove.py +8 -8
- {aiq → nat}/cli/commands/registry/search.py +15 -15
- {aiq → nat}/cli/commands/sizing/calc.py +3 -3
- {aiq → nat}/cli/commands/start.py +15 -15
- {aiq → nat}/cli/commands/uninstall.py +5 -5
- {aiq → nat}/cli/commands/validate.py +1 -1
- {aiq → nat}/cli/commands/workflow/templates/pyproject.toml.j2 +4 -4
- {aiq → nat}/cli/commands/workflow/templates/workflow.py.j2 +4 -4
- {aiq → nat}/cli/commands/workflow/workflow.py +3 -3
- {aiq → nat}/cli/commands/workflow/workflow_commands.py +15 -11
- {aiq → nat}/cli/entrypoint.py +6 -6
- {aiq → nat}/cli/main.py +15 -2
- {aiq → nat}/cli/register_workflow.py +70 -70
- {aiq → nat}/cli/type_registry.py +82 -82
- {aiq → nat}/data_models/api_server.py +121 -99
- {aiq → nat}/data_models/authentication.py +2 -2
- {aiq → nat}/data_models/component.py +5 -1
- {aiq → nat}/data_models/component_ref.py +12 -12
- {aiq → nat}/data_models/config.py +17 -13
- {aiq → nat}/data_models/dataset_handler.py +58 -12
- {aiq → nat}/data_models/discovery_metadata.py +36 -66
- {aiq → nat}/data_models/evaluate.py +9 -9
- {aiq → nat}/data_models/intermediate_step.py +7 -7
- {aiq → nat}/data_models/retriever.py +2 -2
- {aiq → nat}/data_models/span.py +10 -7
- {aiq → nat}/data_models/step_adaptor.py +1 -1
- {aiq → nat}/data_models/telemetry_exporter.py +2 -2
- {aiq → nat}/embedder/nim_embedder.py +5 -5
- {aiq → nat}/embedder/openai_embedder.py +5 -5
- {aiq/retriever → nat/embedder}/register.py +2 -2
- {aiq → nat}/eval/config.py +4 -4
- {aiq → nat}/eval/dataset_handler/dataset_downloader.py +1 -1
- {aiq → nat}/eval/dataset_handler/dataset_filter.py +1 -1
- {aiq → nat}/eval/dataset_handler/dataset_handler.py +127 -14
- {aiq → nat}/eval/evaluate.py +38 -34
- {aiq → nat}/eval/evaluator/base_evaluator.py +9 -5
- {aiq → nat}/eval/evaluator/evaluator_model.py +4 -4
- {aiq → nat}/eval/intermediate_step_adapter.py +2 -2
- {aiq → nat}/eval/rag_evaluator/evaluate.py +8 -8
- {aiq → nat}/eval/rag_evaluator/register.py +7 -7
- {aiq → nat}/eval/remote_workflow.py +8 -8
- {aiq → nat}/eval/runners/config.py +2 -2
- {aiq → nat}/eval/runners/multi_eval_runner.py +4 -4
- {aiq → nat}/eval/runtime_event_subscriber.py +3 -3
- {aiq → nat}/eval/swe_bench_evaluator/evaluate.py +6 -6
- {aiq → nat}/eval/swe_bench_evaluator/register.py +4 -4
- {aiq → nat}/eval/trajectory_evaluator/evaluate.py +5 -5
- {aiq → nat}/eval/trajectory_evaluator/register.py +5 -5
- {aiq → nat}/eval/tunable_rag_evaluator/evaluate.py +3 -3
- {aiq → nat}/eval/tunable_rag_evaluator/register.py +6 -6
- {aiq → nat}/eval/utils/output_uploader.py +1 -1
- {aiq → nat}/eval/utils/weave_eval.py +6 -6
- {aiq → nat}/experimental/decorators/experimental_warning_decorator.py +6 -2
- {aiq → nat}/experimental/test_time_compute/editing/iterative_plan_refinement_editor.py +10 -10
- {aiq → nat}/experimental/test_time_compute/editing/llm_as_a_judge_editor.py +10 -10
- {aiq → nat}/experimental/test_time_compute/editing/motivation_aware_summarization.py +10 -10
- {aiq → nat}/experimental/test_time_compute/functions/execute_score_select_function.py +10 -10
- {aiq → nat}/experimental/test_time_compute/functions/plan_select_execute_function.py +17 -17
- aiq/experimental/test_time_compute/functions/its_tool_orchestration_function.py → nat/experimental/test_time_compute/functions/ttc_tool_orchestration_function.py +12 -12
- aiq/experimental/test_time_compute/functions/its_tool_wrapper_function.py → nat/experimental/test_time_compute/functions/ttc_tool_wrapper_function.py +10 -10
- {aiq → nat}/experimental/test_time_compute/models/editor_config.py +2 -2
- {aiq → nat}/experimental/test_time_compute/models/scoring_config.py +2 -2
- {aiq → nat}/experimental/test_time_compute/models/search_config.py +2 -2
- {aiq → nat}/experimental/test_time_compute/models/selection_config.py +2 -2
- {aiq → nat}/experimental/test_time_compute/models/strategy_base.py +4 -4
- {aiq → nat}/experimental/test_time_compute/register.py +2 -2
- {aiq → nat}/experimental/test_time_compute/scoring/llm_based_agent_scorer.py +11 -11
- {aiq → nat}/experimental/test_time_compute/scoring/llm_based_plan_scorer.py +11 -11
- {aiq → nat}/experimental/test_time_compute/scoring/motivation_aware_scorer.py +10 -10
- {aiq → nat}/experimental/test_time_compute/search/multi_llm_planner.py +10 -10
- {aiq → nat}/experimental/test_time_compute/search/multi_query_retrieval_search.py +10 -10
- {aiq → nat}/experimental/test_time_compute/search/single_shot_multi_plan_planner.py +11 -11
- {aiq → nat}/experimental/test_time_compute/selection/best_of_n_selector.py +7 -7
- {aiq → nat}/experimental/test_time_compute/selection/llm_based_agent_output_selector.py +11 -11
- {aiq → nat}/experimental/test_time_compute/selection/llm_based_output_merging_selector.py +11 -11
- {aiq → nat}/experimental/test_time_compute/selection/llm_based_plan_selector.py +11 -11
- {aiq → nat}/experimental/test_time_compute/selection/threshold_selector.py +7 -7
- {aiq → nat}/front_ends/console/authentication_flow_handler.py +6 -6
- {aiq → nat}/front_ends/console/console_front_end_config.py +2 -2
- {aiq → nat}/front_ends/console/console_front_end_plugin.py +9 -9
- {aiq → nat}/front_ends/console/register.py +5 -5
- {aiq → nat}/front_ends/fastapi/auth_flow_handlers/http_flow_handler.py +4 -4
- {aiq → nat}/front_ends/fastapi/auth_flow_handlers/websocket_flow_handler.py +6 -6
- {aiq → nat}/front_ends/fastapi/fastapi_front_end_config.py +22 -15
- {aiq → nat}/front_ends/fastapi/fastapi_front_end_plugin.py +10 -10
- {aiq → nat}/front_ends/fastapi/fastapi_front_end_plugin_worker.py +110 -115
- {aiq → nat}/front_ends/fastapi/intermediate_steps_subscriber.py +10 -10
- {aiq → nat}/front_ends/fastapi/main.py +8 -8
- {aiq → nat}/front_ends/fastapi/message_handler.py +58 -36
- {aiq → nat}/front_ends/fastapi/message_validator.py +55 -48
- {aiq → nat}/front_ends/fastapi/register.py +5 -5
- {aiq → nat}/front_ends/fastapi/response_helpers.py +26 -26
- {aiq → nat}/front_ends/fastapi/step_adaptor.py +35 -37
- {aiq → nat}/front_ends/mcp/mcp_front_end_config.py +12 -8
- nat/front_ends/mcp/mcp_front_end_plugin.py +81 -0
- nat/front_ends/mcp/mcp_front_end_plugin_worker.py +143 -0
- {aiq → nat}/front_ends/mcp/register.py +5 -5
- {aiq → nat}/front_ends/mcp/tool_converter.py +20 -21
- {aiq → nat}/front_ends/simple_base/simple_front_end_plugin_base.py +6 -6
- {aiq → nat}/llm/aws_bedrock_llm.py +5 -5
- {aiq → nat}/llm/nim_llm.py +5 -5
- {aiq → nat}/llm/openai_llm.py +5 -5
- {aiq → nat}/memory/__init__.py +2 -2
- nat/meta/pypi.md +58 -0
- {aiq → nat}/object_store/__init__.py +2 -2
- {aiq → nat}/object_store/in_memory_object_store.py +6 -6
- {aiq → nat}/observability/exporter/base_exporter.py +9 -9
- {aiq → nat}/observability/exporter/exporter.py +1 -1
- {aiq → nat}/observability/exporter/file_exporter.py +6 -6
- {aiq → nat}/observability/exporter/processing_exporter.py +9 -9
- {aiq → nat}/observability/exporter/raw_exporter.py +4 -4
- {aiq → nat}/observability/exporter/span_exporter.py +57 -34
- {aiq → nat}/observability/exporter_manager.py +6 -6
- {aiq → nat}/observability/mixin/file_mixin.py +2 -2
- {aiq → nat}/observability/processor/batching_processor.py +1 -1
- {aiq → nat}/observability/processor/callback_processor.py +1 -1
- {aiq → nat}/observability/processor/intermediate_step_serializer.py +4 -4
- {aiq → nat}/observability/processor/processor.py +1 -1
- {aiq → nat}/observability/register.py +7 -7
- {aiq → nat}/profiler/calc/calc_runner.py +18 -18
- {aiq → nat}/profiler/calc/calculations.py +3 -3
- {aiq → nat}/profiler/calc/plot.py +2 -2
- {aiq → nat}/profiler/callbacks/agno_callback_handler.py +14 -14
- {aiq → nat}/profiler/callbacks/langchain_callback_handler.py +11 -11
- {aiq → nat}/profiler/callbacks/llama_index_callback_handler.py +12 -12
- {aiq → nat}/profiler/callbacks/semantic_kernel_callback_handler.py +11 -11
- {aiq → nat}/profiler/data_models.py +2 -2
- {aiq → nat}/profiler/decorators/framework_wrapper.py +6 -6
- {aiq → nat}/profiler/decorators/function_tracking.py +10 -10
- {aiq → nat}/profiler/forecasting/model_trainer.py +5 -5
- {aiq → nat}/profiler/forecasting/models/linear_model.py +5 -4
- {aiq → nat}/profiler/forecasting/models/random_forest_regressor.py +5 -4
- {aiq → nat}/profiler/inference_optimization/bottleneck_analysis/nested_stack_analysis.py +7 -7
- {aiq → nat}/profiler/inference_optimization/bottleneck_analysis/simple_stack_analysis.py +4 -4
- {aiq → nat}/profiler/inference_optimization/experimental/concurrency_spike_analysis.py +6 -6
- {aiq → nat}/profiler/inference_optimization/experimental/prefix_span_analysis.py +6 -6
- {aiq → nat}/profiler/inference_optimization/llm_metrics.py +2 -2
- {aiq → nat}/profiler/inference_optimization/prompt_caching.py +5 -5
- {aiq → nat}/profiler/inference_optimization/token_uniqueness.py +4 -4
- {aiq → nat}/profiler/inference_optimization/workflow_runtimes.py +3 -3
- {aiq → nat}/profiler/intermediate_property_adapter.py +3 -3
- {aiq → nat}/profiler/profile_runner.py +17 -17
- {aiq → nat}/profiler/utils.py +4 -4
- {aiq → nat}/registry_handlers/local/local_handler.py +19 -19
- {aiq → nat}/registry_handlers/local/register_local.py +4 -4
- {aiq → nat}/registry_handlers/metadata_factory.py +7 -7
- {aiq → nat}/registry_handlers/package_utils.py +37 -33
- {aiq → nat}/registry_handlers/pypi/pypi_handler.py +21 -21
- {aiq → nat}/registry_handlers/pypi/register_pypi.py +6 -6
- {aiq → nat}/registry_handlers/registry_handler_base.py +21 -21
- {aiq → nat}/registry_handlers/rest/register_rest.py +7 -7
- {aiq → nat}/registry_handlers/rest/rest_handler.py +19 -19
- {aiq → nat}/registry_handlers/schemas/package.py +3 -3
- {aiq → nat}/registry_handlers/schemas/publish.py +17 -12
- {aiq → nat}/registry_handlers/schemas/pull.py +6 -6
- {aiq → nat}/registry_handlers/schemas/remove.py +2 -2
- {aiq → nat}/registry_handlers/schemas/search.py +11 -11
- {aiq → nat}/retriever/interface.py +6 -2
- {aiq → nat}/retriever/milvus/register.py +7 -7
- {aiq → nat}/retriever/milvus/retriever.py +8 -8
- {aiq → nat}/retriever/models.py +10 -7
- {aiq → nat}/retriever/nemo_retriever/register.py +6 -6
- {aiq → nat}/retriever/nemo_retriever/retriever.py +10 -10
- {aiq/embedder → nat/retriever}/register.py +2 -4
- {aiq → nat}/runtime/loader.py +38 -33
- {aiq → nat}/runtime/runner.py +30 -25
- {aiq → nat}/runtime/session.py +19 -15
- {aiq → nat}/runtime/user_metadata.py +1 -1
- {aiq → nat}/settings/global_settings.py +11 -11
- {aiq → nat}/tool/chat_completion.py +6 -6
- {aiq → nat}/tool/code_execution/README.md +2 -2
- {aiq → nat}/tool/code_execution/code_sandbox.py +1 -1
- {aiq → nat}/tool/code_execution/register.py +5 -5
- {aiq → nat}/tool/code_execution/test_code_execution_sandbox.py +1 -1
- {aiq → nat}/tool/datetime_tools.py +4 -4
- {aiq → nat}/tool/document_search.py +6 -6
- {aiq → nat}/tool/github_tools/create_github_commit.py +4 -4
- {aiq → nat}/tool/github_tools/create_github_issue.py +4 -4
- {aiq → nat}/tool/github_tools/create_github_pr.py +4 -4
- {aiq → nat}/tool/github_tools/get_github_file.py +4 -4
- {aiq → nat}/tool/github_tools/get_github_issue.py +4 -4
- {aiq → nat}/tool/github_tools/get_github_pr.py +4 -4
- {aiq → nat}/tool/github_tools/update_github_issue.py +4 -4
- {aiq → nat}/tool/mcp/exceptions.py +1 -1
- {aiq → nat}/tool/mcp/mcp_client.py +2 -2
- {aiq → nat}/tool/mcp/mcp_tool.py +7 -7
- {aiq → nat}/tool/memory_tools/add_memory_tool.py +6 -6
- {aiq → nat}/tool/memory_tools/delete_memory_tool.py +6 -6
- {aiq → nat}/tool/memory_tools/get_memory_tool.py +6 -6
- {aiq → nat}/tool/nvidia_rag.py +4 -4
- {aiq → nat}/tool/retriever.py +20 -15
- {aiq → nat}/tool/server_tools.py +16 -16
- {aiq → nat}/utils/dump_distro_mapping.py +2 -2
- {aiq → nat}/utils/exception_handlers/mcp.py +8 -8
- {aiq → nat}/utils/io/yaml_tools.py +1 -1
- {aiq → nat}/utils/metadata_utils.py +2 -2
- {aiq → nat}/utils/reactive/base/observable_base.py +2 -2
- {aiq → nat}/utils/reactive/base/subject_base.py +1 -1
- {aiq → nat}/utils/reactive/observable.py +5 -5
- {aiq → nat}/utils/reactive/observer.py +1 -1
- {aiq → nat}/utils/reactive/subject.py +4 -4
- {aiq → nat}/utils/reactive/subscription.py +1 -1
- {aiq → nat}/utils/settings/global_settings.py +4 -4
- {aiq → nat}/utils/type_converter.py +1 -1
- {nvidia_nat-1.2.0rc5.dist-info → nvidia_nat-1.2.0rc7.dist-info}/METADATA +37 -37
- nvidia_nat-1.2.0rc7.dist-info/RECORD +434 -0
- nvidia_nat-1.2.0rc7.dist-info/entry_points.txt +21 -0
- nvidia_nat-1.2.0rc7.dist-info/top_level.txt +1 -0
- aiq/embedder/langchain_client.py +0 -41
- aiq/front_ends/mcp/mcp_front_end_plugin.py +0 -93
- aiq/meta/module_to_distro.json +0 -3
- aiq/meta/pypi.md +0 -58
- nvidia_nat-1.2.0rc5.dist-info/RECORD +0 -435
- nvidia_nat-1.2.0rc5.dist-info/entry_points.txt +0 -20
- nvidia_nat-1.2.0rc5.dist-info/top_level.txt +0 -1
- {aiq → nat}/agent/__init__.py +0 -0
- {aiq → nat}/agent/base.py +0 -0
- {aiq → nat}/agent/dual_node.py +0 -0
- {aiq → nat}/agent/react_agent/__init__.py +0 -0
- {aiq → nat}/agent/react_agent/output_parser.py +0 -0
- {aiq → nat}/agent/react_agent/prompt.py +0 -0
- {aiq → nat}/agent/reasoning_agent/__init__.py +0 -0
- {aiq → nat}/agent/register.py +0 -0
- {aiq → nat}/agent/rewoo_agent/__init__.py +0 -0
- {aiq → nat}/agent/tool_calling_agent/__init__.py +0 -0
- {aiq → nat}/authentication/__init__.py +0 -0
- {aiq → nat}/authentication/api_key/__init__.py +0 -0
- {aiq → nat}/authentication/exceptions/__init__.py +0 -0
- {aiq → nat}/authentication/exceptions/api_key_exceptions.py +0 -0
- {aiq → nat}/authentication/http_basic_auth/__init__.py +0 -0
- {aiq → nat}/authentication/oauth2/__init__.py +0 -0
- {aiq → nat}/builder/__init__.py +0 -0
- {aiq → nat}/builder/framework_enum.py +0 -0
- {aiq → nat}/cli/__init__.py +0 -0
- {aiq → nat}/cli/cli_utils/__init__.py +0 -0
- {aiq → nat}/cli/commands/__init__.py +0 -0
- {aiq → nat}/cli/commands/configure/__init__.py +0 -0
- {aiq → nat}/cli/commands/configure/channel/__init__.py +0 -0
- {aiq → nat}/cli/commands/info/__init__.py +0 -0
- {aiq → nat}/cli/commands/registry/__init__.py +0 -0
- {aiq → nat}/cli/commands/sizing/__init__.py +0 -0
- {aiq → nat}/cli/commands/sizing/sizing.py +0 -0
- {aiq → nat}/cli/commands/workflow/__init__.py +0 -0
- {aiq → nat}/cli/commands/workflow/templates/__init__.py.j2 +0 -0
- {aiq → nat}/cli/commands/workflow/templates/config.yml.j2 +0 -0
- {aiq → nat}/cli/commands/workflow/templates/register.py.j2 +0 -0
- {aiq → nat}/data_models/__init__.py +0 -0
- {aiq → nat}/data_models/common.py +0 -0
- {aiq → nat}/data_models/embedder.py +0 -0
- {aiq → nat}/data_models/evaluator.py +0 -0
- {aiq → nat}/data_models/front_end.py +0 -0
- {aiq → nat}/data_models/function.py +0 -0
- {aiq → nat}/data_models/function_dependencies.py +0 -0
- {aiq → nat}/data_models/interactive.py +0 -0
- {aiq → nat}/data_models/invocation_node.py +0 -0
- {aiq → nat}/data_models/llm.py +0 -0
- {aiq → nat}/data_models/logging.py +0 -0
- {aiq → nat}/data_models/memory.py +0 -0
- {aiq → nat}/data_models/object_store.py +0 -0
- {aiq → nat}/data_models/profiler.py +0 -0
- {aiq → nat}/data_models/registry_handler.py +0 -0
- {aiq → nat}/data_models/retry_mixin.py +0 -0
- {aiq → nat}/data_models/streaming.py +0 -0
- {aiq → nat}/data_models/swe_bench_model.py +0 -0
- {aiq → nat}/data_models/ttc_strategy.py +0 -0
- {aiq → nat}/embedder/__init__.py +0 -0
- {aiq → nat}/eval/__init__.py +0 -0
- {aiq → nat}/eval/dataset_handler/__init__.py +0 -0
- {aiq → nat}/eval/evaluator/__init__.py +0 -0
- {aiq → nat}/eval/rag_evaluator/__init__.py +0 -0
- {aiq → nat}/eval/register.py +0 -0
- {aiq → nat}/eval/runners/__init__.py +0 -0
- {aiq → nat}/eval/swe_bench_evaluator/__init__.py +0 -0
- {aiq → nat}/eval/trajectory_evaluator/__init__.py +0 -0
- {aiq → nat}/eval/tunable_rag_evaluator/__init__.py +0 -0
- {aiq → nat}/eval/usage_stats.py +0 -0
- {aiq → nat}/eval/utils/__init__.py +0 -0
- {aiq → nat}/eval/utils/tqdm_position_registry.py +0 -0
- {aiq → nat}/experimental/__init__.py +0 -0
- {aiq → nat}/experimental/decorators/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/editing/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/functions/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/models/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/models/stage_enums.py +0 -0
- {aiq → nat}/experimental/test_time_compute/models/tool_use_config.py +0 -0
- {aiq → nat}/experimental/test_time_compute/models/ttc_item.py +0 -0
- {aiq → nat}/experimental/test_time_compute/scoring/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/search/__init__.py +0 -0
- {aiq → nat}/experimental/test_time_compute/selection/__init__.py +0 -0
- {aiq → nat}/front_ends/__init__.py +0 -0
- {aiq → nat}/front_ends/console/__init__.py +0 -0
- {aiq → nat}/front_ends/cron/__init__.py +0 -0
- {aiq → nat}/front_ends/fastapi/__init__.py +0 -0
- {aiq → nat}/front_ends/fastapi/auth_flow_handlers/__init__.py +0 -0
- {aiq → nat}/front_ends/fastapi/fastapi_front_end_controller.py +0 -0
- {aiq → nat}/front_ends/fastapi/html_snippets/__init__.py +0 -0
- {aiq → nat}/front_ends/fastapi/html_snippets/auth_code_grant_success.py +0 -0
- {aiq → nat}/front_ends/fastapi/job_store.py +0 -0
- {aiq → nat}/front_ends/mcp/__init__.py +0 -0
- {aiq → nat}/front_ends/register.py +0 -0
- {aiq → nat}/front_ends/simple_base/__init__.py +0 -0
- {aiq → nat}/llm/__init__.py +0 -0
- {aiq → nat}/llm/register.py +0 -0
- {aiq → nat}/llm/utils/__init__.py +0 -0
- {aiq → nat}/llm/utils/env_config_value.py +0 -0
- {aiq → nat}/llm/utils/error.py +0 -0
- {aiq → nat}/memory/interfaces.py +0 -0
- {aiq → nat}/memory/models.py +0 -0
- {aiq → nat}/object_store/interfaces.py +0 -0
- {aiq → nat}/object_store/models.py +0 -0
- {aiq → nat}/object_store/register.py +0 -0
- {aiq → nat}/observability/__init__.py +0 -0
- {aiq → nat}/observability/exporter/__init__.py +0 -0
- {aiq → nat}/observability/mixin/__init__.py +0 -0
- {aiq → nat}/observability/mixin/batch_config_mixin.py +0 -0
- {aiq → nat}/observability/mixin/collector_config_mixin.py +0 -0
- {aiq → nat}/observability/mixin/file_mode.py +0 -0
- {aiq → nat}/observability/mixin/resource_conflict_mixin.py +0 -0
- {aiq → nat}/observability/mixin/serialize_mixin.py +0 -0
- {aiq → nat}/observability/mixin/type_introspection_mixin.py +0 -0
- {aiq → nat}/observability/processor/__init__.py +0 -0
- {aiq → nat}/observability/utils/__init__.py +0 -0
- {aiq → nat}/observability/utils/dict_utils.py +0 -0
- {aiq → nat}/observability/utils/time_utils.py +0 -0
- {aiq → nat}/plugins/.namespace +0 -0
- {aiq → nat}/profiler/__init__.py +0 -0
- {aiq → nat}/profiler/calc/__init__.py +0 -0
- {aiq → nat}/profiler/calc/data_models.py +0 -0
- {aiq → nat}/profiler/callbacks/__init__.py +0 -0
- {aiq → nat}/profiler/callbacks/base_callback_class.py +0 -0
- {aiq → nat}/profiler/callbacks/token_usage_base_model.py +0 -0
- {aiq → nat}/profiler/data_frame_row.py +0 -0
- {aiq → nat}/profiler/decorators/__init__.py +0 -0
- {aiq → nat}/profiler/forecasting/__init__.py +0 -0
- {aiq → nat}/profiler/forecasting/config.py +0 -0
- {aiq → nat}/profiler/forecasting/models/__init__.py +0 -0
- {aiq → nat}/profiler/forecasting/models/forecasting_base_model.py +0 -0
- {aiq → nat}/profiler/inference_metrics_model.py +0 -0
- {aiq → nat}/profiler/inference_optimization/__init__.py +0 -0
- {aiq → nat}/profiler/inference_optimization/bottleneck_analysis/__init__.py +0 -0
- {aiq → nat}/profiler/inference_optimization/data_models.py +0 -0
- {aiq → nat}/profiler/inference_optimization/experimental/__init__.py +0 -0
- {aiq → nat}/registry_handlers/__init__.py +0 -0
- {aiq → nat}/registry_handlers/local/__init__.py +0 -0
- {aiq → nat}/registry_handlers/pypi/__init__.py +0 -0
- {aiq → nat}/registry_handlers/register.py +0 -0
- {aiq → nat}/registry_handlers/rest/__init__.py +0 -0
- {aiq → nat}/registry_handlers/schemas/__init__.py +0 -0
- {aiq → nat}/registry_handlers/schemas/headers.py +0 -0
- {aiq → nat}/registry_handlers/schemas/status.py +0 -0
- {aiq → nat}/retriever/__init__.py +0 -0
- {aiq → nat}/retriever/milvus/__init__.py +0 -0
- {aiq → nat}/retriever/nemo_retriever/__init__.py +0 -0
- {aiq → nat}/runtime/__init__.py +0 -0
- {aiq → nat}/settings/__init__.py +0 -0
- {aiq → nat}/test/.namespace +0 -0
- {aiq → nat}/tool/__init__.py +0 -0
- {aiq → nat}/tool/code_execution/__init__.py +0 -0
- {aiq → nat}/tool/code_execution/local_sandbox/.gitignore +0 -0
- {aiq → nat}/tool/code_execution/local_sandbox/Dockerfile.sandbox +0 -0
- {aiq → nat}/tool/code_execution/local_sandbox/__init__.py +0 -0
- {aiq → nat}/tool/code_execution/local_sandbox/local_sandbox_server.py +0 -0
- {aiq → nat}/tool/code_execution/local_sandbox/sandbox.requirements.txt +0 -0
- {aiq → nat}/tool/code_execution/local_sandbox/start_local_sandbox.sh +0 -0
- {aiq → nat}/tool/code_execution/utils.py +0 -0
- {aiq → nat}/tool/github_tools/__init__.py +0 -0
- {aiq → nat}/tool/mcp/__init__.py +0 -0
- {aiq → nat}/tool/memory_tools/__init__.py +0 -0
- {aiq → nat}/tool/register.py +0 -0
- {aiq → nat}/utils/__init__.py +0 -0
- {aiq → nat}/utils/data_models/__init__.py +0 -0
- {aiq → nat}/utils/data_models/schema_validator.py +0 -0
- {aiq → nat}/utils/debugging_utils.py +0 -0
- {aiq → nat}/utils/exception_handlers/__init__.py +0 -0
- {aiq → nat}/utils/exception_handlers/automatic_retries.py +0 -0
- {aiq → nat}/utils/exception_handlers/schemas.py +0 -0
- {aiq → nat}/utils/io/__init__.py +0 -0
- {aiq → nat}/utils/io/model_processing.py +0 -0
- {aiq → nat}/utils/log_utils.py +0 -0
- {aiq → nat}/utils/optional_imports.py +0 -0
- {aiq → nat}/utils/producer_consumer_queue.py +0 -0
- {aiq → nat}/utils/reactive/__init__.py +0 -0
- {aiq → nat}/utils/reactive/base/__init__.py +0 -0
- {aiq → nat}/utils/reactive/base/observer_base.py +0 -0
- {aiq → nat}/utils/settings/__init__.py +0 -0
- {aiq → nat}/utils/string_utils.py +0 -0
- {aiq → nat}/utils/type_utils.py +0 -0
- {aiq → nat}/utils/url_utils.py +0 -0
- {nvidia_nat-1.2.0rc5.dist-info → nvidia_nat-1.2.0rc7.dist-info}/WHEEL +0 -0
- {nvidia_nat-1.2.0rc5.dist-info → nvidia_nat-1.2.0rc7.dist-info}/licenses/LICENSE-3rd-party.txt +0 -0
- {nvidia_nat-1.2.0rc5.dist-info → nvidia_nat-1.2.0rc7.dist-info}/licenses/LICENSE.md +0 -0
{aiq → nat}/runtime/runner.py
RENAMED
|
@@ -17,12 +17,12 @@ import logging
|
|
|
17
17
|
import typing
|
|
18
18
|
from enum import Enum
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
20
|
+
from nat.builder.context import Context
|
|
21
|
+
from nat.builder.context import ContextState
|
|
22
|
+
from nat.builder.function import Function
|
|
23
|
+
from nat.data_models.invocation_node import InvocationNode
|
|
24
|
+
from nat.observability.exporter_manager import ExporterManager
|
|
25
|
+
from nat.utils.reactive.subject import Subject
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
@@ -31,7 +31,7 @@ class UserManagerBase:
|
|
|
31
31
|
pass
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
class
|
|
34
|
+
class RunnerState(Enum):
|
|
35
35
|
UNINITIALIZED = 0
|
|
36
36
|
INITIALIZED = 1
|
|
37
37
|
RUNNING = 2
|
|
@@ -42,15 +42,15 @@ class AIQRunnerState(Enum):
|
|
|
42
42
|
_T = typing.TypeVar("_T")
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
class
|
|
45
|
+
class Runner:
|
|
46
46
|
|
|
47
47
|
def __init__(self,
|
|
48
48
|
input_message: typing.Any,
|
|
49
49
|
entry_fn: Function,
|
|
50
|
-
context_state:
|
|
50
|
+
context_state: ContextState,
|
|
51
51
|
exporter_manager: ExporterManager):
|
|
52
52
|
"""
|
|
53
|
-
The
|
|
53
|
+
The Runner class is used to run a workflow. It handles converting input and output data types and running the
|
|
54
54
|
workflow with the specified concurrency.
|
|
55
55
|
|
|
56
56
|
Parameters
|
|
@@ -59,7 +59,7 @@ class AIQRunner:
|
|
|
59
59
|
The input message to the workflow
|
|
60
60
|
entry_fn : Function
|
|
61
61
|
The entry function to the workflow
|
|
62
|
-
context_state :
|
|
62
|
+
context_state : ContextState
|
|
63
63
|
The context state to use
|
|
64
64
|
exporter_manager : ExporterManager
|
|
65
65
|
The exporter manager to use
|
|
@@ -70,9 +70,9 @@ class AIQRunner:
|
|
|
70
70
|
|
|
71
71
|
self._entry_fn = entry_fn
|
|
72
72
|
self._context_state = context_state
|
|
73
|
-
self._context =
|
|
73
|
+
self._context = Context(self._context_state)
|
|
74
74
|
|
|
75
|
-
self._state =
|
|
75
|
+
self._state = RunnerState.UNINITIALIZED
|
|
76
76
|
|
|
77
77
|
self._input_message_token = None
|
|
78
78
|
|
|
@@ -82,7 +82,7 @@ class AIQRunner:
|
|
|
82
82
|
self._exporter_manager = exporter_manager
|
|
83
83
|
|
|
84
84
|
@property
|
|
85
|
-
def context(self) ->
|
|
85
|
+
def context(self) -> Context:
|
|
86
86
|
return self._context
|
|
87
87
|
|
|
88
88
|
def convert(self, value: typing.Any, to_type: type[_T]) -> _T:
|
|
@@ -100,8 +100,8 @@ class AIQRunner:
|
|
|
100
100
|
function_id="root",
|
|
101
101
|
))
|
|
102
102
|
|
|
103
|
-
if (self._state ==
|
|
104
|
-
self._state =
|
|
103
|
+
if (self._state == RunnerState.UNINITIALIZED):
|
|
104
|
+
self._state = RunnerState.INITIALIZED
|
|
105
105
|
else:
|
|
106
106
|
raise ValueError("Cannot enter the context more than once")
|
|
107
107
|
|
|
@@ -114,7 +114,7 @@ class AIQRunner:
|
|
|
114
114
|
|
|
115
115
|
self._context_state.input_message.reset(self._input_message_token)
|
|
116
116
|
|
|
117
|
-
if (self._state not in (
|
|
117
|
+
if (self._state not in (RunnerState.COMPLETED, RunnerState.FAILED)):
|
|
118
118
|
raise ValueError("Cannot exit the context without completing the workflow")
|
|
119
119
|
|
|
120
120
|
@typing.overload
|
|
@@ -127,11 +127,11 @@ class AIQRunner:
|
|
|
127
127
|
|
|
128
128
|
async def result(self, to_type: type | None = None):
|
|
129
129
|
|
|
130
|
-
if (self._state !=
|
|
130
|
+
if (self._state != RunnerState.INITIALIZED):
|
|
131
131
|
raise ValueError("Cannot run the workflow without entering the context")
|
|
132
132
|
|
|
133
133
|
try:
|
|
134
|
-
self._state =
|
|
134
|
+
self._state = RunnerState.RUNNING
|
|
135
135
|
|
|
136
136
|
if (not self._entry_fn.has_single_output):
|
|
137
137
|
raise ValueError("Workflow does not support single output")
|
|
@@ -145,7 +145,7 @@ class AIQRunner:
|
|
|
145
145
|
if event_stream:
|
|
146
146
|
event_stream.on_complete()
|
|
147
147
|
|
|
148
|
-
self._state =
|
|
148
|
+
self._state = RunnerState.COMPLETED
|
|
149
149
|
|
|
150
150
|
return result
|
|
151
151
|
except Exception as e:
|
|
@@ -153,17 +153,17 @@ class AIQRunner:
|
|
|
153
153
|
event_stream = self._context_state.event_stream.get()
|
|
154
154
|
if event_stream:
|
|
155
155
|
event_stream.on_complete()
|
|
156
|
-
self._state =
|
|
156
|
+
self._state = RunnerState.FAILED
|
|
157
157
|
|
|
158
158
|
raise
|
|
159
159
|
|
|
160
160
|
async def result_stream(self, to_type: type | None = None):
|
|
161
161
|
|
|
162
|
-
if (self._state !=
|
|
162
|
+
if (self._state != RunnerState.INITIALIZED):
|
|
163
163
|
raise ValueError("Cannot run the workflow without entering the context")
|
|
164
164
|
|
|
165
165
|
try:
|
|
166
|
-
self._state =
|
|
166
|
+
self._state = RunnerState.RUNNING
|
|
167
167
|
|
|
168
168
|
if (not self._entry_fn.has_streaming_output):
|
|
169
169
|
raise ValueError("Workflow does not support streaming output")
|
|
@@ -173,7 +173,7 @@ class AIQRunner:
|
|
|
173
173
|
async for m in self._entry_fn.astream(self._input_message, to_type=to_type):
|
|
174
174
|
yield m
|
|
175
175
|
|
|
176
|
-
self._state =
|
|
176
|
+
self._state = RunnerState.COMPLETED
|
|
177
177
|
|
|
178
178
|
# Close the intermediate stream
|
|
179
179
|
event_stream = self._context_state.event_stream.get()
|
|
@@ -185,6 +185,11 @@ class AIQRunner:
|
|
|
185
185
|
event_stream = self._context_state.event_stream.get()
|
|
186
186
|
if event_stream:
|
|
187
187
|
event_stream.on_complete()
|
|
188
|
-
self._state =
|
|
188
|
+
self._state = RunnerState.FAILED
|
|
189
189
|
|
|
190
190
|
raise
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
# Compatibility aliases with previous releases
|
|
194
|
+
AIQRunnerState = RunnerState
|
|
195
|
+
AIQRunner = Runner
|
{aiq → nat}/runtime/session.py
RENAMED
|
@@ -23,15 +23,15 @@ from contextlib import nullcontext
|
|
|
23
23
|
|
|
24
24
|
from starlette.requests import HTTPConnection
|
|
25
25
|
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
from
|
|
34
|
-
from
|
|
26
|
+
from nat.builder.context import Context
|
|
27
|
+
from nat.builder.context import ContextState
|
|
28
|
+
from nat.builder.workflow import Workflow
|
|
29
|
+
from nat.data_models.authentication import AuthenticatedContext
|
|
30
|
+
from nat.data_models.authentication import AuthFlowType
|
|
31
|
+
from nat.data_models.authentication import AuthProviderBaseConfig
|
|
32
|
+
from nat.data_models.config import Config
|
|
33
|
+
from nat.data_models.interactive import HumanResponse
|
|
34
|
+
from nat.data_models.interactive import InteractionPrompt
|
|
35
35
|
|
|
36
36
|
_T = typing.TypeVar("_T")
|
|
37
37
|
|
|
@@ -40,11 +40,11 @@ class UserManagerBase:
|
|
|
40
40
|
pass
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
class
|
|
43
|
+
class SessionManager:
|
|
44
44
|
|
|
45
45
|
def __init__(self, workflow: Workflow, max_concurrency: int = 8):
|
|
46
46
|
"""
|
|
47
|
-
The
|
|
47
|
+
The SessionManager class is used to run and manage a user workflow session. It runs and manages the context,
|
|
48
48
|
and configuration of a workflow with the specified concurrency.
|
|
49
49
|
|
|
50
50
|
Parameters
|
|
@@ -61,8 +61,8 @@ class AIQSessionManager:
|
|
|
61
61
|
self._workflow: Workflow = workflow
|
|
62
62
|
|
|
63
63
|
self._max_concurrency = max_concurrency
|
|
64
|
-
self._context_state =
|
|
65
|
-
self._context =
|
|
64
|
+
self._context_state = ContextState.get()
|
|
65
|
+
self._context = Context(self._context_state)
|
|
66
66
|
|
|
67
67
|
# We save the context because Uvicorn spawns a new process
|
|
68
68
|
# for each request, and we need to restore the context vars
|
|
@@ -75,7 +75,7 @@ class AIQSessionManager:
|
|
|
75
75
|
self._semaphore = nullcontext()
|
|
76
76
|
|
|
77
77
|
@property
|
|
78
|
-
def config(self) ->
|
|
78
|
+
def config(self) -> Config:
|
|
79
79
|
return self._workflow.config
|
|
80
80
|
|
|
81
81
|
@property
|
|
@@ -83,7 +83,7 @@ class AIQSessionManager:
|
|
|
83
83
|
return self._workflow
|
|
84
84
|
|
|
85
85
|
@property
|
|
86
|
-
def context(self) ->
|
|
86
|
+
def context(self) -> Context:
|
|
87
87
|
return self._context
|
|
88
88
|
|
|
89
89
|
@asynccontextmanager
|
|
@@ -156,3 +156,7 @@ class AIQSessionManager:
|
|
|
156
156
|
|
|
157
157
|
if request.headers.get("conversation-id"):
|
|
158
158
|
self._context_state.conversation_id.set(request.headers["conversation-id"])
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# Compatibility aliases with previous releases
|
|
162
|
+
AIQSessionManager = SessionManager
|
|
@@ -30,12 +30,12 @@ from pydantic import ValidationInfo
|
|
|
30
30
|
from pydantic import ValidatorFunctionWrapHandler
|
|
31
31
|
from pydantic import field_validator
|
|
32
32
|
|
|
33
|
-
from
|
|
34
|
-
from
|
|
35
|
-
from
|
|
36
|
-
from
|
|
37
|
-
from
|
|
38
|
-
from
|
|
33
|
+
from nat.cli.type_registry import GlobalTypeRegistry
|
|
34
|
+
from nat.cli.type_registry import RegisteredInfo
|
|
35
|
+
from nat.data_models.common import HashableBaseModel
|
|
36
|
+
from nat.data_models.common import TypedBaseModel
|
|
37
|
+
from nat.data_models.common import TypedBaseModelT
|
|
38
|
+
from nat.data_models.registry_handler import RegistryHandlerBaseConfig
|
|
39
39
|
|
|
40
40
|
logger = logging.getLogger(__name__)
|
|
41
41
|
|
|
@@ -152,7 +152,7 @@ class Settings(HashableBaseModel):
|
|
|
152
152
|
@staticmethod
|
|
153
153
|
def from_file():
|
|
154
154
|
|
|
155
|
-
configuration_directory = os.getenv("
|
|
155
|
+
configuration_directory = os.getenv("NAT_CONFIG_DIR", user_config_dir(appname="nat"))
|
|
156
156
|
|
|
157
157
|
if not os.path.exists(configuration_directory):
|
|
158
158
|
os.makedirs(configuration_directory, exist_ok=True)
|
|
@@ -181,7 +181,7 @@ class Settings(HashableBaseModel):
|
|
|
181
181
|
if (remove):
|
|
182
182
|
if os.path.exists(self.configuration_directory):
|
|
183
183
|
os.rmdir(self.configuration_directory)
|
|
184
|
-
self._configuration_directory = os.getenv("
|
|
184
|
+
self._configuration_directory = os.getenv("NAT_CONFIG_DIR", user_config_dir(appname="nat"))
|
|
185
185
|
|
|
186
186
|
def _save_settings(self) -> None:
|
|
187
187
|
|
|
@@ -246,7 +246,7 @@ class Settings(HashableBaseModel):
|
|
|
246
246
|
|
|
247
247
|
def override_settings(self, config_file: str) -> "Settings":
|
|
248
248
|
|
|
249
|
-
from
|
|
249
|
+
from nat.utils.io.yaml_tools import yaml_load
|
|
250
250
|
|
|
251
251
|
override_settings_dict = yaml_load(config_file)
|
|
252
252
|
|
|
@@ -293,8 +293,8 @@ class GlobalSettings:
|
|
|
293
293
|
def get() -> Settings:
|
|
294
294
|
|
|
295
295
|
if (GlobalSettings._global_settings is None):
|
|
296
|
-
from
|
|
297
|
-
from
|
|
296
|
+
from nat.runtime.loader import PluginTypes
|
|
297
|
+
from nat.runtime.loader import discover_and_register_plugins
|
|
298
298
|
|
|
299
299
|
discover_and_register_plugins(PluginTypes.REGISTRY_HANDLER)
|
|
300
300
|
|
|
@@ -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
|
-
Simple Completion Function for
|
|
16
|
+
Simple Completion Function for NAT
|
|
17
17
|
|
|
18
18
|
This module provides a simple completion function that can handle
|
|
19
19
|
natural language queries and perform basic text completion tasks.
|
|
@@ -21,11 +21,11 @@ natural language queries and perform basic text completion tasks.
|
|
|
21
21
|
|
|
22
22
|
from pydantic import Field
|
|
23
23
|
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from
|
|
24
|
+
from nat.builder.builder import Builder
|
|
25
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
26
|
+
from nat.cli.register_workflow import register_function
|
|
27
|
+
from nat.data_models.component_ref import LLMRef
|
|
28
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
class ChatCompletionConfig(FunctionBaseConfig, name="chat_completion"):
|
|
@@ -35,7 +35,7 @@ The Code Execution Sandbox provides:
|
|
|
35
35
|
Navigate to the local sandbox directory and start the server:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
cd src/
|
|
38
|
+
cd src/nat/tool/code_execution/local_sandbox
|
|
39
39
|
./start_local_sandbox.sh
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -62,7 +62,7 @@ export OUTPUT_DATA_PATH=/path/to/output
|
|
|
62
62
|
Run the comprehensive test suite to verify everything is working:
|
|
63
63
|
|
|
64
64
|
```bash
|
|
65
|
-
cd src/
|
|
65
|
+
cd src/nat/tool/code_execution
|
|
66
66
|
pytest test_code_execution_sandbox.py
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -20,10 +20,10 @@ from pydantic import BaseModel
|
|
|
20
20
|
from pydantic import Field
|
|
21
21
|
from pydantic import HttpUrl
|
|
22
22
|
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
23
|
+
from nat.builder.builder import Builder
|
|
24
|
+
from nat.builder.function_info import FunctionInfo
|
|
25
|
+
from nat.cli.register_workflow import register_function
|
|
26
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
@@ -41,7 +41,7 @@ class CodeExecutionToolConfig(FunctionBaseConfig, name="code_execution"):
|
|
|
41
41
|
|
|
42
42
|
@register_function(config_type=CodeExecutionToolConfig)
|
|
43
43
|
async def code_execution_tool(config: CodeExecutionToolConfig, builder: Builder):
|
|
44
|
-
from
|
|
44
|
+
from nat.tool.code_execution.code_sandbox import get_sandbox
|
|
45
45
|
|
|
46
46
|
class CodeExecutionInputSchema(BaseModel):
|
|
47
47
|
generated_code: str = Field(description="String containing the code to be executed")
|
|
@@ -50,7 +50,7 @@ class TestCodeExecutionSandbox:
|
|
|
50
50
|
except (ConnectionError, Timeout, RequestException):
|
|
51
51
|
pytest.skip(
|
|
52
52
|
f"Sandbox server is not running at {sandbox_config['url']}. "
|
|
53
|
-
"Please start it with: cd src/
|
|
53
|
+
"Please start it with: cd src/nat/tool/code_execution/local_sandbox && ./start_local_sandbox.sh")
|
|
54
54
|
|
|
55
55
|
def execute_code(self, sandbox_config: dict[str, Any], code: str, language: str = "python") -> dict[str, Any]:
|
|
56
56
|
"""
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
16
|
+
from nat.builder.builder import Builder
|
|
17
|
+
from nat.builder.function_info import FunctionInfo
|
|
18
|
+
from nat.cli.register_workflow import register_function
|
|
19
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class CurrentTimeToolConfig(FunctionBaseConfig, name="current_datetime"):
|
|
@@ -18,12 +18,12 @@ import logging
|
|
|
18
18
|
|
|
19
19
|
from pydantic import Field
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
21
|
+
from nat.builder.builder import Builder
|
|
22
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
23
|
+
from nat.builder.function_info import FunctionInfo
|
|
24
|
+
from nat.cli.register_workflow import register_function
|
|
25
|
+
from nat.data_models.component_ref import LLMRef
|
|
26
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
from pydantic import BaseModel
|
|
17
17
|
from pydantic import Field
|
|
18
18
|
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
19
|
+
from nat.builder.builder import Builder
|
|
20
|
+
from nat.builder.function_info import FunctionInfo
|
|
21
|
+
from nat.cli.register_workflow import register_function
|
|
22
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class GithubCommitCodeModel(BaseModel):
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
from pydantic import BaseModel
|
|
17
17
|
from pydantic import Field
|
|
18
18
|
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
19
|
+
from nat.builder.builder import Builder
|
|
20
|
+
from nat.builder.function_info import FunctionInfo
|
|
21
|
+
from nat.cli.register_workflow import register_function
|
|
22
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class GithubCreateIssueModel(BaseModel):
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
from pydantic import BaseModel
|
|
17
17
|
from pydantic import Field
|
|
18
18
|
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
19
|
+
from nat.builder.builder import Builder
|
|
20
|
+
from nat.builder.function_info import FunctionInfo
|
|
21
|
+
from nat.cli.register_workflow import register_function
|
|
22
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class GithubCreatePullModel(BaseModel):
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
-
from
|
|
17
|
-
from
|
|
18
|
-
from
|
|
19
|
-
from
|
|
16
|
+
from nat.builder.builder import Builder
|
|
17
|
+
from nat.builder.function_info import FunctionInfo
|
|
18
|
+
from nat.cli.register_workflow import register_function
|
|
19
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class GithubGetFileToolConfig(FunctionBaseConfig, name="github_getfile"):
|
|
@@ -20,10 +20,10 @@ from pydantic import BaseModel
|
|
|
20
20
|
from pydantic import Field
|
|
21
21
|
from pydantic import field_validator
|
|
22
22
|
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
23
|
+
from nat.builder.builder import Builder
|
|
24
|
+
from nat.builder.function_info import FunctionInfo
|
|
25
|
+
from nat.cli.register_workflow import register_function
|
|
26
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
class GithubListIssueModel(BaseModel):
|
|
@@ -18,10 +18,10 @@ from typing import Literal
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
from pydantic import Field
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
21
|
+
from nat.builder.builder import Builder
|
|
22
|
+
from nat.builder.function_info import FunctionInfo
|
|
23
|
+
from nat.cli.register_workflow import register_function
|
|
24
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class GithubListPullsModel(BaseModel):
|
|
@@ -18,10 +18,10 @@ from typing import Literal
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
from pydantic import Field
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
21
|
+
from nat.builder.builder import Builder
|
|
22
|
+
from nat.builder.function_info import FunctionInfo
|
|
23
|
+
from nat.cli.register_workflow import register_function
|
|
24
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class GithubUpdateIssueModel(BaseModel):
|
|
@@ -108,7 +108,7 @@ class MCPToolNotFoundError(MCPError):
|
|
|
108
108
|
url=url,
|
|
109
109
|
category=MCPErrorCategory.TOOL_NOT_FOUND,
|
|
110
110
|
suggestions=[
|
|
111
|
-
"Use '
|
|
111
|
+
"Use 'nat info mcp --detail' to see available tools",
|
|
112
112
|
"Check that the tool name is spelled correctly"
|
|
113
113
|
],
|
|
114
114
|
original_exception=original_exception)
|
|
@@ -27,8 +27,8 @@ from pydantic import BaseModel
|
|
|
27
27
|
from pydantic import Field
|
|
28
28
|
from pydantic import create_model
|
|
29
29
|
|
|
30
|
-
from
|
|
31
|
-
from
|
|
30
|
+
from nat.tool.mcp.exceptions import MCPToolNotFoundError
|
|
31
|
+
from nat.utils.exception_handlers.mcp import mcp_exception_handler
|
|
32
32
|
|
|
33
33
|
logger = logging.getLogger(__name__)
|
|
34
34
|
|
{aiq → nat}/tool/mcp/mcp_tool.py
RENAMED
|
@@ -19,10 +19,10 @@ from pydantic import BaseModel
|
|
|
19
19
|
from pydantic import Field
|
|
20
20
|
from pydantic import HttpUrl
|
|
21
21
|
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
22
|
+
from nat.builder.builder import Builder
|
|
23
|
+
from nat.builder.function_info import FunctionInfo
|
|
24
|
+
from nat.cli.register_workflow import register_function
|
|
25
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
@@ -50,11 +50,11 @@ class MCPToolConfig(FunctionBaseConfig, name="mcp_tool_wrapper"):
|
|
|
50
50
|
@register_function(config_type=MCPToolConfig)
|
|
51
51
|
async def mcp_tool(config: MCPToolConfig, builder: Builder): # pylint: disable=unused-argument
|
|
52
52
|
"""
|
|
53
|
-
Generate
|
|
53
|
+
Generate a NAT Function that wraps a tool provided by the MCP server.
|
|
54
54
|
"""
|
|
55
55
|
|
|
56
|
-
from
|
|
57
|
-
from
|
|
56
|
+
from nat.tool.mcp.mcp_client import MCPBuilder
|
|
57
|
+
from nat.tool.mcp.mcp_client import MCPToolClient
|
|
58
58
|
|
|
59
59
|
client = MCPBuilder(url=str(config.url))
|
|
60
60
|
|
|
@@ -17,12 +17,12 @@ import logging
|
|
|
17
17
|
|
|
18
18
|
from pydantic import Field
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
20
|
+
from nat.builder.builder import Builder
|
|
21
|
+
from nat.builder.function_info import FunctionInfo
|
|
22
|
+
from nat.cli.register_workflow import register_function
|
|
23
|
+
from nat.data_models.component_ref import MemoryRef
|
|
24
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
25
|
+
from nat.memory.models import MemoryItem
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
@@ -17,12 +17,12 @@ import logging
|
|
|
17
17
|
|
|
18
18
|
from pydantic import Field
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
20
|
+
from nat.builder.builder import Builder
|
|
21
|
+
from nat.builder.function_info import FunctionInfo
|
|
22
|
+
from nat.cli.register_workflow import register_function
|
|
23
|
+
from nat.data_models.component_ref import MemoryRef
|
|
24
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
25
|
+
from nat.memory.models import DeleteMemoryInput
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|
|
@@ -17,12 +17,12 @@ import logging
|
|
|
17
17
|
|
|
18
18
|
from pydantic import Field
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
20
|
+
from nat.builder.builder import Builder
|
|
21
|
+
from nat.builder.function_info import FunctionInfo
|
|
22
|
+
from nat.cli.register_workflow import register_function
|
|
23
|
+
from nat.data_models.component_ref import MemoryRef
|
|
24
|
+
from nat.data_models.function import FunctionBaseConfig
|
|
25
|
+
from nat.memory.models import SearchMemoryInput
|
|
26
26
|
|
|
27
27
|
logger = logging.getLogger(__name__)
|
|
28
28
|
|