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
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# See the License for the specific language governing permissions and
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
|
+
import importlib
|
|
16
17
|
import json
|
|
17
18
|
import typing
|
|
18
19
|
from collections.abc import Callable
|
|
@@ -24,8 +25,8 @@ from pydantic import Discriminator
|
|
|
24
25
|
from pydantic import FilePath
|
|
25
26
|
from pydantic import Tag
|
|
26
27
|
|
|
27
|
-
from
|
|
28
|
-
from
|
|
28
|
+
from nat.data_models.common import BaseModelRegistryTag
|
|
29
|
+
from nat.data_models.common import TypedBaseModel
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
class EvalS3Config(BaseModel):
|
|
@@ -68,7 +69,7 @@ class EvalDatasetBaseConfig(TypedBaseModel, BaseModelRegistryTag):
|
|
|
68
69
|
s3: EvalS3Config | None = None
|
|
69
70
|
|
|
70
71
|
remote_file_path: str | None = None # only for s3
|
|
71
|
-
file_path: Path | str = Path(".tmp/
|
|
72
|
+
file_path: Path | str = Path(".tmp/nat/examples/default/default.json")
|
|
72
73
|
|
|
73
74
|
|
|
74
75
|
class EvalDatasetJsonConfig(EvalDatasetBaseConfig, name="json"):
|
|
@@ -78,7 +79,7 @@ class EvalDatasetJsonConfig(EvalDatasetBaseConfig, name="json"):
|
|
|
78
79
|
return pd.read_json, {}
|
|
79
80
|
|
|
80
81
|
|
|
81
|
-
def read_jsonl(file_path: FilePath
|
|
82
|
+
def read_jsonl(file_path: FilePath):
|
|
82
83
|
with open(file_path, 'r', encoding='utf-8') as f:
|
|
83
84
|
data = [json.loads(line) for line in f]
|
|
84
85
|
return pd.DataFrame(data)
|
|
@@ -112,12 +113,57 @@ class EvalDatasetXlsConfig(EvalDatasetBaseConfig, name="xls"):
|
|
|
112
113
|
return pd.read_excel, {"engine": "openpyxl"}
|
|
113
114
|
|
|
114
115
|
|
|
116
|
+
class EvalDatasetCustomConfig(EvalDatasetBaseConfig, name="custom"):
|
|
117
|
+
"""
|
|
118
|
+
Configuration for custom dataset type that allows users to specify
|
|
119
|
+
a custom Python function to transform their dataset into EvalInput format.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
function: str # Direct import path to function, format: "module.path.function_name"
|
|
123
|
+
kwargs: dict[str, typing.Any] = {} # Additional arguments to pass to the custom function
|
|
124
|
+
|
|
125
|
+
def parser(self) -> tuple[Callable, dict]:
|
|
126
|
+
"""
|
|
127
|
+
Load and return the custom function for dataset transformation.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
Tuple of (custom_function, kwargs) where custom_function transforms
|
|
131
|
+
a dataset file into an EvalInput object.
|
|
132
|
+
"""
|
|
133
|
+
custom_function = self._load_custom_function()
|
|
134
|
+
return custom_function, self.kwargs
|
|
135
|
+
|
|
136
|
+
def _load_custom_function(self) -> Callable:
|
|
137
|
+
"""
|
|
138
|
+
Import and return the custom function using standard Python import path.
|
|
139
|
+
"""
|
|
140
|
+
if not self.function:
|
|
141
|
+
raise ValueError("Function path cannot be empty")
|
|
142
|
+
|
|
143
|
+
# Split the function path to get module and function name
|
|
144
|
+
module_path, function_name = self.function.rsplit(".", 1)
|
|
145
|
+
|
|
146
|
+
# Import the module
|
|
147
|
+
module = importlib.import_module(module_path)
|
|
148
|
+
|
|
149
|
+
# Get the function from the module
|
|
150
|
+
if not hasattr(module, function_name):
|
|
151
|
+
raise AttributeError(f"Function '{function_name}' not found in module '{module_path}'")
|
|
152
|
+
|
|
153
|
+
custom_function = getattr(module, function_name)
|
|
154
|
+
|
|
155
|
+
if not callable(custom_function):
|
|
156
|
+
raise ValueError(f"'{self.function}' is not callable")
|
|
157
|
+
|
|
158
|
+
return custom_function
|
|
159
|
+
|
|
160
|
+
|
|
115
161
|
# Union model with discriminator
|
|
116
|
-
EvalDatasetConfig = typing.Annotated[
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
162
|
+
EvalDatasetConfig = typing.Annotated[
|
|
163
|
+
typing.Annotated[EvalDatasetJsonConfig, Tag(EvalDatasetJsonConfig.static_type())]
|
|
164
|
+
| typing.Annotated[EvalDatasetCsvConfig, Tag(EvalDatasetCsvConfig.static_type())]
|
|
165
|
+
| typing.Annotated[EvalDatasetXlsConfig, Tag(EvalDatasetXlsConfig.static_type())]
|
|
166
|
+
| typing.Annotated[EvalDatasetParquetConfig, Tag(EvalDatasetParquetConfig.static_type())]
|
|
167
|
+
| typing.Annotated[EvalDatasetJsonlConfig, Tag(EvalDatasetJsonlConfig.static_type())]
|
|
168
|
+
| typing.Annotated[EvalDatasetCustomConfig, Tag(EvalDatasetCustomConfig.static_type())],
|
|
169
|
+
Discriminator(TypedBaseModel.discriminator)]
|
|
@@ -15,25 +15,23 @@
|
|
|
15
15
|
|
|
16
16
|
import importlib.metadata
|
|
17
17
|
import inspect
|
|
18
|
-
import json
|
|
19
18
|
import logging
|
|
20
19
|
import typing
|
|
21
20
|
from enum import Enum
|
|
22
21
|
from functools import lru_cache
|
|
23
|
-
from pathlib import Path
|
|
24
22
|
from types import ModuleType
|
|
25
23
|
from typing import TYPE_CHECKING
|
|
26
24
|
|
|
27
25
|
from pydantic import BaseModel
|
|
28
26
|
from pydantic import field_validator
|
|
29
27
|
|
|
30
|
-
from
|
|
31
|
-
from
|
|
32
|
-
from
|
|
28
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
29
|
+
from nat.data_models.component import ComponentEnum
|
|
30
|
+
from nat.utils.metadata_utils import generate_config_type_docs
|
|
33
31
|
|
|
34
32
|
if TYPE_CHECKING:
|
|
35
|
-
from
|
|
36
|
-
from
|
|
33
|
+
from nat.cli.type_registry import ToolWrapperBuildCallableT
|
|
34
|
+
from nat.data_models.common import TypedBaseModelT
|
|
37
35
|
|
|
38
36
|
logger = logging.getLogger(__name__)
|
|
39
37
|
|
|
@@ -56,18 +54,18 @@ class DiscoveryMetadata(BaseModel):
|
|
|
56
54
|
"""A data model representing metadata about each registered component to faciliate its discovery.
|
|
57
55
|
|
|
58
56
|
Args:
|
|
59
|
-
package (str): The name of the package containing the
|
|
60
|
-
version (str): The version number of the package containing the
|
|
61
|
-
component_type (
|
|
62
|
-
component_name (str): The registered name of the
|
|
63
|
-
description (str): Description of the
|
|
57
|
+
package (str): The name of the package containing the NAT component.
|
|
58
|
+
version (str): The version number of the package containing the NAT component.
|
|
59
|
+
component_type (ComponentEnum): The type of NAT component this metadata represents.
|
|
60
|
+
component_name (str): The registered name of the NAT component.
|
|
61
|
+
description (str): Description of the NAT component pulled from its config objects docstrings.
|
|
64
62
|
developer_notes (str): Other notes to a developers to aid in the use of the component.
|
|
65
63
|
status (DiscoveryStatusEnum): Provides the status of the metadata discovery process.
|
|
66
64
|
"""
|
|
67
65
|
|
|
68
66
|
package: str = ""
|
|
69
67
|
version: str = ""
|
|
70
|
-
component_type:
|
|
68
|
+
component_type: ComponentEnum = ComponentEnum.UNDEFINED
|
|
71
69
|
component_name: str = ""
|
|
72
70
|
description: str = ""
|
|
73
71
|
developer_notes: str = ""
|
|
@@ -95,27 +93,12 @@ class DiscoveryMetadata(BaseModel):
|
|
|
95
93
|
mapping = importlib.metadata.packages_distributions()
|
|
96
94
|
try:
|
|
97
95
|
distro_names = mapping.get(root_package_name, [None])
|
|
98
|
-
distro_name = DiscoveryMetadata.get_preferred_item(distro_names, "
|
|
96
|
+
distro_name = DiscoveryMetadata.get_preferred_item(distro_names, "nvidia-nat")
|
|
99
97
|
except KeyError:
|
|
100
98
|
return root_package_name
|
|
101
99
|
|
|
102
100
|
return distro_name if distro_name else root_package_name
|
|
103
101
|
|
|
104
|
-
@staticmethod
|
|
105
|
-
@lru_cache
|
|
106
|
-
def get_distribution_name_from_private_data(root_package: str) -> str | None:
|
|
107
|
-
# Locate distibution mapping stored in the packages private data
|
|
108
|
-
module = __import__(root_package)
|
|
109
|
-
for path in module.__path__:
|
|
110
|
-
package_dir = Path(path).resolve()
|
|
111
|
-
distinfo_path = package_dir / "meta" / "module_to_distro.json"
|
|
112
|
-
|
|
113
|
-
if distinfo_path.exists():
|
|
114
|
-
with distinfo_path.open("r") as f:
|
|
115
|
-
data = json.load(f)
|
|
116
|
-
return data.get(root_package, None)
|
|
117
|
-
return None
|
|
118
|
-
|
|
119
102
|
@staticmethod
|
|
120
103
|
@lru_cache
|
|
121
104
|
def get_distribution_name_from_module(module: ModuleType | None) -> str:
|
|
@@ -125,22 +108,22 @@ class DiscoveryMetadata(BaseModel):
|
|
|
125
108
|
module (ModuleType): A registered component's module.
|
|
126
109
|
|
|
127
110
|
Returns:
|
|
128
|
-
str: The distribution name of the
|
|
111
|
+
str: The distribution name of the NAT component.
|
|
129
112
|
"""
|
|
130
|
-
from
|
|
113
|
+
from nat.runtime.loader import get_all_entrypoints_distro_mapping
|
|
131
114
|
|
|
132
115
|
if module is None:
|
|
133
|
-
return "
|
|
116
|
+
return "nvidia-nat"
|
|
134
117
|
|
|
135
118
|
# Get the mapping of module names to distro names
|
|
136
|
-
mapping =
|
|
119
|
+
mapping = get_all_entrypoints_distro_mapping()
|
|
137
120
|
module_package = module.__package__
|
|
138
121
|
|
|
139
122
|
if module_package is None:
|
|
140
|
-
return "
|
|
123
|
+
return "nvidia-nat"
|
|
141
124
|
|
|
142
125
|
# Traverse the module package parts in reverse order to find the distro name
|
|
143
|
-
# This is because the module package is the root package for the
|
|
126
|
+
# This is because the module package is the root package for the NAT component
|
|
144
127
|
# and the distro name is the name of the package that contains the component
|
|
145
128
|
module_package_parts = module_package.split(".")
|
|
146
129
|
for part_idx in range(len(module_package_parts), 0, -1):
|
|
@@ -149,7 +132,7 @@ class DiscoveryMetadata(BaseModel):
|
|
|
149
132
|
if candidate_distro_name is not None:
|
|
150
133
|
return candidate_distro_name
|
|
151
134
|
|
|
152
|
-
return "
|
|
135
|
+
return "nvidia-nat"
|
|
153
136
|
|
|
154
137
|
@staticmethod
|
|
155
138
|
@lru_cache
|
|
@@ -160,32 +143,20 @@ class DiscoveryMetadata(BaseModel):
|
|
|
160
143
|
config_type (type[TypedBaseModelT]): A registered component's configuration object.
|
|
161
144
|
|
|
162
145
|
Returns:
|
|
163
|
-
str: The distribution name of the
|
|
146
|
+
str: The distribution name of the NAT component.
|
|
164
147
|
"""
|
|
165
148
|
module = inspect.getmodule(config_type)
|
|
166
149
|
return DiscoveryMetadata.get_distribution_name_from_module(module)
|
|
167
150
|
|
|
168
|
-
@staticmethod
|
|
169
|
-
@lru_cache
|
|
170
|
-
def get_distribution_name(root_package: str) -> str:
|
|
171
|
-
"""
|
|
172
|
-
The aiq library packages use a distro name 'aiqtoolkit[]' and
|
|
173
|
-
root package name 'aiq'. They provide mapping in a metadata file
|
|
174
|
-
for optimized installation.
|
|
175
|
-
"""
|
|
176
|
-
|
|
177
|
-
distro_name = DiscoveryMetadata.get_distribution_name_from_private_data(root_package)
|
|
178
|
-
return distro_name if distro_name else root_package
|
|
179
|
-
|
|
180
151
|
@staticmethod
|
|
181
152
|
def from_config_type(config_type: type["TypedBaseModelT"],
|
|
182
|
-
component_type:
|
|
183
|
-
"""Generates discovery metadata from
|
|
153
|
+
component_type: ComponentEnum = ComponentEnum.UNDEFINED) -> "DiscoveryMetadata":
|
|
154
|
+
"""Generates discovery metadata from a NAT config object.
|
|
184
155
|
|
|
185
156
|
Args:
|
|
186
157
|
config_type (type[TypedBaseModelT]): A registered component's configuration object.
|
|
187
|
-
component_type (
|
|
188
|
-
|
|
158
|
+
component_type (ComponentEnum, optional): The type of the registered component. Defaults to
|
|
159
|
+
ComponentEnum.UNDEFINED.
|
|
189
160
|
|
|
190
161
|
Returns:
|
|
191
162
|
DiscoveryMetadata: A an object containing component metadata to facilitate discovery and reuse.
|
|
@@ -220,7 +191,7 @@ class DiscoveryMetadata(BaseModel):
|
|
|
220
191
|
@staticmethod
|
|
221
192
|
def from_fn_wrapper(fn: "ToolWrapperBuildCallableT",
|
|
222
193
|
wrapper_type: LLMFrameworkEnum | str,
|
|
223
|
-
component_type:
|
|
194
|
+
component_type: ComponentEnum = ComponentEnum.TOOL_WRAPPER) -> "DiscoveryMetadata":
|
|
224
195
|
"""Generates discovery metadata from function with specified wrapper type.
|
|
225
196
|
|
|
226
197
|
Args:
|
|
@@ -228,8 +199,8 @@ class DiscoveryMetadata(BaseModel):
|
|
|
228
199
|
wrapper_type (LLMFrameworkEnum): The wrapper to apply to the callable to faciliate inter-framwork
|
|
229
200
|
interoperability.
|
|
230
201
|
|
|
231
|
-
component_type (
|
|
232
|
-
|
|
202
|
+
component_type (ComponentEnum, optional): The type of the registered component. Defaults to
|
|
203
|
+
ComponentEnum.TOOL_WRAPPER.
|
|
233
204
|
|
|
234
205
|
Returns:
|
|
235
206
|
DiscoveryMetadata: A an object containing component metadata to facilitate discovery and reuse.
|
|
@@ -263,7 +234,7 @@ class DiscoveryMetadata(BaseModel):
|
|
|
263
234
|
"""Generates discovery metadata from an installed package name.
|
|
264
235
|
|
|
265
236
|
Args:
|
|
266
|
-
package_name (str): The name of the
|
|
237
|
+
package_name (str): The name of the NAT plugin package containing registered components.
|
|
267
238
|
package_version (str, optional): The version of the package, Defaults to None.
|
|
268
239
|
|
|
269
240
|
Returns:
|
|
@@ -286,16 +257,15 @@ class DiscoveryMetadata(BaseModel):
|
|
|
286
257
|
|
|
287
258
|
return DiscoveryMetadata(package=package_name,
|
|
288
259
|
version=package_version,
|
|
289
|
-
component_type=
|
|
260
|
+
component_type=ComponentEnum.PACKAGE,
|
|
290
261
|
component_name=package_name,
|
|
291
262
|
description=description)
|
|
292
263
|
|
|
293
264
|
@staticmethod
|
|
294
|
-
def from_provider_framework_map(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
component_type: AIQComponentEnum = AIQComponentEnum.UNDEFINED) -> "DiscoveryMetadata":
|
|
265
|
+
def from_provider_framework_map(config_type: type["TypedBaseModelT"],
|
|
266
|
+
wrapper_type: LLMFrameworkEnum | str | None,
|
|
267
|
+
provider_type: ComponentEnum,
|
|
268
|
+
component_type: ComponentEnum = ComponentEnum.UNDEFINED) -> "DiscoveryMetadata":
|
|
299
269
|
"""Generates discovery metadata from provider and framework mapping information.
|
|
300
270
|
|
|
301
271
|
Args:
|
|
@@ -303,9 +273,9 @@ class DiscoveryMetadata(BaseModel):
|
|
|
303
273
|
wrapper_type (LLMFrameworkEnum | str): The wrapper to apply to the callable to faciliate inter-framwork
|
|
304
274
|
interoperability.
|
|
305
275
|
|
|
306
|
-
provider_type (
|
|
307
|
-
component_type (
|
|
308
|
-
|
|
276
|
+
provider_type (ComponentEnum): The type of provider the registered component supports.
|
|
277
|
+
component_type (ComponentEnum, optional): The type of the registered component. Defaults to
|
|
278
|
+
ComponentEnum.UNDEFINED.
|
|
309
279
|
|
|
310
280
|
Returns:
|
|
311
281
|
DiscoveryMetadata: A an object containing component metadata to facilitate discovery and reuse.
|
|
@@ -21,12 +21,12 @@ from pydantic import BaseModel
|
|
|
21
21
|
from pydantic import Discriminator
|
|
22
22
|
from pydantic import model_validator
|
|
23
23
|
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
24
|
+
from nat.data_models.common import TypedBaseModel
|
|
25
|
+
from nat.data_models.dataset_handler import EvalDatasetConfig
|
|
26
|
+
from nat.data_models.dataset_handler import EvalS3Config
|
|
27
|
+
from nat.data_models.evaluator import EvaluatorBaseConfig
|
|
28
|
+
from nat.data_models.intermediate_step import IntermediateStepType
|
|
29
|
+
from nat.data_models.profiler import ProfilerConfig
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class JobEvictionPolicy(str, Enum):
|
|
@@ -54,7 +54,7 @@ class JobManagementConfig(BaseModel):
|
|
|
54
54
|
|
|
55
55
|
class EvalOutputConfig(BaseModel):
|
|
56
56
|
# Output directory for the workflow and evaluation results
|
|
57
|
-
dir: Path = Path("
|
|
57
|
+
dir: Path = Path("./.tmp/nat/examples/default/")
|
|
58
58
|
# S3 prefix for the workflow and evaluation results
|
|
59
59
|
remote_dir: str | None = None
|
|
60
60
|
# Custom scripts to run after the workflow and evaluation results are saved
|
|
@@ -77,7 +77,7 @@ class EvalGeneralConfig(BaseModel):
|
|
|
77
77
|
workflow_alias: str | None = None
|
|
78
78
|
|
|
79
79
|
# Output directory for the workflow and evaluation results
|
|
80
|
-
output_dir: Path = Path("
|
|
80
|
+
output_dir: Path = Path("./.tmp/nat/examples/default/")
|
|
81
81
|
|
|
82
82
|
# If present overrides output_dir
|
|
83
83
|
output: EvalOutputConfig | None = None
|
|
@@ -108,7 +108,7 @@ class EvalConfig(BaseModel):
|
|
|
108
108
|
@classmethod
|
|
109
109
|
def rebuild_annotations(cls):
|
|
110
110
|
|
|
111
|
-
from
|
|
111
|
+
from nat.cli.type_registry import GlobalTypeRegistry # pylint: disable=cyclic-import
|
|
112
112
|
|
|
113
113
|
type_registry = GlobalTypeRegistry.get()
|
|
114
114
|
|
|
@@ -24,9 +24,9 @@ from pydantic import ConfigDict
|
|
|
24
24
|
from pydantic import Field
|
|
25
25
|
from pydantic import model_validator
|
|
26
26
|
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
27
|
+
from nat.builder.framework_enum import LLMFrameworkEnum
|
|
28
|
+
from nat.data_models.invocation_node import InvocationNode
|
|
29
|
+
from nat.profiler.callbacks.token_usage_base_model import TokenUsageBaseModel
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class IntermediateStepCategory(str, Enum):
|
|
@@ -66,7 +66,7 @@ class IntermediateStepState(str, Enum):
|
|
|
66
66
|
|
|
67
67
|
class StreamEventData(BaseModel):
|
|
68
68
|
"""
|
|
69
|
-
|
|
69
|
+
StreamEventData is a data model that represents the data field in an streaming event.
|
|
70
70
|
"""
|
|
71
71
|
|
|
72
72
|
# Allow extra fields in the model_config to support derived models
|
|
@@ -121,7 +121,7 @@ class TraceMetadata(BaseModel):
|
|
|
121
121
|
|
|
122
122
|
class IntermediateStepPayload(BaseModel):
|
|
123
123
|
"""
|
|
124
|
-
|
|
124
|
+
IntermediateStep is a data model that represents an intermediate step in the NAT. Intermediate steps are
|
|
125
125
|
captured while a request is running and can be used to show progress or to evaluate the path a workflow took to get
|
|
126
126
|
a response.
|
|
127
127
|
"""
|
|
@@ -226,7 +226,7 @@ class IntermediateStepPayload(BaseModel):
|
|
|
226
226
|
|
|
227
227
|
class IntermediateStep(BaseModel):
|
|
228
228
|
"""
|
|
229
|
-
|
|
229
|
+
IntermediateStep is a data model that represents an intermediate step in the NAT. Intermediate steps are
|
|
230
230
|
captured while a request is running and can be used to show progress or to evaluate the path a workflow took to get
|
|
231
231
|
a response.
|
|
232
232
|
"""
|
|
@@ -243,7 +243,7 @@ class IntermediateStep(BaseModel):
|
|
|
243
243
|
|
|
244
244
|
function_ancestry: InvocationNode
|
|
245
245
|
"""
|
|
246
|
-
The function ancestry for the current step showing the current
|
|
246
|
+
The function ancestry for the current step showing the current NAT function that was being executed when the step
|
|
247
247
|
was created.
|
|
248
248
|
"""
|
|
249
249
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
import typing
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from nat.data_models.common import BaseModelRegistryTag
|
|
19
|
+
from nat.data_models.common import TypedBaseModel
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class RetrieverBaseConfig(TypedBaseModel, BaseModelRegistryTag):
|
{aiq → nat}/data_models/span.py
RENAMED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
# limitations under the License.
|
|
15
15
|
|
|
16
16
|
import logging
|
|
17
|
+
import os
|
|
17
18
|
import time
|
|
18
19
|
import uuid
|
|
19
20
|
from enum import Enum
|
|
@@ -25,6 +26,8 @@ from pydantic import field_validator
|
|
|
25
26
|
|
|
26
27
|
logger = logging.getLogger(__name__)
|
|
27
28
|
|
|
29
|
+
_SPAN_PREFIX = os.getenv("NAT_SPAN_PREFIX", "nat").strip() or "nat"
|
|
30
|
+
|
|
28
31
|
|
|
29
32
|
class SpanKind(Enum):
|
|
30
33
|
LLM = "LLM"
|
|
@@ -87,7 +90,7 @@ def event_type_to_span_kind(event_type: str) -> SpanKind:
|
|
|
87
90
|
|
|
88
91
|
|
|
89
92
|
class SpanAttributes(Enum):
|
|
90
|
-
|
|
93
|
+
NAT_SPAN_KIND = f"{_SPAN_PREFIX}.span.kind"
|
|
91
94
|
INPUT_VALUE = "input.value"
|
|
92
95
|
INPUT_MIME_TYPE = "input.mime_type"
|
|
93
96
|
LLM_TOKEN_COUNT_PROMPT = "llm.token_count.prompt"
|
|
@@ -95,12 +98,12 @@ class SpanAttributes(Enum):
|
|
|
95
98
|
LLM_TOKEN_COUNT_TOTAL = "llm.token_count.total"
|
|
96
99
|
OUTPUT_VALUE = "output.value"
|
|
97
100
|
OUTPUT_MIME_TYPE = "output.mime_type"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
NAT_USAGE_NUM_LLM_CALLS = f"{_SPAN_PREFIX}.usage.num_llm_calls"
|
|
102
|
+
NAT_USAGE_SECONDS_BETWEEN_CALLS = f"{_SPAN_PREFIX}.usage.seconds_between_calls"
|
|
103
|
+
NAT_USAGE_TOKEN_COUNT_PROMPT = f"{_SPAN_PREFIX}.usage.token_count.prompt"
|
|
104
|
+
NAT_USAGE_TOKEN_COUNT_COMPLETION = f"{_SPAN_PREFIX}.usage.token_count.completion"
|
|
105
|
+
NAT_USAGE_TOKEN_COUNT_TOTAL = f"{_SPAN_PREFIX}.usage.token_count.total"
|
|
106
|
+
NAT_EVENT_TYPE = f"{_SPAN_PREFIX}.event_type"
|
|
104
107
|
|
|
105
108
|
|
|
106
109
|
class MimeTypes(Enum):
|
|
@@ -20,7 +20,7 @@ from pydantic import BaseModel
|
|
|
20
20
|
from pydantic import Field
|
|
21
21
|
from pydantic import model_validator
|
|
22
22
|
|
|
23
|
-
from
|
|
23
|
+
from nat.data_models.intermediate_step import IntermediateStepType
|
|
24
24
|
|
|
25
25
|
logger = logging.getLogger(__name__)
|
|
26
26
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
import typing
|
|
17
17
|
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from nat.data_models.common import BaseModelRegistryTag
|
|
19
|
+
from nat.data_models.common import TypedBaseModel
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class TelemetryExporterBaseConfig(TypedBaseModel, BaseModelRegistryTag):
|
|
@@ -20,11 +20,11 @@ from pydantic import AliasChoices
|
|
|
20
20
|
from pydantic import ConfigDict
|
|
21
21
|
from pydantic import Field
|
|
22
22
|
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
23
|
+
from nat.builder.builder import Builder
|
|
24
|
+
from nat.builder.embedder import EmbedderProviderInfo
|
|
25
|
+
from nat.cli.register_workflow import register_embedder_provider
|
|
26
|
+
from nat.data_models.embedder import EmbedderBaseConfig
|
|
27
|
+
from nat.data_models.retry_mixin import RetryMixin
|
|
28
28
|
|
|
29
29
|
allowed_truncate_values = ["NONE", "START", "END"]
|
|
30
30
|
|
|
@@ -17,11 +17,11 @@ from pydantic import AliasChoices
|
|
|
17
17
|
from pydantic import ConfigDict
|
|
18
18
|
from pydantic import Field
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
24
|
-
from
|
|
20
|
+
from nat.builder.builder import Builder
|
|
21
|
+
from nat.builder.embedder import EmbedderProviderInfo
|
|
22
|
+
from nat.cli.register_workflow import register_embedder_provider
|
|
23
|
+
from nat.data_models.embedder import EmbedderBaseConfig
|
|
24
|
+
from nat.data_models.retry_mixin import RetryMixin
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class OpenAIEmbedderModelConfig(EmbedderBaseConfig, RetryMixin, name="openai"):
|
{aiq → nat}/eval/config.py
RENAMED
|
@@ -17,10 +17,10 @@ from pathlib import Path
|
|
|
17
17
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
|
|
20
|
-
from
|
|
21
|
-
from
|
|
22
|
-
from
|
|
23
|
-
from
|
|
20
|
+
from nat.eval.evaluator.evaluator_model import EvalInput
|
|
21
|
+
from nat.eval.evaluator.evaluator_model import EvalOutput
|
|
22
|
+
from nat.eval.usage_stats import UsageStats
|
|
23
|
+
from nat.profiler.data_models import ProfilerResults
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class EvaluationRunConfig(BaseModel):
|
|
@@ -19,7 +19,7 @@ import boto3
|
|
|
19
19
|
import requests
|
|
20
20
|
from botocore.exceptions import NoCredentialsError
|
|
21
21
|
|
|
22
|
-
from
|
|
22
|
+
from nat.data_models.dataset_handler import EvalDatasetConfig
|
|
23
23
|
|
|
24
24
|
logger = logging.getLogger(__name__)
|
|
25
25
|
|