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
|
@@ -17,38 +17,38 @@ import logging
|
|
|
17
17
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
20
|
+
from nat.data_models.component import ComponentEnum
|
|
21
|
+
from nat.data_models.discovery_metadata import DiscoveryMetadata
|
|
22
|
+
from nat.registry_handlers.schemas.status import StatusMessage
|
|
23
23
|
|
|
24
24
|
logger = logging.getLogger(__name__)
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class
|
|
28
|
-
"""
|
|
27
|
+
class BuiltArtifact(BaseModel):
|
|
28
|
+
"""A NAT artifact including base64 encoded string of wheel package and corrosponding discovery metadata.
|
|
29
29
|
|
|
30
30
|
Args:
|
|
31
|
-
whl (str): A base64 encoded string of
|
|
31
|
+
whl (str): A base64 encoded string of a NAT package wheel (.whl).
|
|
32
32
|
|
|
33
|
-
metadata (dict[
|
|
33
|
+
metadata (dict[ComponentEnum, list[DiscoveryMetadata]]): Provides rich discover metadata for developers to
|
|
34
34
|
quickly find useful components.
|
|
35
35
|
"""
|
|
36
36
|
|
|
37
37
|
whl: str
|
|
38
|
-
metadata: dict[
|
|
38
|
+
metadata: dict[ComponentEnum, list[DiscoveryMetadata]]
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
class
|
|
42
|
-
"""
|
|
41
|
+
class Artifact(BaseModel):
|
|
42
|
+
"""A NAT artifact including base64 encoded string of wheel package and corrosponding discovery metadata.
|
|
43
43
|
|
|
44
44
|
Args:
|
|
45
|
-
artifact (
|
|
45
|
+
artifact (BuiltArtifact): A NAT artifact including base64 encoded string of wheel package and
|
|
46
46
|
corrosponding discovery metadata.
|
|
47
47
|
|
|
48
48
|
whl_path (str): A local path to the built wheel package.
|
|
49
49
|
"""
|
|
50
50
|
|
|
51
|
-
artifact:
|
|
51
|
+
artifact: BuiltArtifact | None = None
|
|
52
52
|
whl_path: str
|
|
53
53
|
|
|
54
54
|
|
|
@@ -61,3 +61,8 @@ class PublishResponse(BaseModel):
|
|
|
61
61
|
"""
|
|
62
62
|
|
|
63
63
|
status: StatusMessage
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# Compatibility aliases with previous releases
|
|
67
|
+
BuiltAIQArtifact = BuiltArtifact
|
|
68
|
+
AIQArtifact = Artifact
|
|
@@ -17,8 +17,8 @@ import logging
|
|
|
17
17
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
20
|
+
from nat.registry_handlers.schemas.package import PackageNameVersion
|
|
21
|
+
from nat.registry_handlers.schemas.status import StatusMessage
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ class PulledPackage(BaseModel):
|
|
|
27
27
|
"""Represents a data model of a pulled package containing the package wheel and its name.
|
|
28
28
|
|
|
29
29
|
Args:
|
|
30
|
-
whl (str): Base64 encoded string of the
|
|
30
|
+
whl (str): Base64 encoded string of the NAT python package wheel (.whl).
|
|
31
31
|
whl_name (str): A string representing the wheel filename.
|
|
32
32
|
"""
|
|
33
33
|
|
|
@@ -37,7 +37,7 @@ class PulledPackage(BaseModel):
|
|
|
37
37
|
|
|
38
38
|
class PullResponse(BaseModel):
|
|
39
39
|
"""
|
|
40
|
-
Represents a data model of the expected respones from a
|
|
40
|
+
Represents a data model of the expected respones from a NAT pull request, including detailed status
|
|
41
41
|
information.
|
|
42
42
|
|
|
43
43
|
Args:
|
|
@@ -72,11 +72,11 @@ class PullRequestPackage(BaseModel):
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
class PullRequestPackages(BaseModel):
|
|
75
|
-
"""Represents a list of all packages th download and install in the local
|
|
75
|
+
"""Represents a list of all packages th download and install in the local NAT environment.
|
|
76
76
|
|
|
77
77
|
Args:
|
|
78
78
|
packages (list[typing.Union[PackageNameVersion, PullPackageWhl]]): A list of packages that can be
|
|
79
|
-
downloaded and installed in the local
|
|
79
|
+
downloaded and installed in the local NAT environment.
|
|
80
80
|
"""
|
|
81
81
|
|
|
82
82
|
packages: list[PackageNameVersion | PullPackageWhl]
|
|
@@ -17,8 +17,8 @@ import logging
|
|
|
17
17
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
20
|
+
from nat.registry_handlers.schemas.package import PackageNameVersion
|
|
21
|
+
from nat.registry_handlers.schemas.status import StatusMessage
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
24
24
|
|
|
@@ -18,8 +18,8 @@ from enum import Enum
|
|
|
18
18
|
|
|
19
19
|
from pydantic import BaseModel
|
|
20
20
|
|
|
21
|
-
from
|
|
22
|
-
from
|
|
21
|
+
from nat.data_models.component import ComponentEnum
|
|
22
|
+
from nat.registry_handlers.schemas.status import StatusMessage
|
|
23
23
|
|
|
24
24
|
logger = logging.getLogger(__name__)
|
|
25
25
|
|
|
@@ -42,18 +42,18 @@ class VisualizeFields(str, Enum):
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
class SearchQuery(BaseModel):
|
|
45
|
-
"""Represents the search criteria that will be used to discover useful
|
|
45
|
+
"""Represents the search criteria that will be used to discover useful NAT components.
|
|
46
46
|
|
|
47
47
|
Args:
|
|
48
|
-
query (str): A query string used to find useful
|
|
48
|
+
query (str): A query string used to find useful NAT components.
|
|
49
49
|
fields (list[SearchFields]): The list of fields used when applying the query string.
|
|
50
|
-
component_types (list[
|
|
50
|
+
component_types (list[ComponentEnum]): NAT components types to filter search results.
|
|
51
51
|
top_k (int): Specifies the number of search results to provide.
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
54
|
query: str = "*"
|
|
55
55
|
fields: list[SearchFields] = [SearchFields.ALL]
|
|
56
|
-
component_types: list[
|
|
56
|
+
component_types: list[ComponentEnum]
|
|
57
57
|
top_k: int = 10
|
|
58
58
|
|
|
59
59
|
|
|
@@ -61,16 +61,16 @@ class SearchResponseItem(BaseModel):
|
|
|
61
61
|
"""Represents an individual item in the search response, including elements of it's discovery metadata.
|
|
62
62
|
|
|
63
63
|
Args:
|
|
64
|
-
package (str): The name of the
|
|
65
|
-
version (str): The version of the
|
|
66
|
-
component_type (
|
|
67
|
-
description (str): A description of this
|
|
64
|
+
package (str): The name of the NAT package that includes the component.
|
|
65
|
+
version (str): The version of the NAT package that includes the component.
|
|
66
|
+
component_type (ComponentEnum): Type of NAT component this item represents.
|
|
67
|
+
description (str): A description of this NAT component.
|
|
68
68
|
developer_notes (str): Additional details that would help a developer use this component.
|
|
69
69
|
"""
|
|
70
70
|
|
|
71
71
|
package: str
|
|
72
72
|
version: str
|
|
73
|
-
component_type:
|
|
73
|
+
component_type: ComponentEnum
|
|
74
74
|
component_name: str
|
|
75
75
|
description: str
|
|
76
76
|
developer_notes: str
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
from abc import ABC
|
|
17
17
|
from abc import abstractmethod
|
|
18
18
|
|
|
19
|
-
from
|
|
19
|
+
from nat.retriever.models import RetrieverOutput
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class
|
|
22
|
+
class Retriever(ABC):
|
|
23
23
|
"""
|
|
24
24
|
Abstract interface for interacting with data stores.
|
|
25
25
|
|
|
@@ -35,3 +35,7 @@ class AIQRetriever(ABC):
|
|
|
35
35
|
|
|
36
36
|
"""
|
|
37
37
|
raise NotImplementedError
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Compatibility aliases with previous releases
|
|
41
|
+
AIQRetriever = Retriever
|
|
@@ -16,12 +16,12 @@
|
|
|
16
16
|
from pydantic import Field
|
|
17
17
|
from pydantic import HttpUrl
|
|
18
18
|
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
19
|
+
from nat.builder.builder import Builder
|
|
20
|
+
from nat.builder.builder import LLMFrameworkEnum
|
|
21
|
+
from nat.builder.retriever import RetrieverProviderInfo
|
|
22
|
+
from nat.cli.register_workflow import register_retriever_client
|
|
23
|
+
from nat.cli.register_workflow import register_retriever_provider
|
|
24
|
+
from nat.data_models.retriever import RetrieverBaseConfig
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class MilvusRetrieverConfig(RetrieverBaseConfig, name="milvus_retriever"):
|
|
@@ -60,7 +60,7 @@ async def milvus_retriever(retriever_config: MilvusRetrieverConfig, builder: Bui
|
|
|
60
60
|
async def milvus_retriever_client(config: MilvusRetrieverConfig, builder: Builder):
|
|
61
61
|
from pymilvus import MilvusClient
|
|
62
62
|
|
|
63
|
-
from
|
|
63
|
+
from nat.retriever.milvus.retriever import MilvusRetriever
|
|
64
64
|
|
|
65
65
|
embedder = await builder.get_embedder(embedder_name=config.embedding_model, wrapper_type=LLMFrameworkEnum.LANGCHAIN)
|
|
66
66
|
|
|
@@ -20,10 +20,10 @@ from langchain_core.embeddings import Embeddings
|
|
|
20
20
|
from pymilvus import MilvusClient
|
|
21
21
|
from pymilvus.client.abstract import Hit
|
|
22
22
|
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
23
|
+
from nat.retriever.interface import Retriever
|
|
24
|
+
from nat.retriever.models import Document
|
|
25
|
+
from nat.retriever.models import RetrieverError
|
|
26
|
+
from nat.retriever.models import RetrieverOutput
|
|
27
27
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
|
|
@@ -32,7 +32,7 @@ class CollectionNotFoundError(RetrieverError):
|
|
|
32
32
|
pass
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
class MilvusRetriever(
|
|
35
|
+
class MilvusRetriever(Retriever):
|
|
36
36
|
"""
|
|
37
37
|
Client for retrieving document chunks from a Milvus vectorstore
|
|
38
38
|
"""
|
|
@@ -213,16 +213,16 @@ def _wrap_milvus_results(res: list[Hit], content_field: str):
|
|
|
213
213
|
return RetrieverOutput(results=[_wrap_milvus_single_results(r, content_field=content_field) for r in res])
|
|
214
214
|
|
|
215
215
|
|
|
216
|
-
def _wrap_milvus_single_results(res: Hit | dict, content_field: str) ->
|
|
216
|
+
def _wrap_milvus_single_results(res: Hit | dict, content_field: str) -> Document:
|
|
217
217
|
if not isinstance(res, (Hit, dict)):
|
|
218
218
|
raise ValueError(f"Milvus search returned object of type {type(res)}. Expected 'Hit' or 'dict'.")
|
|
219
219
|
|
|
220
220
|
if isinstance(res, Hit):
|
|
221
221
|
metadata = {k: v for k, v in res.fields.items() if k != content_field}
|
|
222
222
|
metadata.update({"distance": res.distance})
|
|
223
|
-
return
|
|
223
|
+
return Document(page_content=res.fields[content_field], metadata=metadata, document_id=res.id)
|
|
224
224
|
|
|
225
225
|
fields = res["entity"]
|
|
226
226
|
metadata = {k: v for k, v in fields.items() if k != content_field}
|
|
227
227
|
metadata.update({"distance": res.get("distance")})
|
|
228
|
-
return
|
|
228
|
+
return Document(page_content=fields.get(content_field), metadata=metadata, document_id=res["id"])
|
{aiq → nat}/retriever/models.py
RENAMED
|
@@ -21,22 +21,22 @@ from typing import Any
|
|
|
21
21
|
from pydantic import BaseModel
|
|
22
22
|
from pydantic import Field
|
|
23
23
|
|
|
24
|
-
from
|
|
24
|
+
from nat.utils.type_converter import GlobalTypeConverter
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class
|
|
27
|
+
class Document(BaseModel):
|
|
28
28
|
"""
|
|
29
|
-
Object representing a retrieved document/chunk from a standard
|
|
29
|
+
Object representing a retrieved document/chunk from a standard NAT Retriever.
|
|
30
30
|
"""
|
|
31
31
|
page_content: str = Field(description="Primary content of the document to insert or retrieve")
|
|
32
|
-
metadata: dict[str, Any] = Field(description="Metadata dictionary attached to the
|
|
32
|
+
metadata: dict[str, Any] = Field(description="Metadata dictionary attached to the Document")
|
|
33
33
|
document_id: str | None = Field(description="Unique ID for the document, if supported by the configured datastore",
|
|
34
34
|
default=None)
|
|
35
35
|
|
|
36
36
|
@classmethod
|
|
37
|
-
def from_dict(cls, data: dict[str, Any]) ->
|
|
37
|
+
def from_dict(cls, data: dict[str, Any]) -> Document:
|
|
38
38
|
"""
|
|
39
|
-
Deserialize an
|
|
39
|
+
Deserialize an Document from a dictionary representation.
|
|
40
40
|
|
|
41
41
|
Args:
|
|
42
42
|
data (dict): A dictionary containing keys
|
|
@@ -49,7 +49,7 @@ class AIQDocument(BaseModel):
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
class RetrieverOutput(BaseModel):
|
|
52
|
-
results: list[
|
|
52
|
+
results: list[Document] = Field(description="A list of retrieved Documents")
|
|
53
53
|
|
|
54
54
|
def __len__(self):
|
|
55
55
|
return len(self.results)
|
|
@@ -72,3 +72,6 @@ def retriever_output_to_str(obj: RetrieverOutput) -> str:
|
|
|
72
72
|
|
|
73
73
|
GlobalTypeConverter.register_converter(retriever_output_to_dict)
|
|
74
74
|
GlobalTypeConverter.register_converter(retriever_output_to_str)
|
|
75
|
+
|
|
76
|
+
# Compatibility aliases with previous releases
|
|
77
|
+
AIQDocument = Document
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
from pydantic import Field
|
|
17
17
|
from pydantic import HttpUrl
|
|
18
18
|
|
|
19
|
-
from
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
19
|
+
from nat.builder.builder import Builder
|
|
20
|
+
from nat.builder.retriever import RetrieverProviderInfo
|
|
21
|
+
from nat.cli.register_workflow import register_retriever_client
|
|
22
|
+
from nat.cli.register_workflow import register_retriever_provider
|
|
23
|
+
from nat.data_models.retriever import RetrieverBaseConfig
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class NemoRetrieverConfig(RetrieverBaseConfig, name="nemo_retriever"):
|
|
@@ -48,7 +48,7 @@ async def nemo_retriever(retriever_config: NemoRetrieverConfig, builder: Builder
|
|
|
48
48
|
|
|
49
49
|
@register_retriever_client(config_type=NemoRetrieverConfig, wrapper_type=None)
|
|
50
50
|
async def nemo_retriever_client(config: NemoRetrieverConfig, builder: Builder):
|
|
51
|
-
from
|
|
51
|
+
from nat.retriever.nemo_retriever.retriever import NemoRetriever
|
|
52
52
|
|
|
53
53
|
retriever = NemoRetriever(**config.model_dump(exclude={"type", "top_k", "collection_name"}))
|
|
54
54
|
optional_fields = ["collection_name", "top_k", "output_fields"]
|
|
@@ -26,10 +26,10 @@ from pydantic import BaseModel
|
|
|
26
26
|
from pydantic import Field
|
|
27
27
|
from pydantic import HttpUrl
|
|
28
28
|
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
from
|
|
29
|
+
from nat.retriever.interface import Retriever
|
|
30
|
+
from nat.retriever.models import Document
|
|
31
|
+
from nat.retriever.models import RetrieverError
|
|
32
|
+
from nat.retriever.models import RetrieverOutput
|
|
33
33
|
|
|
34
34
|
logger = logging.getLogger(__name__)
|
|
35
35
|
|
|
@@ -51,7 +51,7 @@ class CollectionUnavailableError(RetrieverError):
|
|
|
51
51
|
pass
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
class NemoRetriever(
|
|
54
|
+
class NemoRetriever(Retriever):
|
|
55
55
|
"""
|
|
56
56
|
Client for retrieving document chunks from a Nemo Retriever service.
|
|
57
57
|
"""
|
|
@@ -153,11 +153,11 @@ def _wrap_nemo_results(output: list[dict], content_field: str):
|
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
def _wrap_nemo_single_results(output: dict, content_field: str):
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
return Document(page_content=output[content_field],
|
|
157
|
+
metadata={
|
|
158
|
+
k: v
|
|
159
|
+
for k, v in output.items() if k != content_field
|
|
160
|
+
})
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
def _flatten(obj: dict, output_fields: list[str]) -> list[str]:
|
|
@@ -18,7 +18,5 @@
|
|
|
18
18
|
# isort:skip_file
|
|
19
19
|
|
|
20
20
|
# Import any providers which need to be automatically registered here
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# Import any clients which need to be automatically registered here
|
|
24
|
-
from . import langchain_client
|
|
21
|
+
import nat.retriever.milvus.register
|
|
22
|
+
import nat.retriever.nemo_retriever.register
|
{aiq → nat}/runtime/loader.py
RENAMED
|
@@ -24,14 +24,14 @@ from enum import auto
|
|
|
24
24
|
from functools import lru_cache
|
|
25
25
|
from functools import reduce
|
|
26
26
|
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
from
|
|
34
|
-
from
|
|
27
|
+
from nat.builder.workflow_builder import WorkflowBuilder
|
|
28
|
+
from nat.cli.type_registry import GlobalTypeRegistry
|
|
29
|
+
from nat.data_models.config import Config
|
|
30
|
+
from nat.runtime.session import SessionManager
|
|
31
|
+
from nat.utils.data_models.schema_validator import validate_schema
|
|
32
|
+
from nat.utils.debugging_utils import is_debugger_attached
|
|
33
|
+
from nat.utils.io.yaml_tools import yaml_load
|
|
34
|
+
from nat.utils.type_utils import StrPath
|
|
35
35
|
|
|
36
36
|
logger = logging.getLogger(__name__)
|
|
37
37
|
|
|
@@ -58,7 +58,7 @@ class PluginTypes(IntFlag):
|
|
|
58
58
|
# Convenience flag for groups of plugin types
|
|
59
59
|
CONFIG_OBJECT = COMPONENT | FRONT_END | EVALUATOR | AUTHENTICATION
|
|
60
60
|
"""
|
|
61
|
-
Any plugin that can be specified in the
|
|
61
|
+
Any plugin that can be specified in the NAT configuration file.
|
|
62
62
|
"""
|
|
63
63
|
ALL = COMPONENT | FRONT_END | EVALUATOR | REGISTRY_HANDLER | AUTHENTICATION
|
|
64
64
|
"""
|
|
@@ -66,10 +66,10 @@ class PluginTypes(IntFlag):
|
|
|
66
66
|
"""
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
def load_config(config_file: StrPath) ->
|
|
69
|
+
def load_config(config_file: StrPath) -> Config:
|
|
70
70
|
"""
|
|
71
|
-
This is the primary entry point for loading
|
|
72
|
-
loaded and then validates the configuration file against the
|
|
71
|
+
This is the primary entry point for loading a NAT configuration file. It ensures that all plugins are
|
|
72
|
+
loaded and then validates the configuration file against the Config schema.
|
|
73
73
|
|
|
74
74
|
Parameters
|
|
75
75
|
----------
|
|
@@ -78,8 +78,8 @@ def load_config(config_file: StrPath) -> AIQConfig:
|
|
|
78
78
|
|
|
79
79
|
Returns
|
|
80
80
|
-------
|
|
81
|
-
|
|
82
|
-
The validated
|
|
81
|
+
Config
|
|
82
|
+
The validated Config object
|
|
83
83
|
"""
|
|
84
84
|
|
|
85
85
|
# Ensure all of the plugins are loaded
|
|
@@ -87,17 +87,17 @@ def load_config(config_file: StrPath) -> AIQConfig:
|
|
|
87
87
|
|
|
88
88
|
config_yaml = yaml_load(config_file)
|
|
89
89
|
|
|
90
|
-
# Validate configuration adheres to
|
|
91
|
-
|
|
90
|
+
# Validate configuration adheres to NAT schemas
|
|
91
|
+
validated_nat_config = validate_schema(config_yaml, Config)
|
|
92
92
|
|
|
93
|
-
return
|
|
93
|
+
return validated_nat_config
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
@asynccontextmanager
|
|
97
97
|
async def load_workflow(config_file: StrPath, max_concurrency: int = -1):
|
|
98
98
|
"""
|
|
99
|
-
Load the
|
|
100
|
-
|
|
99
|
+
Load the NAT configuration file and create an Runner object. This is the primary entry point for running
|
|
100
|
+
NAT workflows.
|
|
101
101
|
|
|
102
102
|
Parameters
|
|
103
103
|
----------
|
|
@@ -114,7 +114,7 @@ async def load_workflow(config_file: StrPath, max_concurrency: int = -1):
|
|
|
114
114
|
# Must yield the workflow function otherwise it cleans up
|
|
115
115
|
async with WorkflowBuilder.from_config(config=config) as workflow:
|
|
116
116
|
|
|
117
|
-
yield
|
|
117
|
+
yield SessionManager(workflow.build(), max_concurrency=max_concurrency)
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
@lru_cache
|
|
@@ -128,32 +128,33 @@ def discover_entrypoints(plugin_type: PluginTypes):
|
|
|
128
128
|
plugin_groups = []
|
|
129
129
|
|
|
130
130
|
# Add the specified plugin type to the list of groups to load
|
|
131
|
+
# The aiq entrypoints are intentionally left in the list to maintain backwards compatibility.
|
|
131
132
|
if (plugin_type & PluginTypes.COMPONENT):
|
|
132
|
-
plugin_groups.extend(["aiq.plugins", "aiq.components"])
|
|
133
|
+
plugin_groups.extend(["aiq.plugins", "aiq.components", "nat.plugins", "nat.components"])
|
|
133
134
|
if (plugin_type & PluginTypes.FRONT_END):
|
|
134
|
-
plugin_groups.
|
|
135
|
+
plugin_groups.extend(["aiq.front_ends", "nat.front_ends"])
|
|
135
136
|
if (plugin_type & PluginTypes.REGISTRY_HANDLER):
|
|
136
|
-
plugin_groups.
|
|
137
|
+
plugin_groups.extend(["aiq.registry_handlers", "nat.registry_handlers"])
|
|
137
138
|
if (plugin_type & PluginTypes.EVALUATOR):
|
|
138
|
-
plugin_groups.
|
|
139
|
+
plugin_groups.extend(["aiq.evaluators", "nat.evaluators"])
|
|
139
140
|
if (plugin_type & PluginTypes.AUTHENTICATION):
|
|
140
|
-
plugin_groups.
|
|
141
|
+
plugin_groups.extend(["aiq.authentication_providers", "nat.authentication_providers"])
|
|
141
142
|
|
|
142
143
|
# Get the entry points for the specified groups
|
|
143
|
-
|
|
144
|
+
nat_plugins = reduce(lambda x, y: list(x) + list(y), [entry_points.select(group=y) for y in plugin_groups])
|
|
144
145
|
|
|
145
|
-
return
|
|
146
|
+
return nat_plugins
|
|
146
147
|
|
|
147
148
|
|
|
148
149
|
@lru_cache
|
|
149
|
-
def
|
|
150
|
+
def get_all_entrypoints_distro_mapping() -> dict[str, str]:
|
|
150
151
|
"""
|
|
151
|
-
Get the mapping of all
|
|
152
|
+
Get the mapping of all NAT entry points to their distribution names.
|
|
152
153
|
"""
|
|
153
154
|
|
|
154
155
|
mapping = {}
|
|
155
|
-
|
|
156
|
-
for ep in
|
|
156
|
+
nat_entrypoints = discover_entrypoints(PluginTypes.ALL)
|
|
157
|
+
for ep in nat_entrypoints:
|
|
157
158
|
ep_module_parts = ep.module.split(".")
|
|
158
159
|
current_parts = []
|
|
159
160
|
for part in ep_module_parts:
|
|
@@ -171,14 +172,14 @@ def discover_and_register_plugins(plugin_type: PluginTypes):
|
|
|
171
172
|
"""
|
|
172
173
|
|
|
173
174
|
# Get the entry points for the specified groups
|
|
174
|
-
|
|
175
|
+
nat_plugins = discover_entrypoints(plugin_type)
|
|
175
176
|
|
|
176
177
|
count = 0
|
|
177
178
|
|
|
178
179
|
# Pause registration hooks for performance. This is useful when loading a large number of plugins.
|
|
179
180
|
with GlobalTypeRegistry.get().pause_registration_changed_hooks():
|
|
180
181
|
|
|
181
|
-
for entry_point in
|
|
182
|
+
for entry_point in nat_plugins:
|
|
182
183
|
try:
|
|
183
184
|
logger.debug("Loading module '%s' from entry point '%s'...", entry_point.module, entry_point.name)
|
|
184
185
|
|
|
@@ -213,3 +214,7 @@ def discover_and_register_plugins(plugin_type: PluginTypes):
|
|
|
213
214
|
|
|
214
215
|
finally:
|
|
215
216
|
count += 1
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
# Compatibility alias
|
|
220
|
+
get_all_aiq_entrypoints_distro_mapping = get_all_entrypoints_distro_mapping
|