nemo-platform-plugin 0.1.0__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.
- nemo_platform/__init__.py +117 -0
- nemo_platform/_base_client.py +2146 -0
- nemo_platform/_client.py +1200 -0
- nemo_platform/_compat.py +241 -0
- nemo_platform/_constants.py +29 -0
- nemo_platform/_decoders/jsonl.py +138 -0
- nemo_platform/_exceptions.py +123 -0
- nemo_platform/_files.py +188 -0
- nemo_platform/_models.py +967 -0
- nemo_platform/_qs.py +164 -0
- nemo_platform/_resource.py +58 -0
- nemo_platform/_response.py +872 -0
- nemo_platform/_streaming.py +391 -0
- nemo_platform/_types.py +288 -0
- nemo_platform/_utils/__init__.py +79 -0
- nemo_platform/_utils/_compat.py +60 -0
- nemo_platform/_utils/_datetime_parse.py +151 -0
- nemo_platform/_utils/_json.py +50 -0
- nemo_platform/_utils/_logs.py +40 -0
- nemo_platform/_utils/_path.py +142 -0
- nemo_platform/_utils/_proxy.py +80 -0
- nemo_platform/_utils/_reflection.py +57 -0
- nemo_platform/_utils/_resources_proxy.py +39 -0
- nemo_platform/_utils/_streams.py +27 -0
- nemo_platform/_utils/_sync.py +73 -0
- nemo_platform/_utils/_transform.py +472 -0
- nemo_platform/_utils/_typing.py +171 -0
- nemo_platform/_utils/_utils.py +448 -0
- nemo_platform/_version.py +21 -0
- nemo_platform/auth/__init__.py +15 -0
- nemo_platform/auth/device_flow.py +303 -0
- nemo_platform/auth/helpers.py +211 -0
- nemo_platform/auth/token_provider.py +239 -0
- nemo_platform/beta/evaluator/__init__.py +120 -0
- nemo_platform/beta/evaluator/agent_inference.py +360 -0
- nemo_platform/beta/evaluator/constants.py +4 -0
- nemo_platform/beta/evaluator/dataset_schemas/common.py +177 -0
- nemo_platform/beta/evaluator/dataset_schemas/compatibility.py +353 -0
- nemo_platform/beta/evaluator/dataset_schemas/templates.py +389 -0
- nemo_platform/beta/evaluator/datasets/__init__.py +28 -0
- nemo_platform/beta/evaluator/datasets/loader.py +415 -0
- nemo_platform/beta/evaluator/enums.py +64 -0
- nemo_platform/beta/evaluator/execution/_protocols.py +20 -0
- nemo_platform/beta/evaluator/execution/backends/base.py +86 -0
- nemo_platform/beta/evaluator/execution/backends/local/backend.py +132 -0
- nemo_platform/beta/evaluator/execution/benchmark_execution.py +666 -0
- nemo_platform/beta/evaluator/execution/config.py +64 -0
- nemo_platform/beta/evaluator/execution/evaluator.py +289 -0
- nemo_platform/beta/evaluator/execution/job_poll.py +98 -0
- nemo_platform/beta/evaluator/execution/metric_execution.py +878 -0
- nemo_platform/beta/evaluator/execution/pipeline.py +64 -0
- nemo_platform/beta/evaluator/execution/runs.py +143 -0
- nemo_platform/beta/evaluator/execution/scoring.py +224 -0
- nemo_platform/beta/evaluator/execution/utils.py +116 -0
- nemo_platform/beta/evaluator/execution/values.py +53 -0
- nemo_platform/beta/evaluator/inference.py +456 -0
- nemo_platform/beta/evaluator/metrics/aggregation.py +451 -0
- nemo_platform/beta/evaluator/metrics/bleu.py +94 -0
- nemo_platform/beta/evaluator/metrics/exact_match.py +52 -0
- nemo_platform/beta/evaluator/metrics/f1.py +50 -0
- nemo_platform/beta/evaluator/metrics/hooks.py +41 -0
- nemo_platform/beta/evaluator/metrics/llm_judge.py +392 -0
- nemo_platform/beta/evaluator/metrics/number_check.py +95 -0
- nemo_platform/beta/evaluator/metrics/protocol.py +241 -0
- nemo_platform/beta/evaluator/metrics/ragas/__init__.py +41 -0
- nemo_platform/beta/evaluator/metrics/ragas/base.py +521 -0
- nemo_platform/beta/evaluator/metrics/ragas/git_patch.py +36 -0
- nemo_platform/beta/evaluator/metrics/ragas/imports.py +192 -0
- nemo_platform/beta/evaluator/metrics/ragas/metrics.py +183 -0
- nemo_platform/beta/evaluator/metrics/remote.py +250 -0
- nemo_platform/beta/evaluator/metrics/rouge.py +71 -0
- nemo_platform/beta/evaluator/metrics/string_check.py +69 -0
- nemo_platform/beta/evaluator/metrics/template_rendering.py +141 -0
- nemo_platform/beta/evaluator/metrics/tool_calling.py +173 -0
- nemo_platform/beta/evaluator/metrics/types.py +62 -0
- nemo_platform/beta/evaluator/metrics/utils.py +54 -0
- nemo_platform/beta/evaluator/resilience/api.py +142 -0
- nemo_platform/beta/evaluator/resilience/classifier.py +142 -0
- nemo_platform/beta/evaluator/resilience/config.py +69 -0
- nemo_platform/beta/evaluator/resilience/errors.py +117 -0
- nemo_platform/beta/evaluator/resilience/policy.py +50 -0
- nemo_platform/beta/evaluator/resilience/scheduler.py +459 -0
- nemo_platform/beta/evaluator/resilience/types.py +93 -0
- nemo_platform/beta/evaluator/structured_output.py +184 -0
- nemo_platform/beta/evaluator/templates.py +115 -0
- nemo_platform/beta/evaluator/values/__init__.py +162 -0
- nemo_platform/beta/evaluator/values/agents.py +84 -0
- nemo_platform/beta/evaluator/values/common.py +28 -0
- nemo_platform/beta/evaluator/values/dataset_schemas.py +112 -0
- nemo_platform/beta/evaluator/values/datasets.py +28 -0
- nemo_platform/beta/evaluator/values/metrics.py +587 -0
- nemo_platform/beta/evaluator/values/models.py +157 -0
- nemo_platform/beta/evaluator/values/multi_metric_results.py +359 -0
- nemo_platform/beta/evaluator/values/params.py +109 -0
- nemo_platform/beta/evaluator/values/results.py +699 -0
- nemo_platform/beta/evaluator/values/scores.py +300 -0
- nemo_platform/beta/safe_synthesizer/__init__.py +4 -0
- nemo_platform/beta/safe_synthesizer/config.py +29 -0
- nemo_platform/beta/safe_synthesizer/job.py +309 -0
- nemo_platform/beta/safe_synthesizer/job_builder.py +355 -0
- nemo_platform/cli/__init__.py +4 -0
- nemo_platform/cli/app.py +321 -0
- nemo_platform/cli/commands/__init__.py +15 -0
- nemo_platform/cli/commands/api/__init__.py +114 -0
- nemo_platform/cli/commands/api/adapters.py +384 -0
- nemo_platform/cli/commands/api/files/__init__.py +237 -0
- nemo_platform/cli/commands/api/files/filesets.py +386 -0
- nemo_platform/cli/commands/api/files/otlp/__init__.py +12 -0
- nemo_platform/cli/commands/api/files/otlp/logs.py +116 -0
- nemo_platform/cli/commands/api/guardrail/__init__.py +270 -0
- nemo_platform/cli/commands/api/guardrail/configs.py +311 -0
- nemo_platform/cli/commands/api/iam/__init__.py +12 -0
- nemo_platform/cli/commands/api/iam/role_bindings.py +264 -0
- nemo_platform/cli/commands/api/inference/__init__.py +76 -0
- nemo_platform/cli/commands/api/inference/deployment_configs/__init__.py +370 -0
- nemo_platform/cli/commands/api/inference/deployment_configs/versions.py +132 -0
- nemo_platform/cli/commands/api/inference/deployments/__init__.py +565 -0
- nemo_platform/cli/commands/api/inference/deployments/versions.py +141 -0
- nemo_platform/cli/commands/api/inference/gateway/__init__.py +14 -0
- nemo_platform/cli/commands/api/inference/gateway/model.py +324 -0
- nemo_platform/cli/commands/api/inference/gateway/openai/__init__.py +12 -0
- nemo_platform/cli/commands/api/inference/gateway/openai/v1/__init__.py +12 -0
- nemo_platform/cli/commands/api/inference/gateway/openai/v1/models.py +106 -0
- nemo_platform/cli/commands/api/inference/gateway/provider.py +327 -0
- nemo_platform/cli/commands/api/inference/models.py +106 -0
- nemo_platform/cli/commands/api/inference/providers.py +612 -0
- nemo_platform/cli/commands/api/inference/virtual_models.py +412 -0
- nemo_platform/cli/commands/api/intake/__init__.py +18 -0
- nemo_platform/cli/commands/api/intake/apps/__init__.py +326 -0
- nemo_platform/cli/commands/api/intake/apps/tasks.py +340 -0
- nemo_platform/cli/commands/api/intake/entries/__init__.py +445 -0
- nemo_platform/cli/commands/api/intake/entries/events.py +118 -0
- nemo_platform/cli/commands/api/intake/evaluator_results.py +267 -0
- nemo_platform/cli/commands/api/intake/exports/__init__.py +63 -0
- nemo_platform/cli/commands/api/intake/exports/jobs.py +245 -0
- nemo_platform/cli/commands/api/intake/ingest/__init__.py +14 -0
- nemo_platform/cli/commands/api/intake/ingest/atif.py +115 -0
- nemo_platform/cli/commands/api/intake/ingest/chat_completions.py +125 -0
- nemo_platform/cli/commands/api/intake/ingest/otlp/__init__.py +12 -0
- nemo_platform/cli/commands/api/intake/ingest/otlp/v1/__init__.py +12 -0
- nemo_platform/cli/commands/api/intake/ingest/otlp/v1/traces.py +72 -0
- nemo_platform/cli/commands/api/intake/spans/__init__.py +202 -0
- nemo_platform/cli/commands/api/intake/spans/evaluator_results.py +65 -0
- nemo_platform/cli/commands/api/intake/traces.py +183 -0
- nemo_platform/cli/commands/api/jobs/__init__.py +576 -0
- nemo_platform/cli/commands/api/jobs/results.py +211 -0
- nemo_platform/cli/commands/api/jobs/steps.py +243 -0
- nemo_platform/cli/commands/api/jobs/tasks.py +210 -0
- nemo_platform/cli/commands/api/members.py +304 -0
- nemo_platform/cli/commands/api/models/__init__.py +555 -0
- nemo_platform/cli/commands/api/models/adapters.py +261 -0
- nemo_platform/cli/commands/api/projects.py +332 -0
- nemo_platform/cli/commands/api/safe_synthesizer/__init__.py +12 -0
- nemo_platform/cli/commands/api/safe_synthesizer/jobs/__init__.py +417 -0
- nemo_platform/cli/commands/api/safe_synthesizer/jobs/results.py +211 -0
- nemo_platform/cli/commands/api/secrets/__init__.py +315 -0
- nemo_platform/cli/commands/api/secrets/admin.py +44 -0
- nemo_platform/cli/commands/api/workspaces.py +339 -0
- nemo_platform/cli/commands/auth.py +803 -0
- nemo_platform/cli/commands/config.py +308 -0
- nemo_platform/cli/commands/docs.py +277 -0
- nemo_platform/cli/commands/manifest_registry.py +180 -0
- nemo_platform/cli/commands/plugins.py +87 -0
- nemo_platform/cli/commands/quickstart/__init__.py +15 -0
- nemo_platform/cli/commands/quickstart/cli.py +1178 -0
- nemo_platform/cli/commands/services/_process.py +472 -0
- nemo_platform/cli/commands/services/cli.py +694 -0
- nemo_platform/cli/commands/setup.py +1947 -0
- nemo_platform/cli/commands/skills/agents/claude.py +29 -0
- nemo_platform/cli/commands/skills/agents/codex.py +32 -0
- nemo_platform/cli/commands/skills/agents/cursor.py +18 -0
- nemo_platform/cli/commands/skills/agents/opencode.py +20 -0
- nemo_platform/cli/commands/skills/base.py +53 -0
- nemo_platform/cli/commands/skills/cli.py +313 -0
- nemo_platform/cli/commands/skills/installer.py +51 -0
- nemo_platform/cli/commands/skills/registry.py +396 -0
- nemo_platform/cli/commands/use_cases/__init__.py +15 -0
- nemo_platform/cli/commands/use_cases/agent.py +245 -0
- nemo_platform/cli/commands/use_cases/chat.py +965 -0
- nemo_platform/cli/commands/use_cases/wait.py +151 -0
- nemo_platform/cli/core/__init__.py +8 -0
- nemo_platform/cli/core/agent_helpers.py +84 -0
- nemo_platform/cli/core/api.py +160 -0
- nemo_platform/cli/core/autocomplete.py +63 -0
- nemo_platform/cli/core/code_generator.py +306 -0
- nemo_platform/cli/core/context.py +179 -0
- nemo_platform/cli/core/errors.py +349 -0
- nemo_platform/cli/core/formatters.py +718 -0
- nemo_platform/cli/core/help_formatter.py +868 -0
- nemo_platform/cli/core/lazy_load.py +187 -0
- nemo_platform/cli/core/logging.py +24 -0
- nemo_platform/cli/core/pagination.py +255 -0
- nemo_platform/cli/core/stdin_utils.py +233 -0
- nemo_platform/cli/core/streaming.py +30 -0
- nemo_platform/cli/core/table_config.py +302 -0
- nemo_platform/cli/core/timestamp_formatter.py +127 -0
- nemo_platform/cli/core/types.py +112 -0
- nemo_platform/cli/core/waiters.py +339 -0
- nemo_platform/cli/manifest.py +108 -0
- nemo_platform/client/__init__.py +15 -0
- nemo_platform/client/factory.py +597 -0
- nemo_platform/config/README.md +168 -0
- nemo_platform/config/__init__.py +23 -0
- nemo_platform/config/config.py +538 -0
- nemo_platform/config/models.py +377 -0
- nemo_platform/config/types.py +7 -0
- nemo_platform/filesets/__init__.py +19 -0
- nemo_platform/filesets/filesystem/callbacks.py +229 -0
- nemo_platform/filesets/filesystem/filesystem.py +940 -0
- nemo_platform/filesets/resources.py +1120 -0
- nemo_platform/lib/.keep +4 -0
- nemo_platform/models/__init__.py +14 -0
- nemo_platform/models/resources.py +836 -0
- nemo_platform/pagination.py +149 -0
- nemo_platform/py.typed +0 -0
- nemo_platform/quickstart/__init__.py +99 -0
- nemo_platform/quickstart/cluster.py +198 -0
- nemo_platform/quickstart/config.py +402 -0
- nemo_platform/quickstart/container.py +758 -0
- nemo_platform/quickstart/gpu_config.py +111 -0
- nemo_platform/quickstart/platform_config.py +82 -0
- nemo_platform/quickstart/preflight.py +451 -0
- nemo_platform/quickstart/prompts.py +426 -0
- nemo_platform/quickstart/storage.py +90 -0
- nemo_platform/quickstart/validators.py +268 -0
- nemo_platform/resources/__init__.py +16 -0
- nemo_platform/resources/adapters/__init__.py +34 -0
- nemo_platform/resources/adapters/adapters.py +704 -0
- nemo_platform/resources/adapters/api.md +15 -0
- nemo_platform/resources/audit/__init__.py +16 -0
- nemo_platform/resources/entities/__init__.py +34 -0
- nemo_platform/resources/entities/api.md +16 -0
- nemo_platform/resources/entities/entities.py +1014 -0
- nemo_platform/resources/evaluation/__init__.py +118 -0
- nemo_platform/resources/evaluation/api.md +303 -0
- nemo_platform/resources/evaluation/benchmark_job_results.py +541 -0
- nemo_platform/resources/evaluation/benchmark_jobs/__init__.py +48 -0
- nemo_platform/resources/evaluation/benchmark_jobs/benchmark_jobs.py +900 -0
- nemo_platform/resources/evaluation/benchmark_jobs/results/__init__.py +76 -0
- nemo_platform/resources/evaluation/benchmark_jobs/results/aggregate_scores.py +197 -0
- nemo_platform/resources/evaluation/benchmark_jobs/results/artifacts.py +206 -0
- nemo_platform/resources/evaluation/benchmark_jobs/results/results.py +516 -0
- nemo_platform/resources/evaluation/benchmark_jobs/results/row_scores.py +213 -0
- nemo_platform/resources/evaluation/benchmarks.py +690 -0
- nemo_platform/resources/evaluation/evaluation.py +277 -0
- nemo_platform/resources/evaluation/metric_job_results.py +533 -0
- nemo_platform/resources/evaluation/metric_jobs/__init__.py +48 -0
- nemo_platform/resources/evaluation/metric_jobs/metric_jobs.py +888 -0
- nemo_platform/resources/evaluation/metric_jobs/results/__init__.py +76 -0
- nemo_platform/resources/evaluation/metric_jobs/results/aggregate_scores.py +197 -0
- nemo_platform/resources/evaluation/metric_jobs/results/artifacts.py +206 -0
- nemo_platform/resources/evaluation/metric_jobs/results/results.py +512 -0
- nemo_platform/resources/evaluation/metric_jobs/results/row_scores.py +213 -0
- nemo_platform/resources/evaluation/metrics.py +3495 -0
- nemo_platform/resources/files/__init__.py +62 -0
- nemo_platform/resources/files/api.md +65 -0
- nemo_platform/resources/files/files.py +683 -0
- nemo_platform/resources/files/filesets.py +783 -0
- nemo_platform/resources/files/otlp/__init__.py +48 -0
- nemo_platform/resources/files/otlp/logs.py +337 -0
- nemo_platform/resources/files/otlp/otlp.py +117 -0
- nemo_platform/resources/guardrail/__init__.py +48 -0
- nemo_platform/resources/guardrail/api.md +116 -0
- nemo_platform/resources/guardrail/configs.py +679 -0
- nemo_platform/resources/guardrail/guardrail.py +463 -0
- nemo_platform/resources/iam/__init__.py +48 -0
- nemo_platform/resources/iam/api.md +22 -0
- nemo_platform/resources/iam/iam.py +117 -0
- nemo_platform/resources/iam/role_bindings.py +537 -0
- nemo_platform/resources/inference/__init__.py +118 -0
- nemo_platform/resources/inference/api.md +224 -0
- nemo_platform/resources/inference/deployment_configs/__init__.py +48 -0
- nemo_platform/resources/inference/deployment_configs/deployment_configs.py +756 -0
- nemo_platform/resources/inference/deployment_configs/versions.py +418 -0
- nemo_platform/resources/inference/deployments/__init__.py +48 -0
- nemo_platform/resources/inference/deployments/deployments.py +1017 -0
- nemo_platform/resources/inference/deployments/versions.py +434 -0
- nemo_platform/resources/inference/gateway/__init__.py +76 -0
- nemo_platform/resources/inference/gateway/gateway.py +181 -0
- nemo_platform/resources/inference/gateway/model.py +708 -0
- nemo_platform/resources/inference/gateway/openai/__init__.py +48 -0
- nemo_platform/resources/inference/gateway/openai/openai.py +700 -0
- nemo_platform/resources/inference/gateway/openai/v1/__init__.py +48 -0
- nemo_platform/resources/inference/gateway/openai/v1/models.py +290 -0
- nemo_platform/resources/inference/gateway/openai/v1/v1.py +117 -0
- nemo_platform/resources/inference/gateway/provider.py +749 -0
- nemo_platform/resources/inference/inference.py +277 -0
- nemo_platform/resources/inference/models.py +290 -0
- nemo_platform/resources/inference/providers.py +1049 -0
- nemo_platform/resources/inference/virtual_models.py +846 -0
- nemo_platform/resources/intake/__init__.py +132 -0
- nemo_platform/resources/intake/api.md +268 -0
- nemo_platform/resources/intake/apps/__init__.py +48 -0
- nemo_platform/resources/intake/apps/apps.py +718 -0
- nemo_platform/resources/intake/apps/tasks.py +731 -0
- nemo_platform/resources/intake/entries/__init__.py +48 -0
- nemo_platform/resources/intake/entries/entries.py +855 -0
- nemo_platform/resources/intake/entries/events.py +320 -0
- nemo_platform/resources/intake/evaluator_results.py +512 -0
- nemo_platform/resources/intake/exports/__init__.py +48 -0
- nemo_platform/resources/intake/exports/exports.py +229 -0
- nemo_platform/resources/intake/exports/jobs.py +464 -0
- nemo_platform/resources/intake/ingest/__init__.py +76 -0
- nemo_platform/resources/intake/ingest/atif.py +242 -0
- nemo_platform/resources/intake/ingest/chat_completions.py +270 -0
- nemo_platform/resources/intake/ingest/ingest.py +181 -0
- nemo_platform/resources/intake/ingest/otlp/__init__.py +48 -0
- nemo_platform/resources/intake/ingest/otlp/otlp.py +117 -0
- nemo_platform/resources/intake/ingest/otlp/v1/__init__.py +48 -0
- nemo_platform/resources/intake/ingest/otlp/v1/traces.py +183 -0
- nemo_platform/resources/intake/ingest/otlp/v1/v1.py +117 -0
- nemo_platform/resources/intake/intake.py +309 -0
- nemo_platform/resources/intake/spans/__init__.py +48 -0
- nemo_platform/resources/intake/spans/evaluator_results.py +197 -0
- nemo_platform/resources/intake/spans/spans.py +367 -0
- nemo_platform/resources/intake/traces.py +351 -0
- nemo_platform/resources/jobs/__init__.py +76 -0
- nemo_platform/resources/jobs/api.md +118 -0
- nemo_platform/resources/jobs/jobs.py +1300 -0
- nemo_platform/resources/jobs/results.py +555 -0
- nemo_platform/resources/jobs/steps.py +491 -0
- nemo_platform/resources/jobs/tasks.py +470 -0
- nemo_platform/resources/members/__init__.py +34 -0
- nemo_platform/resources/members/api.md +19 -0
- nemo_platform/resources/members/members.py +634 -0
- nemo_platform/resources/models/__init__.py +48 -0
- nemo_platform/resources/models/adapters.py +514 -0
- nemo_platform/resources/models/api.md +44 -0
- nemo_platform/resources/models/models.py +981 -0
- nemo_platform/resources/projects/__init__.py +34 -0
- nemo_platform/resources/projects/api.md +21 -0
- nemo_platform/resources/projects/projects.py +736 -0
- nemo_platform/resources/safe_synthesizer/__init__.py +48 -0
- nemo_platform/resources/safe_synthesizer/api.md +62 -0
- nemo_platform/resources/safe_synthesizer/jobs/__init__.py +48 -0
- nemo_platform/resources/safe_synthesizer/jobs/jobs.py +895 -0
- nemo_platform/resources/safe_synthesizer/jobs/results.py +819 -0
- nemo_platform/resources/safe_synthesizer/safe_synthesizer.py +117 -0
- nemo_platform/resources/secrets/__init__.py +48 -0
- nemo_platform/resources/secrets/admin.py +150 -0
- nemo_platform/resources/secrets/api.md +34 -0
- nemo_platform/resources/secrets/secrets.py +756 -0
- nemo_platform/resources/workspaces/__init__.py +34 -0
- nemo_platform/resources/workspaces/api.md +20 -0
- nemo_platform/resources/workspaces/workspaces.py +734 -0
- nemo_platform/skills/__init__.py +28 -0
- nemo_platform/skills/inference/SKILL.md +564 -0
- nemo_platform/skills/nemo-build-agent/SKILL.md +221 -0
- nemo_platform/skills/nemo-build-agent/references/templates/data-designer-config.py +80 -0
- nemo_platform/skills/nemo-evaluator/SKILL.md +140 -0
- nemo_platform/skills/nemo-explore/SKILL.md +70 -0
- nemo_platform/skills/nemo-files/SKILL.md +81 -0
- nemo_platform/skills/nemo-fine-tune/SKILL.md +43 -0
- nemo_platform/skills/nemo-guardrails/SKILL.md +519 -0
- nemo_platform/skills/nemo-secrets/SKILL.md +60 -0
- nemo_platform/skills/nemo-skill-selection/SKILL.md +146 -0
- nemo_platform/skills/nemo-spec/SKILL.md +76 -0
- nemo_platform/skills/nemo-spec/references/templates/agent-spec.md +68 -0
- nemo_platform/skills/nemo-status/SKILL.md +115 -0
- nemo_platform/skills/nemo-teardown/SKILL.md +185 -0
- nemo_platform/skills/nemo-try-agent/SKILL.md +102 -0
- nemo_platform/types/__init__.py +54 -0
- nemo_platform/types/adapters/__init__.py +24 -0
- nemo_platform/types/adapters/adapter_create_params.py +63 -0
- nemo_platform/types/adapters/adapter_entity_filter_param.py +56 -0
- nemo_platform/types/adapters/adapter_list_params.py +46 -0
- nemo_platform/types/adapters/adapter_patch_params.py +35 -0
- nemo_platform/types/adapters/adapters_page.py +37 -0
- nemo_platform/types/audit/__init__.py +18 -0
- nemo_platform/types/audit/jobs/__init__.py +18 -0
- nemo_platform/types/entities/__init__.py +26 -0
- nemo_platform/types/entities/entities_page.py +37 -0
- nemo_platform/types/entities/entity.py +63 -0
- nemo_platform/types/entities/entity_create_params.py +46 -0
- nemo_platform/types/entities/entity_delete_entity_by_name_params.py +31 -0
- nemo_platform/types/entities/entity_get_entity_by_name_params.py +31 -0
- nemo_platform/types/entities/entity_list_params.py +47 -0
- nemo_platform/types/entities/entity_update_entity_by_name_params.py +52 -0
- nemo_platform/types/evaluation/__init__.py +242 -0
- nemo_platform/types/evaluation/agent.py +68 -0
- nemo_platform/types/evaluation/agent_goal_accuracy_metric.py +92 -0
- nemo_platform/types/evaluation/agent_goal_accuracy_metric_param.py +69 -0
- nemo_platform/types/evaluation/agent_goal_accuracy_metric_param_param.py +70 -0
- nemo_platform/types/evaluation/agent_goal_accuracy_metric_response.py +88 -0
- nemo_platform/types/evaluation/agent_param.py +69 -0
- nemo_platform/types/evaluation/aggregate_range_score.py +65 -0
- nemo_platform/types/evaluation/aggregate_rubric_score.py +64 -0
- nemo_platform/types/evaluation/aggregated_metric_result.py +34 -0
- nemo_platform/types/evaluation/answer_accuracy_metric.py +89 -0
- nemo_platform/types/evaluation/answer_accuracy_metric_param.py +66 -0
- nemo_platform/types/evaluation/answer_accuracy_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/answer_accuracy_metric_response.py +85 -0
- nemo_platform/types/evaluation/benchmark.py +81 -0
- nemo_platform/types/evaluation/benchmark_create_params.py +64 -0
- nemo_platform/types/evaluation/benchmark_create_response.py +26 -0
- nemo_platform/types/evaluation/benchmark_evaluation_job.py +75 -0
- nemo_platform/types/evaluation/benchmark_evaluation_jobs_list_filter_param.py +49 -0
- nemo_platform/types/evaluation/benchmark_evaluation_jobs_page.py +37 -0
- nemo_platform/types/evaluation/benchmark_evaluation_jobs_sort_field.py +22 -0
- nemo_platform/types/evaluation/benchmark_job_create_params.py +58 -0
- nemo_platform/types/evaluation/benchmark_job_get_logs_params.py +30 -0
- nemo_platform/types/evaluation/benchmark_job_list_params.py +44 -0
- nemo_platform/types/evaluation/benchmark_job_result.py +93 -0
- nemo_platform/types/evaluation/benchmark_job_result_list_params.py +116 -0
- nemo_platform/types/evaluation/benchmark_job_result_retrieve_params.py +50 -0
- nemo_platform/types/evaluation/benchmark_job_results_list_response.py +37 -0
- nemo_platform/types/evaluation/benchmark_jobs/__init__.py +18 -0
- nemo_platform/types/evaluation/benchmark_jobs/results/__init__.py +22 -0
- nemo_platform/types/evaluation/benchmark_jobs/results/benchmark_evaluation_result.py +30 -0
- nemo_platform/types/evaluation/benchmark_jobs/results/benchmark_metric_result.py +44 -0
- nemo_platform/types/evaluation/benchmark_jobs/results/row_score_download_params.py +28 -0
- nemo_platform/types/evaluation/benchmark_list_params.py +84 -0
- nemo_platform/types/evaluation/benchmark_offline_job.py +43 -0
- nemo_platform/types/evaluation/benchmark_offline_job_param.py +44 -0
- nemo_platform/types/evaluation/benchmark_online_agent_job.py +71 -0
- nemo_platform/types/evaluation/benchmark_online_agent_job_param.py +74 -0
- nemo_platform/types/evaluation/benchmark_online_job.py +66 -0
- nemo_platform/types/evaluation/benchmark_online_job_param.py +68 -0
- nemo_platform/types/evaluation/benchmark_ref.py +22 -0
- nemo_platform/types/evaluation/benchmark_retrieve_params.py +29 -0
- nemo_platform/types/evaluation/benchmark_retrieve_response.py +27 -0
- nemo_platform/types/evaluation/benchmarks_list_response.py +42 -0
- nemo_platform/types/evaluation/bleu_metric.py +76 -0
- nemo_platform/types/evaluation/bleu_metric_param.py +50 -0
- nemo_platform/types/evaluation/bleu_metric_param_param.py +52 -0
- nemo_platform/types/evaluation/bleu_metric_response.py +69 -0
- nemo_platform/types/evaluation/built_in_dataset.py +46 -0
- nemo_platform/types/evaluation/context_entity_recall_metric.py +89 -0
- nemo_platform/types/evaluation/context_entity_recall_metric_param.py +66 -0
- nemo_platform/types/evaluation/context_entity_recall_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/context_entity_recall_metric_response.py +85 -0
- nemo_platform/types/evaluation/context_precision_metric.py +89 -0
- nemo_platform/types/evaluation/context_precision_metric_param.py +66 -0
- nemo_platform/types/evaluation/context_precision_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/context_precision_metric_response.py +85 -0
- nemo_platform/types/evaluation/context_recall_metric.py +89 -0
- nemo_platform/types/evaluation/context_recall_metric_param.py +66 -0
- nemo_platform/types/evaluation/context_recall_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/context_recall_metric_response.py +85 -0
- nemo_platform/types/evaluation/context_relevance_metric.py +89 -0
- nemo_platform/types/evaluation/context_relevance_metric_param.py +66 -0
- nemo_platform/types/evaluation/context_relevance_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/context_relevance_metric_response.py +85 -0
- nemo_platform/types/evaluation/dataset_rows.py +35 -0
- nemo_platform/types/evaluation/dataset_rows_param.py +36 -0
- nemo_platform/types/evaluation/evaluate_dataset_rows_param.py +33 -0
- nemo_platform/types/evaluation/exact_match_metric.py +79 -0
- nemo_platform/types/evaluation/exact_match_metric_param.py +53 -0
- nemo_platform/types/evaluation/exact_match_metric_param_param.py +53 -0
- nemo_platform/types/evaluation/exact_match_metric_response.py +72 -0
- nemo_platform/types/evaluation/extended_benchmark.py +130 -0
- nemo_platform/types/evaluation/f1_metric.py +76 -0
- nemo_platform/types/evaluation/f1_metric_param.py +50 -0
- nemo_platform/types/evaluation/f1_metric_param_param.py +50 -0
- nemo_platform/types/evaluation/f1_metric_response.py +69 -0
- nemo_platform/types/evaluation/faithfulness_metric.py +89 -0
- nemo_platform/types/evaluation/faithfulness_metric_param.py +66 -0
- nemo_platform/types/evaluation/faithfulness_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/faithfulness_metric_response.py +85 -0
- nemo_platform/types/evaluation/field_mapping.py +56 -0
- nemo_platform/types/evaluation/field_mapping_param.py +57 -0
- nemo_platform/types/evaluation/fileset.py +48 -0
- nemo_platform/types/evaluation/fileset_param.py +49 -0
- nemo_platform/types/evaluation/fileset_ref.py +22 -0
- nemo_platform/types/evaluation/histogram.py +30 -0
- nemo_platform/types/evaluation/histogram_bin.py +33 -0
- nemo_platform/types/evaluation/inference_params.py +65 -0
- nemo_platform/types/evaluation/inference_params_param.py +53 -0
- nemo_platform/types/evaluation/json_score_parser.py +35 -0
- nemo_platform/types/evaluation/json_score_parser_param.py +34 -0
- nemo_platform/types/evaluation/llm_judge_metric.py +126 -0
- nemo_platform/types/evaluation/llm_judge_metric_param.py +103 -0
- nemo_platform/types/evaluation/llm_judge_metric_param_param.py +105 -0
- nemo_platform/types/evaluation/llm_judge_metric_response.py +120 -0
- nemo_platform/types/evaluation/metric_create_params.py +959 -0
- nemo_platform/types/evaluation/metric_create_response.py +75 -0
- nemo_platform/types/evaluation/metric_evaluate_params.py +111 -0
- nemo_platform/types/evaluation/metric_evaluation_job.py +65 -0
- nemo_platform/types/evaluation/metric_evaluation_jobs_list_filter_param.py +49 -0
- nemo_platform/types/evaluation/metric_evaluation_jobs_page.py +37 -0
- nemo_platform/types/evaluation/metric_evaluation_jobs_sort_field.py +22 -0
- nemo_platform/types/evaluation/metric_evaluation_response.py +98 -0
- nemo_platform/types/evaluation/metric_evaluation_row_score.py +45 -0
- nemo_platform/types/evaluation/metric_job_create_params.py +48 -0
- nemo_platform/types/evaluation/metric_job_get_logs_params.py +30 -0
- nemo_platform/types/evaluation/metric_job_list_params.py +44 -0
- nemo_platform/types/evaluation/metric_job_result.py +93 -0
- nemo_platform/types/evaluation/metric_job_result_list_params.py +114 -0
- nemo_platform/types/evaluation/metric_job_result_retrieve_params.py +50 -0
- nemo_platform/types/evaluation/metric_job_results_list_response.py +37 -0
- nemo_platform/types/evaluation/metric_jobs/__init__.py +18 -0
- nemo_platform/types/evaluation/metric_jobs/results/__init__.py +20 -0
- nemo_platform/types/evaluation/metric_jobs/results/row_score_download_params.py +28 -0
- nemo_platform/types/evaluation/metric_list_params.py +73 -0
- nemo_platform/types/evaluation/metric_offline_job.py +106 -0
- nemo_platform/types/evaluation/metric_offline_job_param.py +107 -0
- nemo_platform/types/evaluation/metric_online_agent_job.py +133 -0
- nemo_platform/types/evaluation/metric_online_agent_job_param.py +135 -0
- nemo_platform/types/evaluation/metric_online_job.py +127 -0
- nemo_platform/types/evaluation/metric_online_job_param.py +129 -0
- nemo_platform/types/evaluation/metric_output.py +30 -0
- nemo_platform/types/evaluation/metric_ref.py +22 -0
- nemo_platform/types/evaluation/metric_retrieve_response.py +98 -0
- nemo_platform/types/evaluation/metric_retriever_job.py +64 -0
- nemo_platform/types/evaluation/metric_retriever_job_param.py +65 -0
- nemo_platform/types/evaluation/metric_type.py +47 -0
- nemo_platform/types/evaluation/metrics_list_response.py +90 -0
- nemo_platform/types/evaluation/model.py +44 -0
- nemo_platform/types/evaluation/model_param.py +44 -0
- nemo_platform/types/evaluation/model_ref.py +22 -0
- nemo_platform/types/evaluation/nemo_agent_toolkit_remote_metric.py +87 -0
- nemo_platform/types/evaluation/nemo_agent_toolkit_remote_metric_param.py +64 -0
- nemo_platform/types/evaluation/nemo_agent_toolkit_remote_metric_param_param.py +65 -0
- nemo_platform/types/evaluation/nemo_agent_toolkit_remote_metric_response.py +80 -0
- nemo_platform/types/evaluation/noise_sensitivity_metric.py +89 -0
- nemo_platform/types/evaluation/noise_sensitivity_metric_param.py +66 -0
- nemo_platform/types/evaluation/noise_sensitivity_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/noise_sensitivity_metric_response.py +85 -0
- nemo_platform/types/evaluation/number_check_metric.py +104 -0
- nemo_platform/types/evaluation/number_check_metric_param.py +81 -0
- nemo_platform/types/evaluation/number_check_metric_param_param.py +83 -0
- nemo_platform/types/evaluation/number_check_metric_response.py +97 -0
- nemo_platform/types/evaluation/parameter.py +42 -0
- nemo_platform/types/evaluation/parameter_param.py +40 -0
- nemo_platform/types/evaluation/percentiles.py +54 -0
- nemo_platform/types/evaluation/range_score.py +56 -0
- nemo_platform/types/evaluation/range_score_param.py +57 -0
- nemo_platform/types/evaluation/reasoning_params.py +41 -0
- nemo_platform/types/evaluation/reasoning_params_param.py +41 -0
- nemo_platform/types/evaluation/regex_score_parser.py +38 -0
- nemo_platform/types/evaluation/regex_score_parser_param.py +37 -0
- nemo_platform/types/evaluation/remote_metric.py +91 -0
- nemo_platform/types/evaluation/remote_metric_param.py +68 -0
- nemo_platform/types/evaluation/remote_metric_param_param.py +69 -0
- nemo_platform/types/evaluation/remote_metric_response.py +84 -0
- nemo_platform/types/evaluation/remote_score.py +49 -0
- nemo_platform/types/evaluation/remote_score_param.py +50 -0
- nemo_platform/types/evaluation/response_groundedness_metric.py +89 -0
- nemo_platform/types/evaluation/response_groundedness_metric_param.py +66 -0
- nemo_platform/types/evaluation/response_groundedness_metric_param_param.py +67 -0
- nemo_platform/types/evaluation/response_groundedness_metric_response.py +85 -0
- nemo_platform/types/evaluation/response_relevancy_metric.py +95 -0
- nemo_platform/types/evaluation/response_relevancy_metric_param.py +74 -0
- nemo_platform/types/evaluation/response_relevancy_metric_param_param.py +75 -0
- nemo_platform/types/evaluation/response_relevancy_metric_response.py +93 -0
- nemo_platform/types/evaluation/retriever_pipeline.py +34 -0
- nemo_platform/types/evaluation/retriever_pipeline_param.py +35 -0
- nemo_platform/types/evaluation/rouge_metric.py +76 -0
- nemo_platform/types/evaluation/rouge_metric_param.py +53 -0
- nemo_platform/types/evaluation/rouge_metric_param_param.py +53 -0
- nemo_platform/types/evaluation/rouge_metric_response.py +69 -0
- nemo_platform/types/evaluation/row_score.py +59 -0
- nemo_platform/types/evaluation/rubric.py +40 -0
- nemo_platform/types/evaluation/rubric_param.py +40 -0
- nemo_platform/types/evaluation/rubric_score.py +54 -0
- nemo_platform/types/evaluation/rubric_score_param.py +55 -0
- nemo_platform/types/evaluation/rubric_score_stat.py +38 -0
- nemo_platform/types/evaluation/run_config.py +39 -0
- nemo_platform/types/evaluation/run_config_online.py +51 -0
- nemo_platform/types/evaluation/run_config_online_model.py +73 -0
- nemo_platform/types/evaluation/run_config_online_model_param.py +75 -0
- nemo_platform/types/evaluation/run_config_online_param.py +51 -0
- nemo_platform/types/evaluation/run_config_param.py +39 -0
- nemo_platform/types/evaluation/string_check_metric.py +82 -0
- nemo_platform/types/evaluation/string_check_metric_param.py +59 -0
- nemo_platform/types/evaluation/string_check_metric_param_param.py +61 -0
- nemo_platform/types/evaluation/string_check_metric_response.py +75 -0
- nemo_platform/types/evaluation/system_benchmark.py +71 -0
- nemo_platform/types/evaluation/system_benchmark_offline_job.py +58 -0
- nemo_platform/types/evaluation/system_benchmark_offline_job_param.py +60 -0
- nemo_platform/types/evaluation/system_benchmark_online_job.py +54 -0
- nemo_platform/types/evaluation/system_benchmark_online_job_param.py +55 -0
- nemo_platform/types/evaluation/system_metric.py +70 -0
- nemo_platform/types/evaluation/system_metric_param.py +50 -0
- nemo_platform/types/evaluation/system_metric_param_param.py +51 -0
- nemo_platform/types/evaluation/system_metric_response.py +66 -0
- nemo_platform/types/evaluation/tool_call_accuracy_metric.py +70 -0
- nemo_platform/types/evaluation/tool_call_accuracy_metric_param.py +44 -0
- nemo_platform/types/evaluation/tool_call_accuracy_metric_param_param.py +44 -0
- nemo_platform/types/evaluation/tool_call_accuracy_metric_response.py +63 -0
- nemo_platform/types/evaluation/tool_calling_metric.py +70 -0
- nemo_platform/types/evaluation/tool_calling_metric_param.py +47 -0
- nemo_platform/types/evaluation/tool_calling_metric_param_param.py +47 -0
- nemo_platform/types/evaluation/tool_calling_metric_response.py +63 -0
- nemo_platform/types/evaluation/topic_adherence_metric.py +92 -0
- nemo_platform/types/evaluation/topic_adherence_metric_param.py +69 -0
- nemo_platform/types/evaluation/topic_adherence_metric_param_param.py +70 -0
- nemo_platform/types/evaluation/topic_adherence_metric_response.py +88 -0
- nemo_platform/types/files/__init__.py +45 -0
- nemo_platform/types/files/cache_status.py +22 -0
- nemo_platform/types/files/dataset_metadata_content.py +46 -0
- nemo_platform/types/files/dataset_metadata_content_param.py +45 -0
- nemo_platform/types/files/file_list_files_params.py +35 -0
- nemo_platform/types/files/file_upload_file_params.py +28 -0
- nemo_platform/types/files/fileset.py +62 -0
- nemo_platform/types/files/fileset_create_params.py +74 -0
- nemo_platform/types/files/fileset_file.py +36 -0
- nemo_platform/types/files/fileset_filter_param.py +54 -0
- nemo_platform/types/files/fileset_list_params.py +47 -0
- nemo_platform/types/files/fileset_metadata_param.py +46 -0
- nemo_platform/types/files/fileset_metadata_param_param.py +47 -0
- nemo_platform/types/files/fileset_outputs_page.py +37 -0
- nemo_platform/types/files/fileset_purpose.py +22 -0
- nemo_platform/types/files/fileset_update_params.py +49 -0
- nemo_platform/types/files/huggingface_storage_config.py +60 -0
- nemo_platform/types/files/huggingface_storage_config_param.py +60 -0
- nemo_platform/types/files/list_fileset_files_response.py +27 -0
- nemo_platform/types/files/local_storage_config.py +39 -0
- nemo_platform/types/files/local_storage_config_param.py +38 -0
- nemo_platform/types/files/ngc_storage_config.py +66 -0
- nemo_platform/types/files/ngc_storage_config_param.py +66 -0
- nemo_platform/types/files/otlp/__init__.py +22 -0
- nemo_platform/types/files/otlp/log_query_params.py +36 -0
- nemo_platform/types/files/otlp/otel_export_logs_partial_success.py +34 -0
- nemo_platform/types/files/otlp/otel_export_logs_service_response.py +35 -0
- nemo_platform/types/files/s3_storage_config.py +85 -0
- nemo_platform/types/files/s3_storage_config_param.py +85 -0
- nemo_platform/types/files/secret_ref.py +22 -0
- nemo_platform/types/files/storage_config_type.py +22 -0
- nemo_platform/types/guardrail/__init__.py +165 -0
- nemo_platform/types/guardrail/action_rails.py +36 -0
- nemo_platform/types/guardrail/action_rails_param.py +38 -0
- nemo_platform/types/guardrail/activated_rail.py +61 -0
- nemo_platform/types/guardrail/ai_defense_rail_config.py +36 -0
- nemo_platform/types/guardrail/ai_defense_rail_config_param.py +36 -0
- nemo_platform/types/guardrail/auto_align_options.py +29 -0
- nemo_platform/types/guardrail/auto_align_options_param.py +30 -0
- nemo_platform/types/guardrail/auto_align_rail_config.py +35 -0
- nemo_platform/types/guardrail/auto_align_rail_config_param.py +37 -0
- nemo_platform/types/guardrail/cache_stats_config.py +32 -0
- nemo_platform/types/guardrail/cache_stats_config_param.py +32 -0
- nemo_platform/types/guardrail/chat_completion_assistant_message_param.py +45 -0
- nemo_platform/types/guardrail/chat_completion_content_part_image_param.py +34 -0
- nemo_platform/types/guardrail/chat_completion_content_part_text_param.py +32 -0
- nemo_platform/types/guardrail/chat_completion_function_message_param.py +35 -0
- nemo_platform/types/guardrail/chat_completion_message_tool_call_param.py +37 -0
- nemo_platform/types/guardrail/chat_completion_system_message_param.py +35 -0
- nemo_platform/types/guardrail/chat_completion_tool_message_param.py +35 -0
- nemo_platform/types/guardrail/chat_completion_user_message_param.py +41 -0
- nemo_platform/types/guardrail/clavata_rail_config.py +47 -0
- nemo_platform/types/guardrail/clavata_rail_config_param.py +48 -0
- nemo_platform/types/guardrail/clavata_rail_options.py +36 -0
- nemo_platform/types/guardrail/clavata_rail_options_param.py +38 -0
- nemo_platform/types/guardrail/config_create_params.py +36 -0
- nemo_platform/types/guardrail/config_list_params.py +47 -0
- nemo_platform/types/guardrail/config_update_params.py +33 -0
- nemo_platform/types/guardrail/content_safety_config.py +34 -0
- nemo_platform/types/guardrail/content_safety_config_param.py +35 -0
- nemo_platform/types/guardrail/crowd_strike_aidr_rail_config.py +29 -0
- nemo_platform/types/guardrail/crowd_strike_aidr_rail_config_param.py +29 -0
- nemo_platform/types/guardrail/dialog_rails.py +34 -0
- nemo_platform/types/guardrail/dialog_rails_param.py +35 -0
- nemo_platform/types/guardrail/executed_action.py +48 -0
- nemo_platform/types/guardrail/fact_checking_rail_config.py +31 -0
- nemo_platform/types/guardrail/fact_checking_rail_config_param.py +32 -0
- nemo_platform/types/guardrail/fiddler_guardrails.py +35 -0
- nemo_platform/types/guardrail/fiddler_guardrails_param.py +35 -0
- nemo_platform/types/guardrail/function_call_param.py +35 -0
- nemo_platform/types/guardrail/function_param.py +35 -0
- nemo_platform/types/guardrail/g_li_ner_detection.py +51 -0
- nemo_platform/types/guardrail/g_li_ner_detection_options.py +29 -0
- nemo_platform/types/guardrail/g_li_ner_detection_options_param.py +31 -0
- nemo_platform/types/guardrail/g_li_ner_detection_param.py +52 -0
- nemo_platform/types/guardrail/generation_log.py +44 -0
- nemo_platform/types/guardrail/generation_log_options_param.py +50 -0
- nemo_platform/types/guardrail/generation_options_param.py +55 -0
- nemo_platform/types/guardrail/generation_rails_options_param.py +53 -0
- nemo_platform/types/guardrail/generation_stats.py +56 -0
- nemo_platform/types/guardrail/guardrail_check_params.py +164 -0
- nemo_platform/types/guardrail/guardrail_check_response.py +36 -0
- nemo_platform/types/guardrail/guardrail_config.py +59 -0
- nemo_platform/types/guardrail/guardrail_config_filter_param.py +49 -0
- nemo_platform/types/guardrail/guardrail_configs_page.py +37 -0
- nemo_platform/types/guardrail/guardrails_ai_rail_config.py +33 -0
- nemo_platform/types/guardrail/guardrails_ai_rail_config_param.py +35 -0
- nemo_platform/types/guardrail/guardrails_ai_validator_config.py +44 -0
- nemo_platform/types/guardrail/guardrails_ai_validator_config_param.py +45 -0
- nemo_platform/types/guardrail/guardrails_data.py +40 -0
- nemo_platform/types/guardrail/guardrails_data_param.py +67 -0
- nemo_platform/types/guardrail/image_u_rl_param.py +32 -0
- nemo_platform/types/guardrail/injection_detection.py +49 -0
- nemo_platform/types/guardrail/injection_detection_param.py +52 -0
- nemo_platform/types/guardrail/input_rails.py +32 -0
- nemo_platform/types/guardrail/input_rails_param.py +34 -0
- nemo_platform/types/guardrail/instruction.py +30 -0
- nemo_platform/types/guardrail/instruction_param.py +32 -0
- nemo_platform/types/guardrail/jailbreak_detection_config.py +52 -0
- nemo_platform/types/guardrail/jailbreak_detection_config_param.py +58 -0
- nemo_platform/types/guardrail/llm_call_info.py +63 -0
- nemo_platform/types/guardrail/log_adapter_config.py +41 -0
- nemo_platform/types/guardrail/log_adapter_config_param.py +27 -0
- nemo_platform/types/guardrail/message_template.py +30 -0
- nemo_platform/types/guardrail/message_template_param.py +32 -0
- nemo_platform/types/guardrail/model.py +55 -0
- nemo_platform/types/guardrail/model_cache_config.py +36 -0
- nemo_platform/types/guardrail/model_cache_config_param.py +37 -0
- nemo_platform/types/guardrail/model_param.py +55 -0
- nemo_platform/types/guardrail/model_parameters.py +51 -0
- nemo_platform/types/guardrail/model_parameters_param.py +38 -0
- nemo_platform/types/guardrail/multilingual_config.py +40 -0
- nemo_platform/types/guardrail/multilingual_config_param.py +41 -0
- nemo_platform/types/guardrail/output_rails.py +44 -0
- nemo_platform/types/guardrail/output_rails_param.py +46 -0
- nemo_platform/types/guardrail/output_rails_streaming_config.py +44 -0
- nemo_platform/types/guardrail/output_rails_streaming_config_param.py +44 -0
- nemo_platform/types/guardrail/pangea_rail_config.py +33 -0
- nemo_platform/types/guardrail/pangea_rail_config_param.py +34 -0
- nemo_platform/types/guardrail/pangea_rail_options.py +31 -0
- nemo_platform/types/guardrail/pangea_rail_options_param.py +33 -0
- nemo_platform/types/guardrail/patronus_evaluate_api_params.py +38 -0
- nemo_platform/types/guardrail/patronus_evaluate_api_params_param.py +40 -0
- nemo_platform/types/guardrail/patronus_evaluate_config.py +30 -0
- nemo_platform/types/guardrail/patronus_evaluate_config_param.py +31 -0
- nemo_platform/types/guardrail/patronus_evaluation_success_strategy.py +22 -0
- nemo_platform/types/guardrail/patronus_rail_config.py +33 -0
- nemo_platform/types/guardrail/patronus_rail_config_param.py +34 -0
- nemo_platform/types/guardrail/private_ai_detection.py +39 -0
- nemo_platform/types/guardrail/private_ai_detection_options.py +29 -0
- nemo_platform/types/guardrail/private_ai_detection_options_param.py +31 -0
- nemo_platform/types/guardrail/private_ai_detection_param.py +40 -0
- nemo_platform/types/guardrail/rail_status.py +26 -0
- nemo_platform/types/guardrail/rails.py +73 -0
- nemo_platform/types/guardrail/rails_config.py +79 -0
- nemo_platform/types/guardrail/rails_config_data.py +94 -0
- nemo_platform/types/guardrail/rails_config_data_param.py +95 -0
- nemo_platform/types/guardrail/rails_config_param.py +81 -0
- nemo_platform/types/guardrail/rails_param.py +74 -0
- nemo_platform/types/guardrail/reasoning_config.py +32 -0
- nemo_platform/types/guardrail/reasoning_config_param.py +32 -0
- nemo_platform/types/guardrail/regex_detection.py +36 -0
- nemo_platform/types/guardrail/regex_detection_options.py +32 -0
- nemo_platform/types/guardrail/regex_detection_options_param.py +34 -0
- nemo_platform/types/guardrail/regex_detection_param.py +37 -0
- nemo_platform/types/guardrail/retrieval_rails.py +29 -0
- nemo_platform/types/guardrail/retrieval_rails_param.py +31 -0
- nemo_platform/types/guardrail/sensitive_data_detection.py +43 -0
- nemo_platform/types/guardrail/sensitive_data_detection_options.py +37 -0
- nemo_platform/types/guardrail/sensitive_data_detection_options_param.py +39 -0
- nemo_platform/types/guardrail/sensitive_data_detection_param.py +45 -0
- nemo_platform/types/guardrail/single_call_config.py +31 -0
- nemo_platform/types/guardrail/single_call_config_param.py +31 -0
- nemo_platform/types/guardrail/status_enum.py +22 -0
- nemo_platform/types/guardrail/task_prompt.py +63 -0
- nemo_platform/types/guardrail/task_prompt_param.py +65 -0
- nemo_platform/types/guardrail/tool_input_rails.py +36 -0
- nemo_platform/types/guardrail/tool_input_rails_param.py +38 -0
- nemo_platform/types/guardrail/tool_output_rails.py +36 -0
- nemo_platform/types/guardrail/tool_output_rails_param.py +38 -0
- nemo_platform/types/guardrail/tracing_config.py +48 -0
- nemo_platform/types/guardrail/tracing_config_param.py +50 -0
- nemo_platform/types/guardrail/trend_micro_rail_config.py +51 -0
- nemo_platform/types/guardrail/trend_micro_rail_config_param.py +51 -0
- nemo_platform/types/guardrail/user_messages_config.py +42 -0
- nemo_platform/types/guardrail/user_messages_config_param.py +42 -0
- nemo_platform/types/iam/__init__.py +26 -0
- nemo_platform/types/iam/date_range_filter_param.py +36 -0
- nemo_platform/types/iam/role_binding.py +42 -0
- nemo_platform/types/iam/role_binding_create_params.py +39 -0
- nemo_platform/types/iam/role_binding_delete_params.py +30 -0
- nemo_platform/types/iam/role_binding_filter_param.py +49 -0
- nemo_platform/types/iam/role_binding_list_params.py +44 -0
- nemo_platform/types/iam/role_bindings_page.py +37 -0
- nemo_platform/types/inference/__init__.py +60 -0
- nemo_platform/types/inference/deployment_config_create_params.py +47 -0
- nemo_platform/types/inference/deployment_config_list_params.py +46 -0
- nemo_platform/types/inference/deployment_config_update_params.py +37 -0
- nemo_platform/types/inference/deployment_configs/__init__.py +20 -0
- nemo_platform/types/inference/deployment_configs/version_list_response.py +25 -0
- nemo_platform/types/inference/deployment_create_params.py +45 -0
- nemo_platform/types/inference/deployment_list_models_response.py +23 -0
- nemo_platform/types/inference/deployment_list_params.py +52 -0
- nemo_platform/types/inference/deployment_update_params.py +35 -0
- nemo_platform/types/inference/deployment_update_status_params.py +42 -0
- nemo_platform/types/inference/deployments/__init__.py +20 -0
- nemo_platform/types/inference/deployments/version_list_response.py +25 -0
- nemo_platform/types/inference/gateway/__init__.py +38 -0
- nemo_platform/types/inference/gateway/model_patch_params.py +31 -0
- nemo_platform/types/inference/gateway/model_patch_response.py +23 -0
- nemo_platform/types/inference/gateway/model_post_params.py +31 -0
- nemo_platform/types/inference/gateway/model_post_response.py +23 -0
- nemo_platform/types/inference/gateway/model_put_params.py +31 -0
- nemo_platform/types/inference/gateway/model_put_response.py +23 -0
- nemo_platform/types/inference/gateway/openai/__init__.py +18 -0
- nemo_platform/types/inference/gateway/openai/v1/__init__.py +21 -0
- nemo_platform/types/inference/gateway/openai/v1/openai_list_models_resp.py +31 -0
- nemo_platform/types/inference/gateway/openai/v1/openai_model_resp.py +34 -0
- nemo_platform/types/inference/gateway/openai_patch_params.py +29 -0
- nemo_platform/types/inference/gateway/openai_patch_response.py +23 -0
- nemo_platform/types/inference/gateway/openai_post_params.py +29 -0
- nemo_platform/types/inference/gateway/openai_post_response.py +23 -0
- nemo_platform/types/inference/gateway/openai_put_params.py +29 -0
- nemo_platform/types/inference/gateway/openai_put_response.py +23 -0
- nemo_platform/types/inference/gateway/provider_patch_params.py +31 -0
- nemo_platform/types/inference/gateway/provider_patch_response.py +23 -0
- nemo_platform/types/inference/gateway/provider_post_params.py +31 -0
- nemo_platform/types/inference/gateway/provider_post_response.py +23 -0
- nemo_platform/types/inference/gateway/provider_put_params.py +31 -0
- nemo_platform/types/inference/gateway/provider_put_response.py +23 -0
- nemo_platform/types/inference/gateway/provider_ready_response.py +23 -0
- nemo_platform/types/inference/k8s_nim_operator_config.py +57 -0
- nemo_platform/types/inference/k8s_nim_operator_config_param.py +58 -0
- nemo_platform/types/inference/middleware_call.py +55 -0
- nemo_platform/types/inference/middleware_call_param.py +56 -0
- nemo_platform/types/inference/model_deployment.py +97 -0
- nemo_platform/types/inference/model_deployment_config.py +76 -0
- nemo_platform/types/inference/model_deployment_config_filter_param.py +49 -0
- nemo_platform/types/inference/model_deployment_configs_page.py +37 -0
- nemo_platform/types/inference/model_deployment_filter_param.py +56 -0
- nemo_platform/types/inference/model_deployment_status.py +24 -0
- nemo_platform/types/inference/model_deployment_status_history_item.py +37 -0
- nemo_platform/types/inference/model_deployments_page.py +37 -0
- nemo_platform/types/inference/model_provider.py +134 -0
- nemo_platform/types/inference/model_provider_filter_param.py +56 -0
- nemo_platform/types/inference/model_provider_sort.py +24 -0
- nemo_platform/types/inference/model_provider_status.py +24 -0
- nemo_platform/types/inference/model_providers_page.py +37 -0
- nemo_platform/types/inference/model_type.py +22 -0
- nemo_platform/types/inference/nim_deployment.py +96 -0
- nemo_platform/types/inference/nim_deployment_param.py +93 -0
- nemo_platform/types/inference/provider_create_params.py +94 -0
- nemo_platform/types/inference/provider_list_params.py +47 -0
- nemo_platform/types/inference/provider_update_params.py +87 -0
- nemo_platform/types/inference/provider_update_status_params.py +48 -0
- nemo_platform/types/inference/served_model_mapping.py +35 -0
- nemo_platform/types/inference/served_model_mapping_param.py +32 -0
- nemo_platform/types/inference/virtual_model.py +91 -0
- nemo_platform/types/inference/virtual_model_create_params.py +83 -0
- nemo_platform/types/inference/virtual_model_inference_config.py +32 -0
- nemo_platform/types/inference/virtual_model_inference_config_param.py +34 -0
- nemo_platform/types/inference/virtual_model_list_params.py +35 -0
- nemo_platform/types/inference/virtual_model_patch_params.py +80 -0
- nemo_platform/types/inference/virtual_models_page.py +37 -0
- nemo_platform/types/intake/__init__.py +86 -0
- nemo_platform/types/intake/app.py +51 -0
- nemo_platform/types/intake/app_create_params.py +38 -0
- nemo_platform/types/intake/app_filter_param.py +46 -0
- nemo_platform/types/intake/app_list_params.py +44 -0
- nemo_platform/types/intake/app_patch_params.py +35 -0
- nemo_platform/types/intake/app_sort_field.py +22 -0
- nemo_platform/types/intake/apps/__init__.py +26 -0
- nemo_platform/types/intake/apps/task.py +54 -0
- nemo_platform/types/intake/apps/task_create_params.py +40 -0
- nemo_platform/types/intake/apps/task_filter_param.py +49 -0
- nemo_platform/types/intake/apps/task_list_params.py +44 -0
- nemo_platform/types/intake/apps/task_patch_params.py +37 -0
- nemo_platform/types/intake/apps/task_sort_field.py +22 -0
- nemo_platform/types/intake/apps/tasks_page.py +37 -0
- nemo_platform/types/intake/apps_page.py +37 -0
- nemo_platform/types/intake/entries/__init__.py +20 -0
- nemo_platform/types/intake/entries/event_create_params.py +40 -0
- nemo_platform/types/intake/entry.py +98 -0
- nemo_platform/types/intake/entry_context.py +79 -0
- nemo_platform/types/intake/entry_context_filter_param.py +41 -0
- nemo_platform/types/intake/entry_context_param.py +82 -0
- nemo_platform/types/intake/entry_create_params.py +85 -0
- nemo_platform/types/intake/entry_data.py +48 -0
- nemo_platform/types/intake/entry_data_param.py +51 -0
- nemo_platform/types/intake/entry_filter_param.py +85 -0
- nemo_platform/types/intake/entry_list_params.py +47 -0
- nemo_platform/types/intake/entry_patch_params.py +79 -0
- nemo_platform/types/intake/entry_sort_field.py +22 -0
- nemo_platform/types/intake/entry_user_rating_filter_param.py +31 -0
- nemo_platform/types/intake/entrys_page.py +37 -0
- nemo_platform/types/intake/evaluation_context_param.py +41 -0
- nemo_platform/types/intake/evaluator_result.py +52 -0
- nemo_platform/types/intake/evaluator_result_create_params.py +52 -0
- nemo_platform/types/intake/evaluator_result_data_type.py +22 -0
- nemo_platform/types/intake/evaluator_result_event.py +67 -0
- nemo_platform/types/intake/evaluator_result_event_param.py +69 -0
- nemo_platform/types/intake/evaluator_result_filter_param.py +49 -0
- nemo_platform/types/intake/evaluator_result_list_params.py +43 -0
- nemo_platform/types/intake/evaluator_result_sort_field.py +22 -0
- nemo_platform/types/intake/evaluator_results_page.py +37 -0
- nemo_platform/types/intake/export_config_param.py +44 -0
- nemo_platform/types/intake/export_config_param_param.py +45 -0
- nemo_platform/types/intake/export_preview_params.py +34 -0
- nemo_platform/types/intake/export_preview_response.py +39 -0
- nemo_platform/types/intake/exports/__init__.py +28 -0
- nemo_platform/types/intake/exports/export_config.py +44 -0
- nemo_platform/types/intake/exports/export_job.py +76 -0
- nemo_platform/types/intake/exports/export_job_filter_param.py +50 -0
- nemo_platform/types/intake/exports/export_job_sort_field.py +22 -0
- nemo_platform/types/intake/exports/export_jobs_page.py +37 -0
- nemo_platform/types/intake/exports/export_status_details.py +35 -0
- nemo_platform/types/intake/exports/job_create_params.py +40 -0
- nemo_platform/types/intake/exports/job_list_params.py +46 -0
- nemo_platform/types/intake/exports/job_status.py +22 -0
- nemo_platform/types/intake/flexible_entry_request.py +63 -0
- nemo_platform/types/intake/flexible_entry_request_param.py +51 -0
- nemo_platform/types/intake/flexible_entry_response.py +62 -0
- nemo_platform/types/intake/flexible_entry_response_param.py +49 -0
- nemo_platform/types/intake/flexible_message.py +56 -0
- nemo_platform/types/intake/flexible_message_param.py +43 -0
- nemo_platform/types/intake/float_filter_param.py +32 -0
- nemo_platform/types/intake/ingest/__init__.py +37 -0
- nemo_platform/types/intake/ingest/atif_agent_param.py +35 -0
- nemo_platform/types/intake/ingest/atif_content_part_image_param.py +30 -0
- nemo_platform/types/intake/ingest/atif_content_part_param.py +28 -0
- nemo_platform/types/intake/ingest/atif_content_part_text_param.py +28 -0
- nemo_platform/types/intake/ingest/atif_create_params.py +52 -0
- nemo_platform/types/intake/ingest/atif_final_metrics_param.py +37 -0
- nemo_platform/types/intake/ingest/atif_image_source_param.py +28 -0
- nemo_platform/types/intake/ingest/atif_metrics_param.py +41 -0
- nemo_platform/types/intake/ingest/atif_observation_param.py +29 -0
- nemo_platform/types/intake/ingest/atif_observation_result_param.py +36 -0
- nemo_platform/types/intake/ingest/atif_step_agent_param.py +58 -0
- nemo_platform/types/intake/ingest/atif_step_param.py +29 -0
- nemo_platform/types/intake/ingest/atif_step_system_param.py +43 -0
- nemo_platform/types/intake/ingest/atif_step_user_param.py +43 -0
- nemo_platform/types/intake/ingest/atif_subagent_trajectory_ref_param.py +33 -0
- nemo_platform/types/intake/ingest/atif_tool_call_param.py +31 -0
- nemo_platform/types/intake/ingest/chat_completion_create_params.py +66 -0
- nemo_platform/types/intake/ingest/chat_completions_ingest_response.py +26 -0
- nemo_platform/types/intake/ingest/otlp/__init__.py +18 -0
- nemo_platform/types/intake/ingest/otlp/v1/__init__.py +20 -0
- nemo_platform/types/intake/ingest/otlp/v1/ingest_response.py +26 -0
- nemo_platform/types/intake/message_role.py +22 -0
- nemo_platform/types/intake/reviewer_annotation_event.py +95 -0
- nemo_platform/types/intake/reviewer_annotation_event_param.py +97 -0
- nemo_platform/types/intake/span.py +100 -0
- nemo_platform/types/intake/span_evaluation_context.py +40 -0
- nemo_platform/types/intake/span_filter_param.py +95 -0
- nemo_platform/types/intake/span_kind.py +24 -0
- nemo_platform/types/intake/span_list_params.py +46 -0
- nemo_platform/types/intake/span_sort_field.py +22 -0
- nemo_platform/types/intake/span_status.py +22 -0
- nemo_platform/types/intake/spans/__init__.py +20 -0
- nemo_platform/types/intake/spans/evaluator_result_list_response.py +25 -0
- nemo_platform/types/intake/spans_page.py +37 -0
- nemo_platform/types/intake/thumb_direction.py +22 -0
- nemo_platform/types/intake/trace.py +65 -0
- nemo_platform/types/intake/trace_filter_param.py +60 -0
- nemo_platform/types/intake/trace_list_params.py +49 -0
- nemo_platform/types/intake/trace_retrieve_params.py +32 -0
- nemo_platform/types/intake/trace_sort_field.py +22 -0
- nemo_platform/types/intake/traces_page.py +37 -0
- nemo_platform/types/intake/usage.py +65 -0
- nemo_platform/types/intake/usage_param.py +68 -0
- nemo_platform/types/intake/user_action_event.py +65 -0
- nemo_platform/types/intake/user_action_event_param.py +68 -0
- nemo_platform/types/intake/user_feedback_event.py +84 -0
- nemo_platform/types/intake/user_feedback_event_param.py +86 -0
- nemo_platform/types/intake/user_rating.py +68 -0
- nemo_platform/types/intake/user_rating_param.py +70 -0
- nemo_platform/types/jobs/__init__.py +95 -0
- nemo_platform/types/jobs/compute_resource_spec.py +32 -0
- nemo_platform/types/jobs/compute_resource_spec_param.py +32 -0
- nemo_platform/types/jobs/compute_resources.py +46 -0
- nemo_platform/types/jobs/compute_resources_param.py +47 -0
- nemo_platform/types/jobs/container_spec.py +35 -0
- nemo_platform/types/jobs/container_spec_param.py +37 -0
- nemo_platform/types/jobs/cpu_execution_provider.py +46 -0
- nemo_platform/types/jobs/cpu_execution_provider_param.py +46 -0
- nemo_platform/types/jobs/distributed_gpu_execution_provider.py +46 -0
- nemo_platform/types/jobs/distributed_gpu_execution_provider_param.py +46 -0
- nemo_platform/types/jobs/docker_job_execution_profile.py +43 -0
- nemo_platform/types/jobs/docker_job_execution_profile_config.py +52 -0
- nemo_platform/types/jobs/docker_job_network_config.py +27 -0
- nemo_platform/types/jobs/docker_job_storage_config.py +36 -0
- nemo_platform/types/jobs/docker_volume_mount.py +47 -0
- nemo_platform/types/jobs/e2e_job_execution_profile.py +43 -0
- nemo_platform/types/jobs/gpu_execution_provider.py +46 -0
- nemo_platform/types/jobs/gpu_execution_provider_param.py +46 -0
- nemo_platform/types/jobs/image_pull_secret.py +27 -0
- nemo_platform/types/jobs/job_create_params.py +46 -0
- nemo_platform/types/jobs/job_execution_profile_config.py +42 -0
- nemo_platform/types/jobs/job_get_logs_params.py +41 -0
- nemo_platform/types/jobs/job_list_execution_profiles_response.py +37 -0
- nemo_platform/types/jobs/job_list_params.py +47 -0
- nemo_platform/types/jobs/job_update_status_details_params.py +29 -0
- nemo_platform/types/jobs/kubernetes_empty_dir_volume.py +32 -0
- nemo_platform/types/jobs/kubernetes_job_execution_profile.py +43 -0
- nemo_platform/types/jobs/kubernetes_job_execution_profile_config.py +101 -0
- nemo_platform/types/jobs/kubernetes_job_storage_config.py +40 -0
- nemo_platform/types/jobs/kubernetes_object_metadata.py +28 -0
- nemo_platform/types/jobs/kubernetes_persistent_volume_claim.py +32 -0
- nemo_platform/types/jobs/kubernetes_volume.py +37 -0
- nemo_platform/types/jobs/kubernetes_volume_mount.py +38 -0
- nemo_platform/types/jobs/platform_job_environment_variable.py +36 -0
- nemo_platform/types/jobs/platform_job_environment_variable_param.py +37 -0
- nemo_platform/types/jobs/platform_job_list_task_response.py +29 -0
- nemo_platform/types/jobs/platform_job_response.py +75 -0
- nemo_platform/types/jobs/platform_job_responses_page.py +37 -0
- nemo_platform/types/jobs/platform_job_secret_environment_variable_ref.py +27 -0
- nemo_platform/types/jobs/platform_job_secret_environment_variable_ref_param.py +29 -0
- nemo_platform/types/jobs/platform_job_sort_field.py +22 -0
- nemo_platform/types/jobs/platform_job_spec.py +30 -0
- nemo_platform/types/jobs/platform_job_spec_param.py +32 -0
- nemo_platform/types/jobs/platform_job_step.py +75 -0
- nemo_platform/types/jobs/platform_job_step_spec.py +63 -0
- nemo_platform/types/jobs/platform_job_step_spec_param.py +65 -0
- nemo_platform/types/jobs/platform_job_step_with_context.py +67 -0
- nemo_platform/types/jobs/platform_job_step_with_contexts_page.py +37 -0
- nemo_platform/types/jobs/platform_job_steps_list_filter_param.py +38 -0
- nemo_platform/types/jobs/platform_job_task.py +75 -0
- nemo_platform/types/jobs/platform_jobs_list_filter_param.py +51 -0
- nemo_platform/types/jobs/result_create_params.py +34 -0
- nemo_platform/types/jobs/result_list_params.py +34 -0
- nemo_platform/types/jobs/step_lifecycle.py +37 -0
- nemo_platform/types/jobs/step_lifecycle_param.py +37 -0
- nemo_platform/types/jobs/step_list_params.py +44 -0
- nemo_platform/types/jobs/step_update_status_params.py +44 -0
- nemo_platform/types/jobs/subprocess_execution_provider.py +33 -0
- nemo_platform/types/jobs/subprocess_execution_provider_param.py +34 -0
- nemo_platform/types/jobs/subprocess_job_execution_profile.py +36 -0
- nemo_platform/types/jobs/subprocess_job_execution_profile_config.py +49 -0
- nemo_platform/types/jobs/task_create_or_update_params.py +46 -0
- nemo_platform/types/jobs/volcano_job_execution_profile.py +39 -0
- nemo_platform/types/jobs/volcano_job_execution_profile_config.py +114 -0
- nemo_platform/types/members/__init__.py +24 -0
- nemo_platform/types/members/member_create_params.py +40 -0
- nemo_platform/types/members/member_delete_params.py +32 -0
- nemo_platform/types/members/member_update_params.py +37 -0
- nemo_platform/types/members/workspace_member.py +39 -0
- nemo_platform/types/members/workspace_member_list_response.py +29 -0
- nemo_platform/types/models/__init__.py +34 -0
- nemo_platform/types/models/adapter.py +73 -0
- nemo_platform/types/models/adapter_create_params.py +54 -0
- nemo_platform/types/models/adapter_update_params.py +37 -0
- nemo_platform/types/models/base_model_filter_param.py +29 -0
- nemo_platform/types/models/finetuning_type_filter_param.py +31 -0
- nemo_platform/types/models/lora.py +30 -0
- nemo_platform/types/models/lora_param.py +30 -0
- nemo_platform/types/models/model_create_params.py +93 -0
- nemo_platform/types/models/model_entity.py +112 -0
- nemo_platform/types/models/model_entity_filter_param.py +72 -0
- nemo_platform/types/models/model_entity_sort_field.py +22 -0
- nemo_platform/types/models/model_entitys_page.py +37 -0
- nemo_platform/types/models/model_list_params.py +50 -0
- nemo_platform/types/models/model_retrieve_params.py +29 -0
- nemo_platform/types/models/model_update_params.py +86 -0
- nemo_platform/types/projects/__init__.py +25 -0
- nemo_platform/types/projects/project.py +45 -0
- nemo_platform/types/projects/project_create_params.py +37 -0
- nemo_platform/types/projects/project_list_params.py +49 -0
- nemo_platform/types/projects/project_sort_field.py +22 -0
- nemo_platform/types/projects/project_update_params.py +29 -0
- nemo_platform/types/projects/projects_page.py +37 -0
- nemo_platform/types/safe_synthesizer/__init__.py +68 -0
- nemo_platform/types/safe_synthesizer/classify_config.py +41 -0
- nemo_platform/types/safe_synthesizer/classify_config_param.py +43 -0
- nemo_platform/types/safe_synthesizer/column.py +46 -0
- nemo_platform/types/safe_synthesizer/column_actions.py +36 -0
- nemo_platform/types/safe_synthesizer/column_actions_param.py +38 -0
- nemo_platform/types/safe_synthesizer/column_param.py +49 -0
- nemo_platform/types/safe_synthesizer/data_parameters.py +69 -0
- nemo_platform/types/safe_synthesizer/data_parameters_param.py +69 -0
- nemo_platform/types/safe_synthesizer/differential_privacy_hyperparams.py +48 -0
- nemo_platform/types/safe_synthesizer/differential_privacy_hyperparams_param.py +48 -0
- nemo_platform/types/safe_synthesizer/evaluation_parameters.py +64 -0
- nemo_platform/types/safe_synthesizer/evaluation_parameters_param.py +66 -0
- nemo_platform/types/safe_synthesizer/generate_parameters.py +104 -0
- nemo_platform/types/safe_synthesizer/generate_parameters_param.py +102 -0
- nemo_platform/types/safe_synthesizer/gliner_config.py +41 -0
- nemo_platform/types/safe_synthesizer/gliner_config_param.py +41 -0
- nemo_platform/types/safe_synthesizer/globals.py +45 -0
- nemo_platform/types/safe_synthesizer/globals_param.py +47 -0
- nemo_platform/types/safe_synthesizer/job_create_params.py +46 -0
- nemo_platform/types/safe_synthesizer/job_get_logs_params.py +30 -0
- nemo_platform/types/safe_synthesizer/job_list_params.py +44 -0
- nemo_platform/types/safe_synthesizer/jobs/__init__.py +21 -0
- nemo_platform/types/safe_synthesizer/jobs/safe_synthesizer_summary.py +95 -0
- nemo_platform/types/safe_synthesizer/jobs/safe_synthesizer_timing.py +41 -0
- nemo_platform/types/safe_synthesizer/ner_config.py +42 -0
- nemo_platform/types/safe_synthesizer/ner_config_param.py +44 -0
- nemo_platform/types/safe_synthesizer/pii_replacer_config.py +40 -0
- nemo_platform/types/safe_synthesizer/pii_replacer_config_param.py +42 -0
- nemo_platform/types/safe_synthesizer/row.py +50 -0
- nemo_platform/types/safe_synthesizer/row_actions.py +33 -0
- nemo_platform/types/safe_synthesizer/row_actions_param.py +35 -0
- nemo_platform/types/safe_synthesizer/row_param.py +53 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_job.py +63 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_job_config.py +55 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_job_config_param.py +56 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_jobs_list_filter_param.py +49 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_jobs_page.py +37 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_jobs_sort_field.py +22 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_parameters.py +91 -0
- nemo_platform/types/safe_synthesizer/safe_synthesizer_parameters_param.py +92 -0
- nemo_platform/types/safe_synthesizer/step_definition.py +39 -0
- nemo_platform/types/safe_synthesizer/step_definition_param.py +41 -0
- nemo_platform/types/safe_synthesizer/time_series_parameters.py +73 -0
- nemo_platform/types/safe_synthesizer/time_series_parameters_param.py +74 -0
- nemo_platform/types/safe_synthesizer/training_hyperparams.py +165 -0
- nemo_platform/types/safe_synthesizer/training_hyperparams_param.py +167 -0
- nemo_platform/types/safe_synthesizer/validation_parameters.py +54 -0
- nemo_platform/types/safe_synthesizer/validation_parameters_param.py +54 -0
- nemo_platform/types/secrets/__init__.py +28 -0
- nemo_platform/types/secrets/platform_secret_access_response.py +33 -0
- nemo_platform/types/secrets/platform_secret_admin_rotation_response.py +28 -0
- nemo_platform/types/secrets/platform_secret_response.py +40 -0
- nemo_platform/types/secrets/platform_secret_responses_page.py +37 -0
- nemo_platform/types/secrets/secret_create_params.py +39 -0
- nemo_platform/types/secrets/secret_list_params.py +32 -0
- nemo_platform/types/secrets/secret_update_params.py +32 -0
- nemo_platform/types/shared/__init__.py +50 -0
- nemo_platform/types/shared/api_endpoint_data.py +43 -0
- nemo_platform/types/shared/auth_context.py +48 -0
- nemo_platform/types/shared/auth_discovery_response.py +32 -0
- nemo_platform/types/shared/backend_format.py +22 -0
- nemo_platform/types/shared/datetime_filter.py +33 -0
- nemo_platform/types/shared/delete_response.py +33 -0
- nemo_platform/types/shared/error_response.py +46 -0
- nemo_platform/types/shared/field_error.py +28 -0
- nemo_platform/types/shared/file_storage_type.py +22 -0
- nemo_platform/types/shared/fileset_metadata.py +46 -0
- nemo_platform/types/shared/finetuning_type.py +48 -0
- nemo_platform/types/shared/generic_sort_field.py +22 -0
- nemo_platform/types/shared/http_validation_error.py +27 -0
- nemo_platform/types/shared/linear_layer_spec.py +33 -0
- nemo_platform/types/shared/mamba_config.py +44 -0
- nemo_platform/types/shared/mo_e_config.py +41 -0
- nemo_platform/types/shared/model_metadata_content.py +38 -0
- nemo_platform/types/shared/model_spec.py +111 -0
- nemo_platform/types/shared/oidc_discovery_response.py +42 -0
- nemo_platform/types/shared/pagination_data.py +37 -0
- nemo_platform/types/shared/platform_job_list_result_response.py +27 -0
- nemo_platform/types/shared/platform_job_log.py +34 -0
- nemo_platform/types/shared/platform_job_log_page.py +33 -0
- nemo_platform/types/shared/platform_job_result_response.py +44 -0
- nemo_platform/types/shared/platform_job_status.py +24 -0
- nemo_platform/types/shared/platform_job_status_response.py +48 -0
- nemo_platform/types/shared/platform_job_step_status_response.py +48 -0
- nemo_platform/types/shared/platform_job_task_status_response.py +47 -0
- nemo_platform/types/shared/prompt_data.py +47 -0
- nemo_platform/types/shared/sliding_window_config.py +27 -0
- nemo_platform/types/shared/tool_call_config.py +46 -0
- nemo_platform/types/shared/tool_calling_metadata_content.py +48 -0
- nemo_platform/types/shared/validation_error.py +34 -0
- nemo_platform/types/shared_params/__init__.py +33 -0
- nemo_platform/types/shared_params/api_endpoint_data.py +38 -0
- nemo_platform/types/shared_params/backend_format.py +24 -0
- nemo_platform/types/shared_params/datetime_filter.py +34 -0
- nemo_platform/types/shared_params/file_storage_type.py +24 -0
- nemo_platform/types/shared_params/finetuning_type.py +50 -0
- nemo_platform/types/shared_params/generic_sort_field.py +24 -0
- nemo_platform/types/shared_params/linear_layer_spec.py +35 -0
- nemo_platform/types/shared_params/mamba_config.py +44 -0
- nemo_platform/types/shared_params/mo_e_config.py +41 -0
- nemo_platform/types/shared_params/model_metadata_content.py +39 -0
- nemo_platform/types/shared_params/model_spec.py +113 -0
- nemo_platform/types/shared_params/platform_job_status.py +26 -0
- nemo_platform/types/shared_params/prompt_data.py +48 -0
- nemo_platform/types/shared_params/sliding_window_config.py +29 -0
- nemo_platform/types/shared_params/tool_call_config.py +46 -0
- nemo_platform/types/shared_params/tool_calling_metadata_content.py +48 -0
- nemo_platform/types/workspaces/__init__.py +24 -0
- nemo_platform/types/workspaces/workspace.py +48 -0
- nemo_platform/types/workspaces/workspace_create_params.py +41 -0
- nemo_platform/types/workspaces/workspace_list_params.py +47 -0
- nemo_platform/types/workspaces/workspace_update_params.py +27 -0
- nemo_platform/types/workspaces/workspaces_page.py +37 -0
- nemo_platform/ui/__init__.py +15 -0
- nemo_platform/ui/output.py +109 -0
- nemo_platform/ui/prompts.py +678 -0
- nemo_platform_plugin/.agents/skills/creating-a-plugin/SKILL.md +275 -0
- nemo_platform_plugin/.agents/skills/plugin-config/SKILL.md +168 -0
- nemo_platform_plugin/.agents/skills/plugin-controller/SKILL.md +320 -0
- nemo_platform_plugin/.agents/skills/plugin-entities/SKILL.md +290 -0
- nemo_platform_plugin/.agents/skills/plugin-function/SKILL.md +292 -0
- nemo_platform_plugin/.agents/skills/plugin-inference-middleware/SKILL.md +346 -0
- nemo_platform_plugin/.agents/skills/plugin-job/SKILL.md +247 -0
- nemo_platform_plugin/.agents/skills/plugin-platform-services/SKILL.md +239 -0
- nemo_platform_plugin/.agents/skills/plugin-platform-services/services-reference.md +192 -0
- nemo_platform_plugin/.agents/skills/plugin-service/SKILL.md +181 -0
- nemo_platform_plugin/.agents/skills/plugin-service/crud-example.md +353 -0
- nemo_platform_plugin/.agents/skills/plugin-testing/SKILL.md +206 -0
- nemo_platform_plugin/README.md +43 -0
- nemo_platform_plugin/_base.py +53 -0
- nemo_platform_plugin/_spec_flags.py +573 -0
- nemo_platform_plugin/api/filter.py +189 -0
- nemo_platform_plugin/api/parsed_filter.py +288 -0
- nemo_platform_plugin/api/text_filter.py +291 -0
- nemo_platform_plugin/cli.py +152 -0
- nemo_platform_plugin/cli_errors.py +232 -0
- nemo_platform_plugin/cli_renderer.py +92 -0
- nemo_platform_plugin/commands.py +1433 -0
- nemo_platform_plugin/config.py +844 -0
- nemo_platform_plugin/controller.py +148 -0
- nemo_platform_plugin/dependencies.py +64 -0
- nemo_platform_plugin/discovery.py +484 -0
- nemo_platform_plugin/docs/ARCHITECTURE.md +160 -0
- nemo_platform_plugin/docs/CONFIG.md +151 -0
- nemo_platform_plugin/docs/CONTROLLER.md +209 -0
- nemo_platform_plugin/docs/ENTITY.md +186 -0
- nemo_platform_plugin/docs/INFERENCE_MIDDLEWARE.md +408 -0
- nemo_platform_plugin/docs/JOB.md +237 -0
- nemo_platform_plugin/docs/QUICKSTART.md +306 -0
- nemo_platform_plugin/docs/SERVICE.md +302 -0
- nemo_platform_plugin/entities.py +793 -0
- nemo_platform_plugin/entity.py +79 -0
- nemo_platform_plugin/entity_client.py +54 -0
- nemo_platform_plugin/filter_ops.py +169 -0
- nemo_platform_plugin/function.py +299 -0
- nemo_platform_plugin/function_context.py +61 -0
- nemo_platform_plugin/functions/frames.py +69 -0
- nemo_platform_plugin/functions/routes.py +454 -0
- nemo_platform_plugin/inference_middleware.py +1191 -0
- nemo_platform_plugin/interface.py +28 -0
- nemo_platform_plugin/job.py +370 -0
- nemo_platform_plugin/job_context.py +86 -0
- nemo_platform_plugin/job_results.py +209 -0
- nemo_platform_plugin/jobs/_cli_options.py +204 -0
- nemo_platform_plugin/jobs/api_factory.py +1178 -0
- nemo_platform_plugin/jobs/constants.py +27 -0
- nemo_platform_plugin/jobs/docker.py +76 -0
- nemo_platform_plugin/jobs/exceptions.py +8 -0
- nemo_platform_plugin/jobs/file_manager.py +238 -0
- nemo_platform_plugin/jobs/openapi_utils.py +174 -0
- nemo_platform_plugin/jobs/profile.py +110 -0
- nemo_platform_plugin/jobs/result_manager.py +291 -0
- nemo_platform_plugin/jobs/routes.py +297 -0
- nemo_platform_plugin/jobs/schemas.py +174 -0
- nemo_platform_plugin/refs.py +154 -0
- nemo_platform_plugin/run_dependencies.py +137 -0
- nemo_platform_plugin/scheduler.py +537 -0
- nemo_platform_plugin/schema.py +216 -0
- nemo_platform_plugin/sdk.py +34 -0
- nemo_platform_plugin/seed.py +71 -0
- nemo_platform_plugin/service.py +130 -0
- nemo_platform_plugin/tasks/dispatcher.py +226 -0
- nemo_platform_plugin-0.1.0.dist-info/METADATA +88 -0
- nemo_platform_plugin-0.1.0.dist-info/RECORD +1224 -0
- nemo_platform_plugin-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,940 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""FilesetFileSystem - fsspec filesystem for NeMo Platform nemo_platform.filesets."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import inspect
|
|
9
|
+
from collections.abc import AsyncIterator, Coroutine, Iterator, Sequence
|
|
10
|
+
from datetime import datetime, timezone
|
|
11
|
+
from typing import Any, Literal, TypedDict, TypeVar, overload
|
|
12
|
+
|
|
13
|
+
import anyio
|
|
14
|
+
import fsspec.asyn
|
|
15
|
+
import httpx
|
|
16
|
+
from anyio import to_thread
|
|
17
|
+
from fsspec.asyn import AbstractAsyncStreamedFile, AsyncFileSystem, _get_batch_size
|
|
18
|
+
from fsspec.callbacks import DEFAULT_CALLBACK, Callback
|
|
19
|
+
from fsspec.spec import AbstractBufferedFile
|
|
20
|
+
from nemo_platform import AsyncNeMoPlatform, NeMoPlatform
|
|
21
|
+
from nemo_platform.types.files import FilesetFile as SDKFilesetFile
|
|
22
|
+
|
|
23
|
+
# Conditional import for TestClient detection
|
|
24
|
+
try:
|
|
25
|
+
from starlette.testclient import TestClient
|
|
26
|
+
except ImportError:
|
|
27
|
+
TestClient = None
|
|
28
|
+
|
|
29
|
+
T = TypeVar("T")
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
async def run_coros_in_chunks(
|
|
33
|
+
coros: Sequence[Coroutine[Any, Any, T]],
|
|
34
|
+
batch_size: int | None = None,
|
|
35
|
+
callback: Callback = DEFAULT_CALLBACK,
|
|
36
|
+
timeout: float | None = None,
|
|
37
|
+
return_exceptions: bool = False,
|
|
38
|
+
nofiles: bool = False,
|
|
39
|
+
) -> list[T | None | BaseException]:
|
|
40
|
+
"""Run coroutines with bounded concurrency using AnyIO task groups.
|
|
41
|
+
|
|
42
|
+
This intentionally differs from fsspec's chunked wave-based scheduling.
|
|
43
|
+
We admit all work up front and use a CapacityLimiter so a new task can start
|
|
44
|
+
as soon as any slot frees up, which keeps bulk downloads/uploads saturated.
|
|
45
|
+
|
|
46
|
+
We still monkey-patch fsspec's helper so inherited AsyncFileSystem bulk ops
|
|
47
|
+
benefit from AnyIO task-group cancellation. Running tasks are cancelled by
|
|
48
|
+
the task group; coroutine objects that were never entered are explicitly
|
|
49
|
+
closed in the outer finally block.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
if batch_size is None:
|
|
53
|
+
batch_size = _get_batch_size(nofiles=nofiles)
|
|
54
|
+
if batch_size == -1 or not isinstance(batch_size, int):
|
|
55
|
+
batch_size = len(coros) if coros else 1
|
|
56
|
+
|
|
57
|
+
results: list[T | None | BaseException] = [None] * len(coros)
|
|
58
|
+
exceptions: list[BaseException] = []
|
|
59
|
+
|
|
60
|
+
limiter = anyio.CapacityLimiter(batch_size)
|
|
61
|
+
|
|
62
|
+
async def run_one(coro: Coroutine[Any, Any, T], idx: int) -> None:
|
|
63
|
+
entered = False
|
|
64
|
+
try:
|
|
65
|
+
async with limiter:
|
|
66
|
+
entered = True
|
|
67
|
+
if timeout is None:
|
|
68
|
+
results[idx] = await coro
|
|
69
|
+
else:
|
|
70
|
+
with anyio.fail_after(timeout):
|
|
71
|
+
results[idx] = await coro
|
|
72
|
+
except Exception as e:
|
|
73
|
+
if return_exceptions:
|
|
74
|
+
results[idx] = e
|
|
75
|
+
else:
|
|
76
|
+
exceptions.append(e)
|
|
77
|
+
raise
|
|
78
|
+
finally:
|
|
79
|
+
if entered:
|
|
80
|
+
callback.relative_update(1)
|
|
81
|
+
|
|
82
|
+
try:
|
|
83
|
+
async with anyio.create_task_group() as tg:
|
|
84
|
+
for i, coro in enumerate(coros):
|
|
85
|
+
tg.start_soon(run_one, coro, i)
|
|
86
|
+
except ExceptionGroup:
|
|
87
|
+
# Re-raise the first actual failure for compatibility with callers that
|
|
88
|
+
# expect a plain exception instead of an ExceptionGroup.
|
|
89
|
+
if not return_exceptions and exceptions:
|
|
90
|
+
raise exceptions[0] from None
|
|
91
|
+
raise
|
|
92
|
+
finally:
|
|
93
|
+
# Any coroutine objects that were never entered by a task must be explicitly
|
|
94
|
+
# closed, otherwise Python warns that they were never awaited.
|
|
95
|
+
for coro in coros:
|
|
96
|
+
if inspect.getcoroutinestate(coro) == inspect.CORO_CREATED:
|
|
97
|
+
coro.close()
|
|
98
|
+
|
|
99
|
+
return results
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
# Monkey-patch fsspec so inherited AsyncFileSystem bulk ops use the same
|
|
103
|
+
# limiter-based AnyIO runner. This is intentionally semantics-different from
|
|
104
|
+
# upstream chunking because we prefer continuous refill over wave-based batches.
|
|
105
|
+
fsspec.asyn._run_coros_in_chunks = run_coros_in_chunks
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class FileInfo(TypedDict):
|
|
109
|
+
"""File or directory info returned by fsspec methods."""
|
|
110
|
+
|
|
111
|
+
name: str
|
|
112
|
+
size: int
|
|
113
|
+
type: Literal["file", "directory"]
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class FilesetPathError(ValueError):
|
|
117
|
+
"""Error raised when handling a fileset path."""
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def parse_fileset_ref(ref: str, *, workspace_fallback: str | None) -> tuple[str, str, str]:
|
|
121
|
+
"""Parse fileset reference -> (workspace, fileset, file_path).
|
|
122
|
+
|
|
123
|
+
Extracts components from a fileset reference. Workspace must be provided
|
|
124
|
+
either in the ref or via workspace_fallback.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
ref: The fileset reference to parse.
|
|
128
|
+
workspace_fallback: Workspace to use if not specified in the ref.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
Tuple of (workspace, fileset, file_path).
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
FilesetPathError: If workspace is not in the ref and no fallback provided.
|
|
135
|
+
|
|
136
|
+
Supported formats:
|
|
137
|
+
- URL format: fileset://workspace/fileset[#path]
|
|
138
|
+
- Hash format: [workspace/]fileset#path
|
|
139
|
+
- Path format: [workspace/]fileset (1-2 segments, no path)
|
|
140
|
+
- Legacy format: workspace/fileset/path (3+ segments, for backwards compatibility)
|
|
141
|
+
|
|
142
|
+
The `#` separator distinguishes fileset name from file path.
|
|
143
|
+
If `#` is omitted and there are 3+ path segments, assumes legacy format.
|
|
144
|
+
|
|
145
|
+
Examples:
|
|
146
|
+
parse_fileset_ref("default/my-fileset#data/file.txt", workspace_fallback=None)
|
|
147
|
+
-> ("default", "my-fileset", "data/file.txt")
|
|
148
|
+
parse_fileset_ref("my-fileset#file.txt", workspace_fallback="default")
|
|
149
|
+
-> ("default", "my-fileset", "file.txt")
|
|
150
|
+
parse_fileset_ref("default/my-fileset", workspace_fallback=None)
|
|
151
|
+
-> ("default", "my-fileset", "")
|
|
152
|
+
parse_fileset_ref("default/my-fileset/data/file.txt", workspace_fallback=None)
|
|
153
|
+
-> ("default", "my-fileset", "data/file.txt") # legacy format
|
|
154
|
+
"""
|
|
155
|
+
ref = ref.removeprefix("fileset://").lstrip("/")
|
|
156
|
+
if not ref:
|
|
157
|
+
raise FilesetPathError("Path must include fileset name")
|
|
158
|
+
|
|
159
|
+
# If # is present, use hash format parsing
|
|
160
|
+
if "#" in ref:
|
|
161
|
+
fileset_part, file_path = ref.split("#", 1)
|
|
162
|
+
file_path = file_path.lstrip("/")
|
|
163
|
+
|
|
164
|
+
# Parse workspace/fileset or just fileset
|
|
165
|
+
if "/" in fileset_part:
|
|
166
|
+
workspace, fileset = fileset_part.rsplit("/", 1)
|
|
167
|
+
else:
|
|
168
|
+
workspace = ""
|
|
169
|
+
fileset = fileset_part
|
|
170
|
+
else:
|
|
171
|
+
# No # - could be path format (1-2 segments) or legacy format (3+ segments)
|
|
172
|
+
parts = ref.split("/")
|
|
173
|
+
|
|
174
|
+
if len(parts) == 1:
|
|
175
|
+
# Just fileset name
|
|
176
|
+
workspace = ""
|
|
177
|
+
fileset = parts[0]
|
|
178
|
+
file_path = ""
|
|
179
|
+
elif len(parts) == 2:
|
|
180
|
+
# workspace/fileset (root)
|
|
181
|
+
workspace, fileset = parts
|
|
182
|
+
file_path = ""
|
|
183
|
+
else:
|
|
184
|
+
# Legacy format: workspace/fileset/path/...
|
|
185
|
+
workspace = parts[0]
|
|
186
|
+
fileset = parts[1]
|
|
187
|
+
file_path = "/".join(parts[2:])
|
|
188
|
+
|
|
189
|
+
if not fileset:
|
|
190
|
+
raise FilesetPathError("Fileset name is required")
|
|
191
|
+
|
|
192
|
+
# Apply fallback if workspace wasn't in the ref
|
|
193
|
+
if not workspace:
|
|
194
|
+
if workspace_fallback:
|
|
195
|
+
workspace = workspace_fallback
|
|
196
|
+
else:
|
|
197
|
+
raise FilesetPathError(
|
|
198
|
+
f"Workspace required - provide in ref (e.g., 'workspace/{fileset}') or pass workspace_fallback"
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
return workspace, fileset, file_path
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def parse_fileset_path(
|
|
205
|
+
path: str,
|
|
206
|
+
*,
|
|
207
|
+
workspace_fallback: str | None = None,
|
|
208
|
+
) -> tuple[str, str | None, str]:
|
|
209
|
+
"""Parse a path that may or may not include a fileset reference.
|
|
210
|
+
|
|
211
|
+
This is designed for SDK methods where the path parameter could be:
|
|
212
|
+
- A full fileset ref: "workspace/fileset#path" or "fileset://..."
|
|
213
|
+
- A pure file path: "data/file.txt" (when fileset/workspace are separate params)
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
path: The path to parse. May be a full fileset ref or just a file path.
|
|
217
|
+
workspace_fallback: Workspace to use when workspace is not in the path.
|
|
218
|
+
|
|
219
|
+
Returns:
|
|
220
|
+
Tuple of (workspace, fileset, file_path).
|
|
221
|
+
|
|
222
|
+
Raises:
|
|
223
|
+
FilesetPathError: If workspace cannot be determined (not in path and no fallback).
|
|
224
|
+
|
|
225
|
+
Examples:
|
|
226
|
+
# Full fileset refs - delegates to parse_fileset_ref
|
|
227
|
+
parse_fileset_path("workspace/fileset#data/file.txt")
|
|
228
|
+
-> ("workspace", "fileset", "data/file.txt")
|
|
229
|
+
parse_fileset_path("fileset://ws/fs#file.txt")
|
|
230
|
+
-> ("ws", "fs", "file.txt")
|
|
231
|
+
|
|
232
|
+
# Pure file paths - uses workspace_fallback
|
|
233
|
+
parse_fileset_path("data/file.txt", workspace_fallback="default")
|
|
234
|
+
-> ("default", None, "data/file.txt")
|
|
235
|
+
parse_fileset_path("file.txt", workspace_fallback="default")
|
|
236
|
+
-> ("default", None, "file.txt")
|
|
237
|
+
"""
|
|
238
|
+
# If it has a # or fileset:// prefix, it's a fileset ref
|
|
239
|
+
if "#" in path or path.startswith("fileset://"):
|
|
240
|
+
return parse_fileset_ref(path, workspace_fallback=workspace_fallback)
|
|
241
|
+
|
|
242
|
+
# Otherwise, treat the entire input as a file path
|
|
243
|
+
if not workspace_fallback:
|
|
244
|
+
raise FilesetPathError("workspace required when parsing a file path without fileset reference")
|
|
245
|
+
return workspace_fallback, None, path
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def build_fileset_ref(
|
|
249
|
+
ref: str,
|
|
250
|
+
*,
|
|
251
|
+
workspace: str | None = None,
|
|
252
|
+
fileset: str | None = None,
|
|
253
|
+
) -> str:
|
|
254
|
+
"""Build a fileset reference in canonical format: workspace/fileset[#file_path].
|
|
255
|
+
|
|
256
|
+
Can normalize an existing ref or construct a new one from a file path.
|
|
257
|
+
|
|
258
|
+
Args:
|
|
259
|
+
ref: The fileset reference to normalize, or a file path if fileset is provided.
|
|
260
|
+
workspace: Workspace to use if not specified in ref.
|
|
261
|
+
fileset: Fileset to use if ref is a pure file path (no # separator).
|
|
262
|
+
|
|
263
|
+
Returns:
|
|
264
|
+
Ref in format "workspace/fileset#file_path" or "workspace/fileset".
|
|
265
|
+
|
|
266
|
+
Raises:
|
|
267
|
+
FilesetPathError: If workspace or fileset cannot be determined.
|
|
268
|
+
|
|
269
|
+
Examples:
|
|
270
|
+
# Normalizing existing refs
|
|
271
|
+
build_fileset_ref("ws/fs#dir/file.txt")
|
|
272
|
+
-> "ws/fs#dir/file.txt"
|
|
273
|
+
build_fileset_ref("ws/fs/dir/file.txt") # legacy format
|
|
274
|
+
-> "ws/fs#dir/file.txt"
|
|
275
|
+
build_fileset_ref("my-fileset#file.txt", workspace="default")
|
|
276
|
+
-> "default/my-fileset#file.txt"
|
|
277
|
+
|
|
278
|
+
# Constructing refs from file paths
|
|
279
|
+
build_fileset_ref("data/file.txt", workspace="ws", fileset="fs")
|
|
280
|
+
-> "ws/fs#data/file.txt"
|
|
281
|
+
build_fileset_ref("", workspace="ws", fileset="fs")
|
|
282
|
+
-> "ws/fs"
|
|
283
|
+
"""
|
|
284
|
+
# If fileset provided and ref doesn't contain #, treat ref as a file path
|
|
285
|
+
if fileset is not None and "#" not in ref:
|
|
286
|
+
file_path = ref.lstrip("/")
|
|
287
|
+
ws = workspace
|
|
288
|
+
fs = fileset
|
|
289
|
+
if not ws:
|
|
290
|
+
raise FilesetPathError(f"workspace required when constructing ref from file path '{ref}'")
|
|
291
|
+
else:
|
|
292
|
+
# Parse as fileset ref
|
|
293
|
+
ws, fs, file_path = parse_fileset_ref(ref, workspace_fallback=workspace)
|
|
294
|
+
|
|
295
|
+
if file_path:
|
|
296
|
+
return f"{ws}/{fs}#{file_path}"
|
|
297
|
+
return f"{ws}/{fs}"
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
class FilesetFileSystem(AsyncFileSystem):
|
|
301
|
+
"""
|
|
302
|
+
fsspec filesystem for NeMo Platform nemo_platform.filesets.
|
|
303
|
+
|
|
304
|
+
URL format: fileset://[workspace/]fileset_name[#path]
|
|
305
|
+
|
|
306
|
+
The optional `#` separator distinguishes the fileset name from the file path.
|
|
307
|
+
If omitted, assumes root of fileset. Workspace is optional - if omitted,
|
|
308
|
+
uses the SDK's default workspace.
|
|
309
|
+
|
|
310
|
+
Examples:
|
|
311
|
+
>>> from nemo_platform import NeMoPlatform
|
|
312
|
+
>>> sdk = NeMoPlatform(base_url="http://localhost:8000", workspace="default")
|
|
313
|
+
>>> fs = FilesetFileSystem(sdk=sdk)
|
|
314
|
+
>>> fs.ls("my-fileset") # root of fileset, workspace from SDK default
|
|
315
|
+
>>> fs.ls("my-fileset#data/") # specific path within fileset
|
|
316
|
+
>>> fs.ls("default/my-fileset#data/") # explicit workspace
|
|
317
|
+
"""
|
|
318
|
+
|
|
319
|
+
protocol = "fileset"
|
|
320
|
+
|
|
321
|
+
@classmethod
|
|
322
|
+
def register_fsspec(cls) -> None:
|
|
323
|
+
"""Register the fileset protocol with fsspec.
|
|
324
|
+
|
|
325
|
+
After calling this, you can use fsspec.filesystem("fileset", sdk=sdk).
|
|
326
|
+
"""
|
|
327
|
+
from fsspec import register_implementation
|
|
328
|
+
|
|
329
|
+
register_implementation(cls.protocol, cls, clobber=True)
|
|
330
|
+
|
|
331
|
+
# Default concurrency for file transfers
|
|
332
|
+
default_batch_size = 4
|
|
333
|
+
|
|
334
|
+
# Default block/chunk size for uploads/downloads
|
|
335
|
+
blocksize = 16 * 1024 * 1024 # 16MB
|
|
336
|
+
|
|
337
|
+
# The Files API does not currently expose file timestamps. Return a stable
|
|
338
|
+
# fallback after confirming the path exists so fsspec consumers like DuckDB
|
|
339
|
+
# do not fail on metadata lookups.
|
|
340
|
+
_fallback_timestamp = datetime.fromtimestamp(0, tz=timezone.utc)
|
|
341
|
+
|
|
342
|
+
def __init__(
|
|
343
|
+
self,
|
|
344
|
+
sdk: NeMoPlatform | AsyncNeMoPlatform,
|
|
345
|
+
batch_size: int | None = None,
|
|
346
|
+
blocksize: int | None = None,
|
|
347
|
+
**kwargs,
|
|
348
|
+
):
|
|
349
|
+
if batch_size is None:
|
|
350
|
+
batch_size = self.default_batch_size
|
|
351
|
+
|
|
352
|
+
if blocksize is None:
|
|
353
|
+
blocksize = self.blocksize
|
|
354
|
+
|
|
355
|
+
# Set asynchronous mode based on SDK type. When asynchronous=False,
|
|
356
|
+
# fsspec creates a global daemon event loop (self.loop) that callers
|
|
357
|
+
# can use for sync-to-async bridging via fsspec.asyn.sync().
|
|
358
|
+
is_async_sdk = isinstance(sdk, AsyncNeMoPlatform)
|
|
359
|
+
super().__init__(asynchronous=is_async_sdk, batch_size=batch_size, blocksize=blocksize, **kwargs)
|
|
360
|
+
self._sdk: AsyncNeMoPlatform = self._get_sdk(sdk)
|
|
361
|
+
|
|
362
|
+
def _get_sdk(
|
|
363
|
+
self,
|
|
364
|
+
sdk: NeMoPlatform | AsyncNeMoPlatform,
|
|
365
|
+
) -> AsyncNeMoPlatform:
|
|
366
|
+
# If already an async SDK, use it as-is to preserve custom transports (e.g., test clients)
|
|
367
|
+
if isinstance(sdk, AsyncNeMoPlatform):
|
|
368
|
+
return sdk
|
|
369
|
+
|
|
370
|
+
# Convert sync SDK to async SDK
|
|
371
|
+
transport: httpx.AsyncBaseTransport | None = None
|
|
372
|
+
if TestClient is not None and isinstance(sdk._client, TestClient):
|
|
373
|
+
# If using a synchronous test client, we should use the ASGITransport
|
|
374
|
+
transport = httpx.ASGITransport(app=sdk._client.app)
|
|
375
|
+
|
|
376
|
+
return AsyncNeMoPlatform(
|
|
377
|
+
workspace=sdk.workspace,
|
|
378
|
+
base_url=sdk.base_url,
|
|
379
|
+
timeout=sdk.timeout,
|
|
380
|
+
max_retries=sdk.max_retries,
|
|
381
|
+
default_headers=sdk._custom_headers,
|
|
382
|
+
default_query=sdk.default_query,
|
|
383
|
+
http_client=httpx.AsyncClient(
|
|
384
|
+
transport=transport,
|
|
385
|
+
base_url=sdk.base_url,
|
|
386
|
+
headers=sdk._custom_headers,
|
|
387
|
+
),
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
def to_fileset_files(self, results: dict[str, Any]) -> list[SDKFilesetFile]:
|
|
391
|
+
"""Convert fsspec find results to FilesetFile objects.
|
|
392
|
+
|
|
393
|
+
Args:
|
|
394
|
+
results: Dict from find(detail=True) mapping paths to file info.
|
|
395
|
+
|
|
396
|
+
Returns:
|
|
397
|
+
List of FilesetFile objects with path, size, and file_ref.
|
|
398
|
+
"""
|
|
399
|
+
files = []
|
|
400
|
+
for name, info in results.items():
|
|
401
|
+
if info.get("type") == "directory":
|
|
402
|
+
continue
|
|
403
|
+
workspace, fileset, file_path = parse_fileset_ref(name, workspace_fallback=None)
|
|
404
|
+
files.append(
|
|
405
|
+
SDKFilesetFile(
|
|
406
|
+
file_ref=f"{workspace}/{fileset}#{file_path}",
|
|
407
|
+
file_url=f"/apis/files/v2/workspaces/{workspace}/filesets/{fileset}/-/{file_path}",
|
|
408
|
+
path=file_path,
|
|
409
|
+
size=info.get("size", 0),
|
|
410
|
+
)
|
|
411
|
+
)
|
|
412
|
+
return files
|
|
413
|
+
|
|
414
|
+
def invalidate_cache(self, path: str | None = None) -> None:
|
|
415
|
+
"""Discard cached directory information."""
|
|
416
|
+
if path is None:
|
|
417
|
+
self.dircache.clear()
|
|
418
|
+
else:
|
|
419
|
+
self.dircache.pop(path.rstrip("/"), None)
|
|
420
|
+
super().invalidate_cache(path)
|
|
421
|
+
|
|
422
|
+
def created(self, path: str) -> datetime:
|
|
423
|
+
self.info(path)
|
|
424
|
+
return self._fallback_timestamp
|
|
425
|
+
|
|
426
|
+
def modified(self, path: str) -> datetime:
|
|
427
|
+
self.info(path)
|
|
428
|
+
return self._fallback_timestamp
|
|
429
|
+
|
|
430
|
+
def _populate_dircache_from_response(
|
|
431
|
+
self,
|
|
432
|
+
response,
|
|
433
|
+
workspace: str,
|
|
434
|
+
fileset: str,
|
|
435
|
+
prefix: str,
|
|
436
|
+
) -> dict[str, list[FileInfo]]:
|
|
437
|
+
"""Parse recursive API response and populate dircache for all directory levels.
|
|
438
|
+
|
|
439
|
+
The API returns a flat list of all files. We build directory listings for
|
|
440
|
+
each level, adding both files and intermediate directory entries.
|
|
441
|
+
|
|
442
|
+
Path format: workspace/fileset#file_path (using # to separate fileset from path)
|
|
443
|
+
"""
|
|
444
|
+
base_path = f"{workspace}/{fileset}"
|
|
445
|
+
# Root is the fileset root or a subdirectory within it
|
|
446
|
+
root = f"{base_path}#{prefix}" if prefix else base_path
|
|
447
|
+
|
|
448
|
+
dir_contents: dict[str, list[FileInfo]] = {root: []}
|
|
449
|
+
seen_subdirs: dict[str, set[str]] = {root: set()}
|
|
450
|
+
|
|
451
|
+
for file_info in response.data:
|
|
452
|
+
file_path = file_info.path.lstrip("/")
|
|
453
|
+
full_path = f"{base_path}#{file_path}"
|
|
454
|
+
|
|
455
|
+
# Add file to its parent directory
|
|
456
|
+
parent = self._parent(full_path)
|
|
457
|
+
if parent not in dir_contents:
|
|
458
|
+
dir_contents[parent] = []
|
|
459
|
+
seen_subdirs[parent] = set()
|
|
460
|
+
dir_contents[parent].append({"name": full_path, "size": file_info.size, "type": "file"})
|
|
461
|
+
|
|
462
|
+
# Add intermediate directories (walk from parent up to root)
|
|
463
|
+
current = parent
|
|
464
|
+
while current != root and len(current) > len(root):
|
|
465
|
+
parent_of_current = self._parent(current)
|
|
466
|
+
if parent_of_current not in dir_contents:
|
|
467
|
+
dir_contents[parent_of_current] = []
|
|
468
|
+
seen_subdirs[parent_of_current] = set()
|
|
469
|
+
# Note: current always has # here because the loop exits when current == root
|
|
470
|
+
subdir_name = current.split("#", 1)[1].rsplit("/", 1)[-1]
|
|
471
|
+
if subdir_name not in seen_subdirs[parent_of_current]:
|
|
472
|
+
seen_subdirs[parent_of_current].add(subdir_name)
|
|
473
|
+
dir_contents[parent_of_current].append({"name": current, "size": 0, "type": "directory"})
|
|
474
|
+
current = parent_of_current
|
|
475
|
+
|
|
476
|
+
if self.dircache.use_listings_cache:
|
|
477
|
+
for path, contents in dir_contents.items():
|
|
478
|
+
self.dircache[path] = contents
|
|
479
|
+
|
|
480
|
+
return dir_contents
|
|
481
|
+
|
|
482
|
+
async def _info(self, path: str, **kwargs) -> FileInfo:
|
|
483
|
+
"""Get file info, using dircache when available.
|
|
484
|
+
|
|
485
|
+
Checks dircache first to avoid redundant API calls. For cache misses,
|
|
486
|
+
uses _ls which populates the cache for all directory levels.
|
|
487
|
+
"""
|
|
488
|
+
_, _, file_path = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
489
|
+
path_key = build_fileset_ref(path)
|
|
490
|
+
parent_path = self._parent(path_key)
|
|
491
|
+
|
|
492
|
+
# Check if this path is a cached directory (we've listed it before)
|
|
493
|
+
if path_key in self.dircache:
|
|
494
|
+
return {"name": path_key, "size": 0, "type": "directory"}
|
|
495
|
+
|
|
496
|
+
# Check if this path exists in its parent's cached listing
|
|
497
|
+
# Skip for fileset root (root is its own parent)
|
|
498
|
+
if parent_path != path_key and parent_path in self.dircache:
|
|
499
|
+
for entry in self.dircache[parent_path]:
|
|
500
|
+
if entry["name"].rstrip("/") == path_key:
|
|
501
|
+
return entry
|
|
502
|
+
# Parent was cached but this path wasn't in it
|
|
503
|
+
raise FileNotFoundError(path)
|
|
504
|
+
|
|
505
|
+
# Cache miss - fetch via _ls which populates cache
|
|
506
|
+
if not file_path:
|
|
507
|
+
# Fileset root - call _ls to populate cache and verify existence
|
|
508
|
+
try:
|
|
509
|
+
await self._ls(path_key, detail=True)
|
|
510
|
+
return {"name": path_key, "size": 0, "type": "directory"}
|
|
511
|
+
except Exception as e:
|
|
512
|
+
raise FileNotFoundError(path) from e
|
|
513
|
+
|
|
514
|
+
# File path - list parent directory (populates cache for siblings too)
|
|
515
|
+
try:
|
|
516
|
+
await self._ls(parent_path, detail=True)
|
|
517
|
+
except Exception as e:
|
|
518
|
+
raise FileNotFoundError(path) from e
|
|
519
|
+
|
|
520
|
+
# Now check cache
|
|
521
|
+
if parent_path in self.dircache:
|
|
522
|
+
for entry in self.dircache[parent_path]:
|
|
523
|
+
if entry["name"].rstrip("/") == path_key:
|
|
524
|
+
return entry
|
|
525
|
+
|
|
526
|
+
raise FileNotFoundError(path)
|
|
527
|
+
|
|
528
|
+
async def _cat_file(self, path: str, start: int | None = None, end: int | None = None, **kwargs) -> bytes:
|
|
529
|
+
"""Fetch file content with optional byte range."""
|
|
530
|
+
workspace, fileset, file_path = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
531
|
+
if not file_path:
|
|
532
|
+
raise IsADirectoryError(path)
|
|
533
|
+
|
|
534
|
+
extra_headers = {}
|
|
535
|
+
if start is not None or end is not None:
|
|
536
|
+
extra_headers["Range"] = f"bytes={start or 0}-{(end - 1) if end else ''}"
|
|
537
|
+
|
|
538
|
+
response = await self._sdk.files._download_file(
|
|
539
|
+
file_path, workspace=workspace, name=fileset, extra_headers=extra_headers or None
|
|
540
|
+
)
|
|
541
|
+
return await response.read()
|
|
542
|
+
|
|
543
|
+
@classmethod
|
|
544
|
+
def _parent(cls, path: str) -> str:
|
|
545
|
+
"""Get the parent directory path, handling the # separator correctly.
|
|
546
|
+
|
|
547
|
+
Override of fsspec's _parent to handle our path format where # separates
|
|
548
|
+
the fileset name from the file path (e.g., workspace/fileset#dir/file.txt).
|
|
549
|
+
The fileset root is its own parent (like / in Unix).
|
|
550
|
+
"""
|
|
551
|
+
workspace, fileset, file_path = parse_fileset_ref(path.rstrip("/"), workspace_fallback=None)
|
|
552
|
+
|
|
553
|
+
fileset_root = f"{workspace}/{fileset}"
|
|
554
|
+
if not file_path:
|
|
555
|
+
return fileset_root # Root is its own parent
|
|
556
|
+
if "/" in file_path:
|
|
557
|
+
return f"{fileset_root}#{file_path.rsplit('/', 1)[0]}"
|
|
558
|
+
return fileset_root
|
|
559
|
+
|
|
560
|
+
async def _ls(self, path: str, detail: bool = True, refresh: bool = False, **kwargs) -> list[FileInfo] | list[str]:
|
|
561
|
+
"""List files in a fileset or directory.
|
|
562
|
+
|
|
563
|
+
Uses dircache to avoid redundant API calls. The cache is populated for
|
|
564
|
+
ALL directory levels found in the API response, so subsequent _ls calls
|
|
565
|
+
for nested paths will hit the cache.
|
|
566
|
+
|
|
567
|
+
Args:
|
|
568
|
+
path: Path to list
|
|
569
|
+
detail: If True, return list of dicts. If False, return list of paths.
|
|
570
|
+
refresh: If True, bypass cache and fetch fresh listing.
|
|
571
|
+
"""
|
|
572
|
+
workspace, fileset, prefix = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
573
|
+
prefix = prefix.rstrip("/")
|
|
574
|
+
path_key = build_fileset_ref(prefix, workspace=workspace, fileset=fileset)
|
|
575
|
+
|
|
576
|
+
# Check cache first (unless refresh requested)
|
|
577
|
+
if self.dircache.use_listings_cache and not refresh:
|
|
578
|
+
try:
|
|
579
|
+
out = self.dircache[path_key]
|
|
580
|
+
return out if detail else [f["name"] for f in out]
|
|
581
|
+
except KeyError:
|
|
582
|
+
pass
|
|
583
|
+
|
|
584
|
+
# Fetch from backend and populate cache for all directory levels
|
|
585
|
+
response = await self._sdk.files._list_files(fileset, workspace=workspace, path=prefix or None)
|
|
586
|
+
dir_contents = self._populate_dircache_from_response(response, workspace, fileset, prefix)
|
|
587
|
+
|
|
588
|
+
# Return the listing for the requested path
|
|
589
|
+
result = dir_contents.get(path_key, [])
|
|
590
|
+
return result if detail else [f["name"] for f in result]
|
|
591
|
+
|
|
592
|
+
async def _rm_file(self, path: str, **kwargs) -> None:
|
|
593
|
+
"""Delete a single file."""
|
|
594
|
+
workspace, fileset, file_path = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
595
|
+
if not file_path:
|
|
596
|
+
raise ValueError("Cannot delete fileset root via rm")
|
|
597
|
+
await self._sdk.files._delete_file(file_path, workspace=workspace, name=fileset)
|
|
598
|
+
# Invalidate parent directory's cache since file info is stored there
|
|
599
|
+
self.invalidate_cache(self._parent(build_fileset_ref(path)))
|
|
600
|
+
|
|
601
|
+
async def _pipe_file(self, path: str, value: bytes, **kwargs) -> None:
|
|
602
|
+
"""Write bytes to a file."""
|
|
603
|
+
workspace, fileset, file_path = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
604
|
+
if not file_path:
|
|
605
|
+
raise ValueError("File path required for upload")
|
|
606
|
+
await self._sdk.files._upload_file(file_path, body=value, workspace=workspace, name=fileset)
|
|
607
|
+
# Invalidate parent directory's cache since file info is stored there
|
|
608
|
+
self.invalidate_cache(self._parent(build_fileset_ref(path)))
|
|
609
|
+
|
|
610
|
+
async def _pipe_stream(
|
|
611
|
+
self,
|
|
612
|
+
path: str,
|
|
613
|
+
stream: AsyncIterator[bytes] | Iterator[bytes],
|
|
614
|
+
content_length: int | None = None,
|
|
615
|
+
) -> None:
|
|
616
|
+
"""Write a stream to a file.
|
|
617
|
+
|
|
618
|
+
Uses httpx streaming upload to avoid buffering the entire content in memory.
|
|
619
|
+
If content_length is not provided, uses chunked transfer encoding.
|
|
620
|
+
|
|
621
|
+
Accepts both sync and async iterators. Sync iterators are wrapped as async
|
|
622
|
+
because httpx's AsyncClient requires async iterators for streaming content.
|
|
623
|
+
|
|
624
|
+
Args:
|
|
625
|
+
path: Fileset path in format workspace/fileset#file_path
|
|
626
|
+
stream: Sync or async iterator yielding byte chunks
|
|
627
|
+
content_length: Optional content length for Content-Length header.
|
|
628
|
+
If not provided, uses chunked transfer encoding.
|
|
629
|
+
"""
|
|
630
|
+
workspace, fileset, file_path = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
631
|
+
if not file_path:
|
|
632
|
+
raise ValueError("File path required for upload")
|
|
633
|
+
|
|
634
|
+
# httpx AsyncClient requires async iterators for streaming content.
|
|
635
|
+
if not hasattr(stream, "__anext__"):
|
|
636
|
+
stream = to_async_iterator(stream)
|
|
637
|
+
|
|
638
|
+
extra_headers = {"Content-Length": str(content_length)} if content_length is not None else None
|
|
639
|
+
|
|
640
|
+
await self._sdk.files._upload_file(
|
|
641
|
+
path=file_path,
|
|
642
|
+
body=stream,
|
|
643
|
+
workspace=workspace,
|
|
644
|
+
name=fileset,
|
|
645
|
+
extra_headers=extra_headers,
|
|
646
|
+
)
|
|
647
|
+
|
|
648
|
+
# Invalidate parent directory's cache since file info is stored there
|
|
649
|
+
self.invalidate_cache(self._parent(build_fileset_ref(path)))
|
|
650
|
+
|
|
651
|
+
def pipe_stream(
|
|
652
|
+
self,
|
|
653
|
+
path: str,
|
|
654
|
+
stream: AsyncIterator[bytes] | Iterator[bytes],
|
|
655
|
+
content_length: int | None = None,
|
|
656
|
+
) -> None:
|
|
657
|
+
"""Sync wrapper for _pipe_stream. See _pipe_stream for details."""
|
|
658
|
+
return fsspec.asyn.sync(self.loop, self._pipe_stream, path, stream, content_length)
|
|
659
|
+
|
|
660
|
+
async def _put_file(self, lpath: str, rpath: str, callback: Callback = DEFAULT_CALLBACK, **kwargs) -> None:
|
|
661
|
+
"""Upload a local file to a fileset.
|
|
662
|
+
|
|
663
|
+
Uses streaming upload to avoid buffering the entire file in memory.
|
|
664
|
+
Supports per-chunk progress via callback.relative_update(chunk_size).
|
|
665
|
+
"""
|
|
666
|
+
workspace, fileset, file_path = parse_fileset_ref(rpath, workspace_fallback=self._sdk.workspace)
|
|
667
|
+
if not file_path:
|
|
668
|
+
raise ValueError("File path required for upload")
|
|
669
|
+
|
|
670
|
+
# Get file size for callback and Content-Length header
|
|
671
|
+
file_size = (await anyio.Path(lpath).stat()).st_size
|
|
672
|
+
callback.set_size(file_size)
|
|
673
|
+
|
|
674
|
+
# Create async generator that streams file content with progress
|
|
675
|
+
async def stream_file():
|
|
676
|
+
async with await anyio.open_file(lpath, "rb") as f:
|
|
677
|
+
while chunk := await f.read(self.blocksize):
|
|
678
|
+
callback.relative_update(len(chunk))
|
|
679
|
+
yield chunk
|
|
680
|
+
|
|
681
|
+
await self._sdk.files._upload_file(
|
|
682
|
+
path=file_path,
|
|
683
|
+
body=stream_file(),
|
|
684
|
+
workspace=workspace,
|
|
685
|
+
name=fileset,
|
|
686
|
+
extra_headers={"Content-Length": str(file_size)},
|
|
687
|
+
)
|
|
688
|
+
# Invalidate parent directory's cache since file info is stored there
|
|
689
|
+
self.invalidate_cache(self._parent(build_fileset_ref(rpath)))
|
|
690
|
+
|
|
691
|
+
@overload
|
|
692
|
+
async def _find(
|
|
693
|
+
self, path: str, maxdepth: int | None = None, withdirs: bool = False, detail: Literal[False] = ..., **kwargs
|
|
694
|
+
) -> list[str]: ...
|
|
695
|
+
|
|
696
|
+
@overload
|
|
697
|
+
async def _find(
|
|
698
|
+
self, path: str, maxdepth: int | None = None, withdirs: bool = False, detail: Literal[True] = ..., **kwargs
|
|
699
|
+
) -> dict[str, FileInfo]: ...
|
|
700
|
+
|
|
701
|
+
async def _find(
|
|
702
|
+
self, path: str, maxdepth: int | None = None, withdirs: bool = False, detail: bool = False, **kwargs
|
|
703
|
+
) -> dict[str, FileInfo] | list[str]:
|
|
704
|
+
"""Find all files under path using a single recursive listing.
|
|
705
|
+
|
|
706
|
+
Also populates the dircache so subsequent _ls calls benefit.
|
|
707
|
+
"""
|
|
708
|
+
workspace, fileset, prefix = parse_fileset_ref(path, workspace_fallback=self._sdk.workspace)
|
|
709
|
+
prefix = prefix.rstrip("/")
|
|
710
|
+
response = await self._sdk.files._list_files(fileset, workspace=workspace, path=prefix or None)
|
|
711
|
+
|
|
712
|
+
# Populate dircache for all directory levels (benefits subsequent _ls calls)
|
|
713
|
+
self._populate_dircache_from_response(response, workspace, fileset, prefix)
|
|
714
|
+
|
|
715
|
+
# Build the flat output dict
|
|
716
|
+
out = {}
|
|
717
|
+
seen_dirs: set[str] = set()
|
|
718
|
+
|
|
719
|
+
# Add root path if withdirs requested
|
|
720
|
+
if withdirs:
|
|
721
|
+
root_path = build_fileset_ref(path, workspace=self._sdk.workspace)
|
|
722
|
+
out[root_path] = {"name": root_path, "size": 0, "type": "directory"}
|
|
723
|
+
|
|
724
|
+
for file_info in response.data:
|
|
725
|
+
file_path = file_info.path.lstrip("/")
|
|
726
|
+
full_path = f"{workspace}/{fileset}#{file_path}"
|
|
727
|
+
out[full_path] = {"name": full_path, "size": file_info.size, "type": "file"}
|
|
728
|
+
|
|
729
|
+
# Add parent directories if withdirs requested
|
|
730
|
+
if withdirs:
|
|
731
|
+
parts = file_path.split("/")
|
|
732
|
+
for i in range(1, len(parts)):
|
|
733
|
+
dir_path = "/".join(parts[:i])
|
|
734
|
+
full_dir_path = f"{workspace}/{fileset}#{dir_path}"
|
|
735
|
+
if full_dir_path not in seen_dirs:
|
|
736
|
+
seen_dirs.add(full_dir_path)
|
|
737
|
+
out[full_dir_path] = {
|
|
738
|
+
"name": full_dir_path,
|
|
739
|
+
"size": 0,
|
|
740
|
+
"type": "directory",
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
names = sorted(out)
|
|
744
|
+
if detail:
|
|
745
|
+
return {name: out[name] for name in names}
|
|
746
|
+
return names
|
|
747
|
+
|
|
748
|
+
async def _get_file(self, rpath: str, lpath: str, callback: Callback = DEFAULT_CALLBACK, **kwargs) -> None:
|
|
749
|
+
"""Download a file to local path.
|
|
750
|
+
|
|
751
|
+
Uses with_streaming_response to avoid buffering the entire response in memory.
|
|
752
|
+
Uses http_response.aiter_raw() for maximum throughput (bypasses httpx chunking overhead).
|
|
753
|
+
Supports per-chunk progress via callback.relative_update(chunk_size).
|
|
754
|
+
"""
|
|
755
|
+
workspace, fileset, file_path = parse_fileset_ref(rpath, workspace_fallback=self._sdk.workspace)
|
|
756
|
+
|
|
757
|
+
if not file_path:
|
|
758
|
+
return
|
|
759
|
+
|
|
760
|
+
# Use with_streaming_response to not buffer the data in memory.
|
|
761
|
+
async with self._sdk.files.with_streaming_response._download_file(
|
|
762
|
+
file_path, workspace=workspace, name=fileset
|
|
763
|
+
) as response:
|
|
764
|
+
# Set callback size from Content-Length if available
|
|
765
|
+
content_length = response.headers.get("content-length")
|
|
766
|
+
if content_length:
|
|
767
|
+
callback.set_size(int(content_length))
|
|
768
|
+
|
|
769
|
+
await anyio.Path(lpath).parent.mkdir(parents=True, exist_ok=True)
|
|
770
|
+
async with await anyio.open_file(lpath, "wb") as f:
|
|
771
|
+
# Use aiter_raw() instead of iter_bytes() to bypass httpx chunking overhead.
|
|
772
|
+
async for chunk in response.http_response.aiter_raw(self.blocksize):
|
|
773
|
+
await f.write(chunk)
|
|
774
|
+
callback.relative_update(len(chunk))
|
|
775
|
+
|
|
776
|
+
async def _get(
|
|
777
|
+
self,
|
|
778
|
+
rpath: str | list[str],
|
|
779
|
+
lpath: str | list[str],
|
|
780
|
+
recursive: bool = True,
|
|
781
|
+
callback: Callback = DEFAULT_CALLBACK,
|
|
782
|
+
maxdepth: int | None = None,
|
|
783
|
+
batch_size: int | None = None,
|
|
784
|
+
**kwargs,
|
|
785
|
+
) -> None:
|
|
786
|
+
"""Download files using a single _find call for efficiency.
|
|
787
|
+
|
|
788
|
+
Uses run_coros_in_chunks which provides proper task cancellation
|
|
789
|
+
via our monkey-patched TaskGroup-based implementation.
|
|
790
|
+
|
|
791
|
+
When rpath and lpath are both lists, downloads each (remote, local) pair
|
|
792
|
+
directly without path expansion. This is useful for downloading a specific
|
|
793
|
+
set of files (e.g., from glob expansion in the SDK layer).
|
|
794
|
+
"""
|
|
795
|
+
# Handle list inputs (pre-expanded paths from SDK layer)
|
|
796
|
+
if isinstance(rpath, list) and isinstance(lpath, list):
|
|
797
|
+
if not rpath:
|
|
798
|
+
return
|
|
799
|
+
callback.set_size(len(rpath))
|
|
800
|
+
get_file_with_callback = callback.branch_coro(self._get_file)
|
|
801
|
+
await run_coros_in_chunks(
|
|
802
|
+
[get_file_with_callback(remote, local, **kwargs) for remote, local in zip(rpath, lpath)],
|
|
803
|
+
batch_size=batch_size or self.batch_size,
|
|
804
|
+
callback=callback,
|
|
805
|
+
)
|
|
806
|
+
return
|
|
807
|
+
|
|
808
|
+
source_files = await self._find(rpath, maxdepth=maxdepth, withdirs=False)
|
|
809
|
+
if not source_files:
|
|
810
|
+
return
|
|
811
|
+
|
|
812
|
+
# Normalize rpath to new format for comparison (since _find returns new format paths)
|
|
813
|
+
rpath_normalized = build_fileset_ref(rpath, workspace=self._sdk.workspace).rstrip("/")
|
|
814
|
+
lpath_stripped = lpath.rstrip("/")
|
|
815
|
+
source_is_file = len(source_files) == 1 and self._strip_protocol(source_files[0]) == rpath_normalized
|
|
816
|
+
|
|
817
|
+
# Single file download
|
|
818
|
+
if source_is_file:
|
|
819
|
+
source = source_files[0]
|
|
820
|
+
# For single file: check if dest is a directory (trailing slash or existing dir)
|
|
821
|
+
dest_is_dir = lpath.endswith("/") or await anyio.Path(lpath).is_dir()
|
|
822
|
+
if dest_is_dir:
|
|
823
|
+
# lpath="foo/" or existing dir - put file inside directory with original name
|
|
824
|
+
# Extract filename from the file path portion (after #)
|
|
825
|
+
_, _, source_file_path = parse_fileset_ref(source, workspace_fallback=None)
|
|
826
|
+
filename = source_file_path.rsplit("/", 1)[-1]
|
|
827
|
+
dest = f"{lpath_stripped}/{filename}"
|
|
828
|
+
else:
|
|
829
|
+
# lpath="foo" - save as this exact path
|
|
830
|
+
dest = lpath_stripped
|
|
831
|
+
|
|
832
|
+
callback.set_size(1)
|
|
833
|
+
get_file_with_callback = callback.branch_coro(self._get_file)
|
|
834
|
+
await get_file_with_callback(source, dest, **kwargs)
|
|
835
|
+
return
|
|
836
|
+
|
|
837
|
+
# Directory download - multiple files
|
|
838
|
+
# Trailing slash on SOURCE controls whether to preserve source dir name:
|
|
839
|
+
# - "source#subdir/" -> copy contents directly into dest
|
|
840
|
+
# - "source#subdir" -> create dest/subdir/ and copy contents there
|
|
841
|
+
#
|
|
842
|
+
# SPECIAL CASE: Fileset root (workspace/fileset with no file path) always
|
|
843
|
+
# copies contents directly, matching HuggingFace Hub behavior. Users who want
|
|
844
|
+
# to preserve the fileset name can include it in local_path.
|
|
845
|
+
_, _, file_path = parse_fileset_ref(rpath, workspace_fallback=self._sdk.workspace)
|
|
846
|
+
copy_contents_directly = rpath.endswith("/") or not file_path
|
|
847
|
+
|
|
848
|
+
# Extract directory name from the file path portion (e.g., "subdir" from "a/b/subdir")
|
|
849
|
+
source_name = file_path.rsplit("/", 1)[-1] if file_path else ""
|
|
850
|
+
|
|
851
|
+
file_pairs = []
|
|
852
|
+
for source in source_files:
|
|
853
|
+
source_stripped = self._strip_protocol(source)
|
|
854
|
+
# Strip rpath_normalized and any separator (# for root, / for subdirs)
|
|
855
|
+
relative = source_stripped[len(rpath_normalized) :].lstrip("#/")
|
|
856
|
+
|
|
857
|
+
if copy_contents_directly:
|
|
858
|
+
# Source has trailing slash OR is fileset root: copy contents directly
|
|
859
|
+
dest = f"{lpath_stripped}/{relative}"
|
|
860
|
+
else:
|
|
861
|
+
# Source has no trailing slash: preserve source directory name
|
|
862
|
+
dest = f"{lpath_stripped}/{source_name}/{relative}"
|
|
863
|
+
|
|
864
|
+
file_pairs.append((source, dest))
|
|
865
|
+
|
|
866
|
+
callback.set_size(len(file_pairs))
|
|
867
|
+
get_file_with_callback = callback.branch_coro(self._get_file)
|
|
868
|
+
await run_coros_in_chunks(
|
|
869
|
+
[get_file_with_callback(src, dst, **kwargs) for src, dst in file_pairs],
|
|
870
|
+
batch_size=batch_size or self.batch_size,
|
|
871
|
+
callback=callback,
|
|
872
|
+
)
|
|
873
|
+
|
|
874
|
+
def _open(
|
|
875
|
+
self,
|
|
876
|
+
path: str,
|
|
877
|
+
mode: str = "rb",
|
|
878
|
+
block_size: int | None = None,
|
|
879
|
+
autocommit: bool = True,
|
|
880
|
+
cache_options: dict | None = None,
|
|
881
|
+
**kwargs,
|
|
882
|
+
) -> FilesetFile:
|
|
883
|
+
"""Open a file for reading or writing (sync)."""
|
|
884
|
+
return FilesetFile(
|
|
885
|
+
self,
|
|
886
|
+
path,
|
|
887
|
+
mode=mode,
|
|
888
|
+
block_size=block_size or self.blocksize,
|
|
889
|
+
autocommit=autocommit,
|
|
890
|
+
cache_options=cache_options,
|
|
891
|
+
**kwargs,
|
|
892
|
+
)
|
|
893
|
+
|
|
894
|
+
async def open_async(
|
|
895
|
+
self,
|
|
896
|
+
path: str,
|
|
897
|
+
mode: str = "rb",
|
|
898
|
+
block_size: int | None = None,
|
|
899
|
+
**kwargs,
|
|
900
|
+
) -> AsyncFilesetFile:
|
|
901
|
+
"""Open a file for reading or writing (async)."""
|
|
902
|
+
if "b" not in mode:
|
|
903
|
+
raise ValueError("Only binary mode is supported for async open")
|
|
904
|
+
return AsyncFilesetFile(self, path, mode=mode, block_size=block_size or self.blocksize, **kwargs)
|
|
905
|
+
|
|
906
|
+
|
|
907
|
+
class FilesetFile(AbstractBufferedFile):
|
|
908
|
+
"""Buffered file for sync reads and writes."""
|
|
909
|
+
|
|
910
|
+
def _upload_chunk(self, final: bool = False) -> bool:
|
|
911
|
+
"""Upload buffer contents on final flush."""
|
|
912
|
+
if final:
|
|
913
|
+
self.fs.pipe_file(self.path, self.buffer.getvalue())
|
|
914
|
+
return True
|
|
915
|
+
|
|
916
|
+
|
|
917
|
+
class AsyncFilesetFile(AbstractAsyncStreamedFile):
|
|
918
|
+
"""Async streamed file for async reads and writes."""
|
|
919
|
+
|
|
920
|
+
async def _fetch_range(self, start: int, end: int) -> bytes:
|
|
921
|
+
return await self.fs._cat_file(self.path, start=start, end=end)
|
|
922
|
+
|
|
923
|
+
async def _upload_chunk(self, final: bool = False) -> bool:
|
|
924
|
+
"""Upload buffer contents on final flush."""
|
|
925
|
+
if final:
|
|
926
|
+
await self.fs._pipe_file(self.path, self.buffer.getvalue())
|
|
927
|
+
return True
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
async def to_async_iterator(it: Iterator[bytes]) -> AsyncIterator[bytes]:
|
|
931
|
+
"""Convert a sync iterator to an async iterator without blocking the event loop.
|
|
932
|
+
|
|
933
|
+
Runs each next() call in a thread pool so slow/large iterators don't block.
|
|
934
|
+
"""
|
|
935
|
+
sentinel = object()
|
|
936
|
+
while True:
|
|
937
|
+
chunk = await to_thread.run_sync(next, it, sentinel)
|
|
938
|
+
if chunk is sentinel:
|
|
939
|
+
return
|
|
940
|
+
yield chunk
|