From 53cd84085114f49e01a034fd732ab65e22acbe75 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Thu, 3 Apr 2025 15:58:48 -0700 Subject: [PATCH] Re-emit from TypeSpec. Fix deployment samples --- .../apiview-properties.json | 69 --- .../CHANGELOG.md | 0 .../LICENSE | 0 .../MANIFEST.in | 2 +- .../README.md | 42 +- .../apiview-properties.json | 69 +++ .../azure/__init__.py | 0 .../azure/ai/__init__.py | 0 .../azure/ai/projects}/__init__.py | 0 .../azure/ai/projects/onedp}/__init__.py | 0 .../azure/ai/projects/onedp}/_client.py | 18 +- .../ai/projects/onedp}/_configuration.py | 2 +- .../azure/ai/projects/onedp}/_model_base.py | 0 .../azure/ai/projects/onedp}/_patch.py | 0 .../ai/projects/onedp}/_serialization.py | 0 .../azure/ai/projects/onedp}/_types.py | 0 .../azure/ai/projects/onedp}/_validation.py | 0 .../azure/ai/projects/onedp}/_vendor.py | 0 .../azure/ai/projects/onedp}/_version.py | 0 .../azure/ai/projects/onedp}/aio/__init__.py | 0 .../azure/ai/projects/onedp}/aio/_client.py | 18 +- .../ai/projects/onedp}/aio/_configuration.py | 2 +- .../azure/ai/projects/onedp}/aio/_patch.py | 0 .../azure/ai/projects/onedp}/aio/_vendor.py | 0 .../onedp}/aio/operations/__init__.py | 2 + .../onedp}/aio/operations/_operations.py | 526 +++++++++-------- .../projects/onedp}/aio/operations/_patch.py | 27 +- .../ai/projects/onedp}/models/__init__.py | 0 .../azure/ai/projects/onedp}/models/_enums.py | 0 .../ai/projects/onedp}/models/_models.py | 45 +- .../azure/ai/projects/onedp}/models/_patch.py | 0 .../ai/projects/onedp}/operations/__init__.py | 2 + .../projects/onedp}/operations/_operations.py | 538 ++++++++++-------- .../ai/projects/onedp}/operations/_patch.py | 19 +- .../azure/ai/projects/onedp}/py.typed | 0 .../onedp/servicepatterns}/__init__.py | 0 .../onedp/servicepatterns/aio}/__init__.py | 0 .../aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 0 .../servicepatterns/aio/operations/_patch.py | 0 .../buildingblocks}/__init__.py | 0 .../buildingblocks/aio/__init__.py | 1 + .../buildingblocks/aio/operations/__init__.py | 0 .../aio/operations/_operations.py | 0 .../buildingblocks/aio/operations/_patch.py | 0 .../buildingblocks/operations/__init__.py | 0 .../buildingblocks/operations/_operations.py | 0 .../buildingblocks/operations/_patch.py | 0 .../servicepatterns/operations/__init__.py | 0 .../servicepatterns/operations/_operations.py | 0 .../servicepatterns/operations/_patch.py | 0 .../dev_requirements.txt | 0 .../generated_tests/conftest.py | 35 ++ .../test_ai_project_connections_operations.py | 33 ++ ...ai_project_connections_operations_async.py | 34 ++ .../test_ai_project_datasets_operations.py | 129 +++++ ...st_ai_project_datasets_operations_async.py | 130 +++++ .../test_ai_project_deployments_operations.py | 33 ++ ...ai_project_deployments_operations_async.py | 34 ++ ...i_project_evaluation_results_operations.py | 125 ++++ ...ect_evaluation_results_operations_async.py | 126 ++++ .../test_ai_project_evaluations_operations.py | 54 ++ ...ai_project_evaluations_operations_async.py | 55 ++ .../test_ai_project_indexes_operations.py | 102 ++++ ...est_ai_project_indexes_operations_async.py | 103 ++++ .../test_ai_project_red_teams_operations.py | 56 ++ ...t_ai_project_red_teams_operations_async.py | 57 ++ .../generated_tests/testpreparer.py | 26 + .../generated_tests/testpreparer_async.py | 20 + .../pyproject.toml | 0 .../pyrightconfig.json | 0 .../samples/connections/sample_connections.py | 11 +- .../connections/sample_connections_async.py | 11 +- .../samples/datasets/sample_datasets.py | 4 +- .../samples/datasets/sample_datasets_async.py | 4 +- .../datasets/sample_folder/sample_file1.txt | 0 .../datasets/sample_folder/sample_file2.txt | 0 .../sample_subfolder1/sample_file3.txt | 0 .../sample_subfolder1/sample_file4.txt | 0 .../sample_subfolder2/sample_file5.txt | 0 .../sample_subfolder2/sample_file6.txt | 0 .../sample_subfolder2/sample_file7.txt | 0 .../sample_folder3/sample_file8.txt | 0 .../samples/deployments/sample_deployments.py | 11 +- .../deployments/sample_deployments_async.py | 6 +- .../samples/indexes/sample_indexes.py | 2 +- .../samples/indexes/sample_indexes_async.py | 2 +- .../setup.py | 4 +- .../tsp-location.yaml | 2 +- 89 files changed, 1909 insertions(+), 682 deletions(-) delete mode 100644 sdk/ai/azure-ai-projects-dp1/apiview-properties.json rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/CHANGELOG.md (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/LICENSE (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/MANIFEST.in (82%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/README.md (92%) create mode 100644 sdk/ai/azure-ai-projects-onedp/apiview-properties.json rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/azure/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/azure/ai/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects/servicepatterns => azure-ai-projects-onedp/azure/ai/projects}/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_client.py (90%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_configuration.py (97%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_model_base.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_serialization.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_types.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_validation.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_vendor.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/_version.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/_client.py (89%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/_configuration.py (97%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/_vendor.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/operations/__init__.py (93%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/operations/_operations.py (88%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/aio/operations/_patch.py (93%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/models/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/models/_enums.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/models/_models.py (96%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/models/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/operations/__init__.py (93%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/operations/_operations.py (90%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/operations/_patch.py (95%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/py.typed (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio => azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns}/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks => azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio}/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/aio/operations/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/aio/operations/_operations.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/aio/operations/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio => azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks}/__init__.py (100%) create mode 100644 sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/__init__.py rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/buildingblocks/aio/operations/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/buildingblocks/aio/operations/_operations.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/buildingblocks/aio/operations/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/buildingblocks/operations/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/buildingblocks/operations/_operations.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/buildingblocks/operations/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/operations/__init__.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/operations/_operations.py (100%) rename sdk/ai/{azure-ai-projects-dp1/azure/ai/projects => azure-ai-projects-onedp/azure/ai/projects/onedp}/servicepatterns/operations/_patch.py (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/dev_requirements.txt (100%) create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/conftest.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations_async.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer.py create mode 100644 sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer_async.py rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/pyproject.toml (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/pyrightconfig.json (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/connections/sample_connections.py (83%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/connections/sample_connections_async.py (84%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_datasets.py (95%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_datasets_async.py (96%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_file1.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_file2.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_subfolder1/sample_file3.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_subfolder1/sample_file4.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_subfolder2/sample_file5.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_subfolder2/sample_file6.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_subfolder2/sample_file7.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/datasets/sample_folder/sample_subfolder2/sample_folder3/sample_file8.txt (100%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/deployments/sample_deployments.py (81%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/deployments/sample_deployments_async.py (89%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/indexes/sample_indexes.py (96%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/samples/indexes/sample_indexes_async.py (97%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/setup.py (96%) rename sdk/ai/{azure-ai-projects-dp1 => azure-ai-projects-onedp}/tsp-location.yaml (67%) diff --git a/sdk/ai/azure-ai-projects-dp1/apiview-properties.json b/sdk/ai/azure-ai-projects-dp1/apiview-properties.json deleted file mode 100644 index fe5036ab921f..000000000000 --- a/sdk/ai/azure-ai-projects-dp1/apiview-properties.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "CrossLanguagePackageId": "Azure.AI.Projects", - "CrossLanguageDefinitionId": { - "azure.ai.projects.models.Index": "Azure.AI.Projects.Index", - "azure.ai.projects.models.AzureAISearchIndex": "Azure.AI.Projects.AzureAISearchIndex", - "azure.ai.projects.models.BlobReferenceForConsumption": "Azure.AI.Projects.BlobReferenceForConsumption", - "azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection", - "azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex", - "azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", - "azure.ai.projects.models.Deployment": "Azure.AI.Projects.Deployment", - "azure.ai.projects.models.EmbeddingConfiguration": "Azure.AI.Projects.EmbeddingConfiguration", - "azure.ai.projects.models.Evaluation": "Azure.AI.Projects.Evaluation", - "azure.ai.projects.models.EvaluationResult": "Azure.AI.Projects.EvaluationResult", - "azure.ai.projects.models.EvaluatorConfiguration": "Azure.AI.Projects.EvaluatorConfiguration", - "azure.ai.projects.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion", - "azure.ai.projects.models.FolderDatasetVersion": "Azure.AI.Projects.FolderDatasetVersion", - "azure.ai.projects.models.InputData": "Azure.AI.Projects.InputData", - "azure.ai.projects.models.InputDataset": "Azure.AI.Projects.InputDataset", - "azure.ai.projects.models.ManagedAzureAISearchIndex": "Azure.AI.Projects.ManagedAzureAISearchIndex", - "azure.ai.projects.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment", - "azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", - "azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", - "azure.ai.projects.models.RedTeam": "Azure.AI.Projects.RedTeam", - "azure.ai.projects.models.SasCredential": "Azure.AI.Projects.SasCredential", - "azure.ai.projects.models.Sku": "Azure.AI.Projects.Sku", - "azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType", - "azure.ai.projects.models.AuthenticationType": "Azure.AI.Projects.AuthenticationType", - "azure.ai.projects.models.DatasetType": "Azure.AI.Projects.DatasetType", - "azure.ai.projects.models.ListViewType": "Azure.AI.Projects.ListViewType", - "azure.ai.projects.models.RepeatabilityResult": "Azure.Core.RepeatabilityResult", - "azure.ai.projects.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType", - "azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType", - "azure.ai.projects.models.DeploymentType": "Azure.AI.Projects.DeploymentType", - "azure.ai.projects.models.ResultType": "Azure.AI.Projects.ResultType", - "azure.ai.projects.models.AttackStrategy": "Azure.AI.Projects.AttackStrategy", - "azure.ai.projects.models.RiskCategory": "Azure.AI.Projects.RiskCategory", - "azure.ai.projects.AIProjectClient.connections.get": "Azure.AI.Projects.Connections.get", - "azure.ai.projects.AIProjectClient.connections.list": "Azure.AI.Projects.Connections.list", - "azure.ai.projects.AIProjectClient.evaluations.get": "Azure.AI.Projects.Evaluations.get", - "azure.ai.projects.AIProjectClient.evaluations.list": "Azure.AI.Projects.Evaluations.list", - "azure.ai.projects.AIProjectClient.evaluations.create_run": "Azure.AI.Projects.Evaluations.createRun", - "azure.ai.projects.AIProjectClient.datasets.list_versions": "Azure.AI.Projects.ServicePatterns.Datasets.listVersions", - "azure.ai.projects.AIProjectClient.datasets.list_latest": "Azure.AI.Projects.ServicePatterns.Datasets.listLatest", - "azure.ai.projects.AIProjectClient.datasets.get_version": "Azure.AI.Projects.ServicePatterns.Datasets.getVersion", - "azure.ai.projects.AIProjectClient.datasets.delete_version": "Azure.AI.Projects.ServicePatterns.Datasets.deleteVersion", - "azure.ai.projects.AIProjectClient.datasets.create": "Azure.AI.Projects.ServicePatterns.Datasets.create", - "azure.ai.projects.AIProjectClient.datasets.create_version": "Azure.AI.Projects.ServicePatterns.Datasets.createVersion", - "azure.ai.projects.AIProjectClient.datasets.start_pending_upload_version": "Azure.AI.Projects.Datasets.startPendingUploadVersion", - "azure.ai.projects.AIProjectClient.datasets.start_pending_upload": "Azure.AI.Projects.Datasets.startPendingUpload", - "azure.ai.projects.AIProjectClient.indexes.list_versions": "Azure.AI.Projects.ServicePatterns.Indexes.listVersions", - "azure.ai.projects.AIProjectClient.indexes.list_latest": "Azure.AI.Projects.ServicePatterns.Indexes.listLatest", - "azure.ai.projects.AIProjectClient.indexes.get_version": "Azure.AI.Projects.ServicePatterns.Indexes.getVersion", - "azure.ai.projects.AIProjectClient.indexes.delete_version": "Azure.AI.Projects.ServicePatterns.Indexes.deleteVersion", - "azure.ai.projects.AIProjectClient.indexes.create": "Azure.AI.Projects.ServicePatterns.Indexes.create", - "azure.ai.projects.AIProjectClient.indexes.create_version": "Azure.AI.Projects.ServicePatterns.Indexes.createVersion", - "azure.ai.projects.AIProjectClient.deployments.get": "Azure.AI.Projects.Deployments.get", - "azure.ai.projects.AIProjectClient.deployments.list": "Azure.AI.Projects.Deployments.list", - "azure.ai.projects.AIProjectClient.evaluation_results.list_versions": "Azure.AI.Projects.ServicePatterns.EvaluationResults.listVersions", - "azure.ai.projects.AIProjectClient.evaluation_results.list_latest": "Azure.AI.Projects.ServicePatterns.EvaluationResults.listLatest", - "azure.ai.projects.AIProjectClient.evaluation_results.get_version": "Azure.AI.Projects.ServicePatterns.EvaluationResults.getVersion", - "azure.ai.projects.AIProjectClient.evaluation_results.delete_version": "Azure.AI.Projects.ServicePatterns.EvaluationResults.deleteVersion", - "azure.ai.projects.AIProjectClient.evaluation_results.create": "Azure.AI.Projects.ServicePatterns.EvaluationResults.create", - "azure.ai.projects.AIProjectClient.evaluation_results.create_version": "Azure.AI.Projects.ServicePatterns.EvaluationResults.createVersion", - "azure.ai.projects.AIProjectClient.evaluation_results.start_pending_upload": "Azure.AI.Projects.EvaluationResults.startPendingUpload", - "azure.ai.projects.AIProjectClient.red_teams.get": "Azure.AI.Projects.RedTeams.get", - "azure.ai.projects.AIProjectClient.red_teams.list": "Azure.AI.Projects.RedTeams.list", - "azure.ai.projects.AIProjectClient.red_teams.create_run": "Azure.AI.Projects.RedTeams.createRun" - } -} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects-dp1/CHANGELOG.md b/sdk/ai/azure-ai-projects-onedp/CHANGELOG.md similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/CHANGELOG.md rename to sdk/ai/azure-ai-projects-onedp/CHANGELOG.md diff --git a/sdk/ai/azure-ai-projects-dp1/LICENSE b/sdk/ai/azure-ai-projects-onedp/LICENSE similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/LICENSE rename to sdk/ai/azure-ai-projects-onedp/LICENSE diff --git a/sdk/ai/azure-ai-projects-dp1/MANIFEST.in b/sdk/ai/azure-ai-projects-onedp/MANIFEST.in similarity index 82% rename from sdk/ai/azure-ai-projects-dp1/MANIFEST.in rename to sdk/ai/azure-ai-projects-onedp/MANIFEST.in index 3e3aa464d91d..532c97cd5f48 100644 --- a/sdk/ai/azure-ai-projects-dp1/MANIFEST.in +++ b/sdk/ai/azure-ai-projects-onedp/MANIFEST.in @@ -1,6 +1,6 @@ include *.md include LICENSE -include azure/ai/projects/dp1/py.typed +include azure/ai/projects/onedp/py.typed recursive-include tests *.py recursive-include samples *.py *.md include azure/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/README.md b/sdk/ai/azure-ai-projects-onedp/README.md similarity index 92% rename from sdk/ai/azure-ai-projects-dp1/README.md rename to sdk/ai/azure-ai-projects-onedp/README.md index b24986ee95ed..e30856658be6 100644 --- a/sdk/ai/azure-ai-projects-dp1/README.md +++ b/sdk/ai/azure-ai-projects-onedp/README.md @@ -65,11 +65,8 @@ To report an issue with the client library, or request additional features, plea - Python 3.8 or later. - An [Azure subscription][azure_sub]. - A [project in Azure AI Foundry](https://learn.microsoft.com/azure/ai-studio/how-to/create-projects). -- The project endpoint URL, of the form `https://.??.??.??/api/projects/`. It can be found in your Azure AI Foundry project overview page, under "Project details". Below we will assume the environment variable `PROJECT_ENDPOINT` was defined to hold this value. -- Either an Entra ID token or an API key is needed to authenticate the client. -- For API key authentication, find your key in your Azure AI Foundry project overview page, under "Project details". Below we will assume the -environment variable `PROJECT_API_KEY` was defined to hold this value. -- For Entra ID authentication, your application needs an object that implements the [TokenCredential](https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential) interface. Code samples here use [DefaultAzureCredential](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential). To get that working, you will need: +- The project endpoint URL, of the form `https://.services.ai.azure.com/api/projects/`. It can be found in your Azure AI Foundry project overview page, under "Project details". Below we will assume the environment variable `PROJECT_ENDPOINT` was defined to hold this value. +- An Entra ID token for authentication. Your application needs an object that implements the [TokenCredential](https://learn.microsoft.com/python/api/azure-core/azure.core.credentials.tokencredential) interface. Code samples here use [DefaultAzureCredential](https://learn.microsoft.com/python/api/azure-identity/azure.identity.defaultazurecredential). To get that working, you will need: * An appropriate role assignment. see [Role-based access control in Azure AI Foundry portal](https://learn.microsoft.com/azure/ai-foundry/concepts/rbac-ai-foundry). Role assigned can be done via the "Access Control (IAM)" tab of your Azure AI Project resource in the Azure portal. * [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) installed. * You are logged into your Azure account by running `az login`. @@ -83,41 +80,6 @@ pip install azure-ai-projects ## Key concepts -### Create and authenticate the client with API key - -To construct a synchronous client: - -```python -import os -from azure.ai.projects import AIProjectClient -from azure.core.credentials import AzureKeyCredential - -project_client = AIProjectClient( - credential=AzureKeyCredential(os.environ["PROJECT_API_KEY"]), - endpoint=os.environ["PROJECT_ENDPOINT"], -) -``` - -To construct an asynchronous client, Install the additional package [aiohttp](https://pypi.org/project/aiohttp/): - -```bash -pip install aiohttp -``` - -and update the code above to import `asyncio`, and import `AIProjectClient` from the `azure.ai.projects.aio` namespace: - -```python -import os -import asyncio -from azure.ai.projects.aio import AIProjectClient -from azure.core.credentials import AzureKeyCredential - -project_client = AIProjectClient.from_connection_string( - credential=AzureKeyCredential(os.environ["PROJECT_API_KEY"]), - endpoint=os.environ["PROJECT_ENDPOINT"], -) -``` - ### Create and authenticate the client with Entra ID To construct a synchronous client: diff --git a/sdk/ai/azure-ai-projects-onedp/apiview-properties.json b/sdk/ai/azure-ai-projects-onedp/apiview-properties.json new file mode 100644 index 000000000000..c93a0c90f921 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/apiview-properties.json @@ -0,0 +1,69 @@ +{ + "CrossLanguagePackageId": "Azure.AI.Projects", + "CrossLanguageDefinitionId": { + "azure.ai.projects.onedp.models.Index": "Azure.AI.Projects.Index", + "azure.ai.projects.onedp.models.AzureAISearchIndex": "Azure.AI.Projects.AzureAISearchIndex", + "azure.ai.projects.onedp.models.BlobReferenceForConsumption": "Azure.AI.Projects.BlobReferenceForConsumption", + "azure.ai.projects.onedp.models.Connection": "Azure.AI.Projects.Connection", + "azure.ai.projects.onedp.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex", + "azure.ai.projects.onedp.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion", + "azure.ai.projects.onedp.models.Deployment": "Azure.AI.Projects.Deployment", + "azure.ai.projects.onedp.models.EmbeddingConfiguration": "Azure.AI.Projects.EmbeddingConfiguration", + "azure.ai.projects.onedp.models.Evaluation": "Azure.AI.Projects.Evaluation", + "azure.ai.projects.onedp.models.EvaluationResult": "Azure.AI.Projects.EvaluationResult", + "azure.ai.projects.onedp.models.EvaluatorConfiguration": "Azure.AI.Projects.EvaluatorConfiguration", + "azure.ai.projects.onedp.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion", + "azure.ai.projects.onedp.models.FolderDatasetVersion": "Azure.AI.Projects.FolderDatasetVersion", + "azure.ai.projects.onedp.models.InputData": "Azure.AI.Projects.InputData", + "azure.ai.projects.onedp.models.InputDataset": "Azure.AI.Projects.InputDataset", + "azure.ai.projects.onedp.models.ManagedAzureAISearchIndex": "Azure.AI.Projects.ManagedAzureAISearchIndex", + "azure.ai.projects.onedp.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment", + "azure.ai.projects.onedp.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest", + "azure.ai.projects.onedp.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse", + "azure.ai.projects.onedp.models.RedTeam": "Azure.AI.Projects.RedTeam", + "azure.ai.projects.onedp.models.SasCredential": "Azure.AI.Projects.SasCredential", + "azure.ai.projects.onedp.models.Sku": "Azure.AI.Projects.Sku", + "azure.ai.projects.onedp.models.ConnectionType": "Azure.AI.Projects.ConnectionType", + "azure.ai.projects.onedp.models.AuthenticationType": "Azure.AI.Projects.AuthenticationType", + "azure.ai.projects.onedp.models.DatasetType": "Azure.AI.Projects.DatasetType", + "azure.ai.projects.onedp.models.ListViewType": "Azure.AI.Projects.ListViewType", + "azure.ai.projects.onedp.models.RepeatabilityResult": "Azure.Core.RepeatabilityResult", + "azure.ai.projects.onedp.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType", + "azure.ai.projects.onedp.models.IndexType": "Azure.AI.Projects.IndexType", + "azure.ai.projects.onedp.models.DeploymentType": "Azure.AI.Projects.DeploymentType", + "azure.ai.projects.onedp.models.ResultType": "Azure.AI.Projects.ResultType", + "azure.ai.projects.onedp.models.AttackStrategy": "Azure.AI.Projects.AttackStrategy", + "azure.ai.projects.onedp.models.RiskCategory": "Azure.AI.Projects.RiskCategory", + "azure.ai.projects.onedp.AIProjectClient.connections.get": "Azure.AI.Projects.Connections.get", + "azure.ai.projects.onedp.AIProjectClient.connections.list": "Azure.AI.Projects.Connections.list", + "azure.ai.projects.onedp.AIProjectClient.evaluations.get": "Azure.AI.Projects.Evaluations.get", + "azure.ai.projects.onedp.AIProjectClient.evaluations.list": "Azure.AI.Projects.Evaluations.list", + "azure.ai.projects.onedp.AIProjectClient.evaluations.create_run": "Azure.AI.Projects.Evaluations.createRun", + "azure.ai.projects.onedp.AIProjectClient.datasets.list_versions": "Azure.AI.Projects.ServicePatterns.Datasets.listVersions", + "azure.ai.projects.onedp.AIProjectClient.datasets.list_latest": "Azure.AI.Projects.ServicePatterns.Datasets.listLatest", + "azure.ai.projects.onedp.AIProjectClient.datasets.get_version": "Azure.AI.Projects.ServicePatterns.Datasets.getVersion", + "azure.ai.projects.onedp.AIProjectClient.datasets.delete_version": "Azure.AI.Projects.ServicePatterns.Datasets.deleteVersion", + "azure.ai.projects.onedp.AIProjectClient.datasets.create": "Azure.AI.Projects.ServicePatterns.Datasets.create", + "azure.ai.projects.onedp.AIProjectClient.datasets.create_version": "Azure.AI.Projects.ServicePatterns.Datasets.createVersion", + "azure.ai.projects.onedp.AIProjectClient.datasets.start_pending_upload_version": "Azure.AI.Projects.Datasets.startPendingUploadVersion", + "azure.ai.projects.onedp.AIProjectClient.datasets.start_pending_upload": "Azure.AI.Projects.Datasets.startPendingUpload", + "azure.ai.projects.onedp.AIProjectClient.indexes.list_versions": "Azure.AI.Projects.ServicePatterns.Indexes.listVersions", + "azure.ai.projects.onedp.AIProjectClient.indexes.list_latest": "Azure.AI.Projects.ServicePatterns.Indexes.listLatest", + "azure.ai.projects.onedp.AIProjectClient.indexes.get_version": "Azure.AI.Projects.ServicePatterns.Indexes.getVersion", + "azure.ai.projects.onedp.AIProjectClient.indexes.delete_version": "Azure.AI.Projects.ServicePatterns.Indexes.deleteVersion", + "azure.ai.projects.onedp.AIProjectClient.indexes.create": "Azure.AI.Projects.ServicePatterns.Indexes.create", + "azure.ai.projects.onedp.AIProjectClient.indexes.create_version": "Azure.AI.Projects.ServicePatterns.Indexes.createVersion", + "azure.ai.projects.onedp.AIProjectClient.deployments.get": "Azure.AI.Projects.Deployments.get", + "azure.ai.projects.onedp.AIProjectClient.deployments.list": "Azure.AI.Projects.Deployments.list", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.list_versions": "Azure.AI.Projects.ServicePatterns.EvaluationResults.listVersions", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.list_latest": "Azure.AI.Projects.ServicePatterns.EvaluationResults.listLatest", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.get_version": "Azure.AI.Projects.ServicePatterns.EvaluationResults.getVersion", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.delete_version": "Azure.AI.Projects.ServicePatterns.EvaluationResults.deleteVersion", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.create": "Azure.AI.Projects.ServicePatterns.EvaluationResults.create", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.create_version": "Azure.AI.Projects.ServicePatterns.EvaluationResults.createVersion", + "azure.ai.projects.onedp.AIProjectClient.evaluation_results.start_pending_upload": "Azure.AI.Projects.EvaluationResults.startPendingUpload", + "azure.ai.projects.onedp.AIProjectClient.red_teams.get": "Azure.AI.Projects.RedTeams.get", + "azure.ai.projects.onedp.AIProjectClient.red_teams.list": "Azure.AI.Projects.RedTeams.list", + "azure.ai.projects.onedp.AIProjectClient.red_teams.create_run": "Azure.AI.Projects.RedTeams.createRun" + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects-dp1/azure/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_client.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_client.py similarity index 90% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_client.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_client.py index 400bd4423be6..78f6c499f1c8 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_client.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_client.py @@ -25,8 +25,8 @@ EvaluationsOperations, IndexesOperations, RedTeamsOperations, + ServicePatternsOperations, ) -from .servicepatterns.operations import ServicePatternsOperations if TYPE_CHECKING: from azure.core.credentials import TokenCredential @@ -36,21 +36,21 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes """AIProjectClient. :ivar service_patterns: ServicePatternsOperations operations - :vartype service_patterns: azure.ai.projects.operations.ServicePatternsOperations + :vartype service_patterns: azure.ai.projects.onedp.operations.ServicePatternsOperations :ivar connections: ConnectionsOperations operations - :vartype connections: azure.ai.projects.operations.ConnectionsOperations + :vartype connections: azure.ai.projects.onedp.operations.ConnectionsOperations :ivar evaluations: EvaluationsOperations operations - :vartype evaluations: azure.ai.projects.operations.EvaluationsOperations + :vartype evaluations: azure.ai.projects.onedp.operations.EvaluationsOperations :ivar datasets: DatasetsOperations operations - :vartype datasets: azure.ai.projects.operations.DatasetsOperations + :vartype datasets: azure.ai.projects.onedp.operations.DatasetsOperations :ivar indexes: IndexesOperations operations - :vartype indexes: azure.ai.projects.operations.IndexesOperations + :vartype indexes: azure.ai.projects.onedp.operations.IndexesOperations :ivar deployments: DeploymentsOperations operations - :vartype deployments: azure.ai.projects.operations.DeploymentsOperations + :vartype deployments: azure.ai.projects.onedp.operations.DeploymentsOperations :ivar evaluation_results: EvaluationResultsOperations operations - :vartype evaluation_results: azure.ai.projects.operations.EvaluationResultsOperations + :vartype evaluation_results: azure.ai.projects.onedp.operations.EvaluationResultsOperations :ivar red_teams: RedTeamsOperations operations - :vartype red_teams: azure.ai.projects.operations.RedTeamsOperations + :vartype red_teams: azure.ai.projects.onedp.operations.RedTeamsOperations :param endpoint: Project endpoint in the form of: https://.services.ai.azure.com/api/projects/. Required. :type endpoint: str diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_configuration.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_configuration.py similarity index 97% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_configuration.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_configuration.py index 43bf1552aea7..fb431655e028 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_configuration.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_configuration.py @@ -48,7 +48,7 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, "TokenCr self.credential = credential self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://cognitiveservices.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-projects-dp1/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "ai-projects-onedp/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_model_base.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_model_base.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_model_base.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_model_base.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_serialization.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_serialization.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_serialization.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_serialization.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_types.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_types.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_types.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_types.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_validation.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_validation.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_validation.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_validation.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_vendor.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_vendor.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_vendor.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_vendor.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_version.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_version.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/_version.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/_version.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_client.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_client.py similarity index 89% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_client.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_client.py index 5b72777bcaac..6b2ebc4df943 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_client.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_client.py @@ -16,7 +16,6 @@ from azure.core.rest import AsyncHttpResponse, HttpRequest from .._serialization import Deserializer, Serializer -from ..servicepatterns.aio.operations import ServicePatternsOperations from ._configuration import AIProjectClientConfiguration from .operations import ( ConnectionsOperations, @@ -26,6 +25,7 @@ EvaluationsOperations, IndexesOperations, RedTeamsOperations, + ServicePatternsOperations, ) if TYPE_CHECKING: @@ -36,21 +36,21 @@ class AIProjectClient: # pylint: disable=too-many-instance-attributes """AIProjectClient. :ivar service_patterns: ServicePatternsOperations operations - :vartype service_patterns: azure.ai.projects.aio.operations.ServicePatternsOperations + :vartype service_patterns: azure.ai.projects.onedp.aio.operations.ServicePatternsOperations :ivar connections: ConnectionsOperations operations - :vartype connections: azure.ai.projects.aio.operations.ConnectionsOperations + :vartype connections: azure.ai.projects.onedp.aio.operations.ConnectionsOperations :ivar evaluations: EvaluationsOperations operations - :vartype evaluations: azure.ai.projects.aio.operations.EvaluationsOperations + :vartype evaluations: azure.ai.projects.onedp.aio.operations.EvaluationsOperations :ivar datasets: DatasetsOperations operations - :vartype datasets: azure.ai.projects.aio.operations.DatasetsOperations + :vartype datasets: azure.ai.projects.onedp.aio.operations.DatasetsOperations :ivar indexes: IndexesOperations operations - :vartype indexes: azure.ai.projects.aio.operations.IndexesOperations + :vartype indexes: azure.ai.projects.onedp.aio.operations.IndexesOperations :ivar deployments: DeploymentsOperations operations - :vartype deployments: azure.ai.projects.aio.operations.DeploymentsOperations + :vartype deployments: azure.ai.projects.onedp.aio.operations.DeploymentsOperations :ivar evaluation_results: EvaluationResultsOperations operations - :vartype evaluation_results: azure.ai.projects.aio.operations.EvaluationResultsOperations + :vartype evaluation_results: azure.ai.projects.onedp.aio.operations.EvaluationResultsOperations :ivar red_teams: RedTeamsOperations operations - :vartype red_teams: azure.ai.projects.aio.operations.RedTeamsOperations + :vartype red_teams: azure.ai.projects.onedp.aio.operations.RedTeamsOperations :param endpoint: Project endpoint in the form of: https://.services.ai.azure.com/api/projects/. Required. :type endpoint: str diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_configuration.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_configuration.py similarity index 97% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_configuration.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_configuration.py index d9348425fce1..fe4e99b03484 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_configuration.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_configuration.py @@ -50,7 +50,7 @@ def __init__( self.credential = credential self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://cognitiveservices.azure.com/.default"]) - kwargs.setdefault("sdk_moniker", "ai-projects-dp1/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "ai-projects-onedp/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_vendor.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_vendor.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/_vendor.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/_vendor.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/__init__.py similarity index 93% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/__init__.py index cf2e70df6dd4..f6be99bbed9c 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/__init__.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/__init__.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ServicePatternsOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import EvaluationsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore @@ -25,6 +26,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ServicePatternsOperations", "ConnectionsOperations", "EvaluationsOperations", "DatasetsOperations", diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/_operations.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/_operations.py similarity index 88% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/_operations.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/_operations.py index b6bd094c805d..480f52e3c34e 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/_operations.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/_operations.py @@ -30,7 +30,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ... import models as _models2 +from ... import models as _models from ..._model_base import SdkJSONEncoder, _deserialize from ..._serialization import Deserializer, Serializer from ..._validation import api_version_validation @@ -78,13 +78,35 @@ JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +class ServicePatternsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s + :attr:`service_patterns` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.building_blocks = ServicePatternsBuildingBlocksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + class ConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`connections` attribute. """ @@ -96,13 +118,13 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, name: str, **kwargs: Any) -> _models2.Connection: + async def get(self, name: str, **kwargs: Any) -> _models.Connection: """Get a connection by name. :param name: The name of the resource. Required. :type name: str :return: Connection. The Connection is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Connection + :rtype: ~azure.ai.projects.onedp.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -116,7 +138,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Connection: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.Connection] = kwargs.pop("cls", None) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) _request = build_connections_get_request( name=name, @@ -153,7 +175,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Connection: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Connection, response.json()) + deserialized = _deserialize(_models.Connection, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -164,30 +186,30 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Connection: def list( self, *, - connection_type: Optional[Union[str, _models2.ConnectionType]] = None, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models2.Connection"]: + ) -> AsyncIterable["_models.Connection"]: """List all connections in the project. :keyword connection_type: Specific type of connection to return in list. Known values are: "AzureOpenAI", "AzureBlob", "CognitiveSearch", "CosmosDB", "ApiKey", "AppInsights", and "CustomKeys". Default value is None. - :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType + :paramtype connection_type: str or ~azure.ai.projects.onedp.models.ConnectionType :keyword top: The number of result items to return. Default value is None. :paramtype top: int :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of Connection - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Connection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.Connection] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models2.Connection]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -240,7 +262,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Connection], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Connection], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -269,7 +291,7 @@ class EvaluationsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`evaluations` attribute. """ @@ -285,13 +307,13 @@ def __init__(self, *args, **kwargs) -> None: method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "name", "client_request_id", "accept"]}, ) - async def get(self, name: str, **kwargs: Any) -> _models2.Evaluation: + async def get(self, name: str, **kwargs: Any) -> _models.Evaluation: """Get an evaluation run by name. :param name: Identifier of the evaluation. Required. :type name: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -305,7 +327,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Evaluation: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.Evaluation] = kwargs.pop("cls", None) + cls: ClsType[_models.Evaluation] = kwargs.pop("cls", None) _request = build_evaluations_get_request( name=name, @@ -342,7 +364,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Evaluation: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Evaluation, response.json()) + deserialized = _deserialize(_models.Evaluation, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -358,7 +380,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Evaluation: ) def list( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models2.Evaluation"]: + ) -> AsyncIterable["_models.Evaluation"]: """List evaluation runs. :keyword top: The number of result items to return. Default value is None. @@ -366,14 +388,14 @@ def list( :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of Evaluation - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Evaluation] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.Evaluation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models2.Evaluation]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Evaluation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -425,7 +447,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Evaluation], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Evaluation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -449,24 +471,24 @@ async def get_next(next_link=None): @overload async def create_run( - self, evaluation: _models2.Evaluation, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Evaluation: + self, evaluation: _models.Evaluation, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Required. - :type evaluation: ~azure.ai.projects.models.Evaluation + :type evaluation: ~azure.ai.projects.onedp.models.Evaluation :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_run( self, evaluation: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Evaluation: + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Required. @@ -475,14 +497,14 @@ async def create_run( Default value is "application/json". :paramtype content_type: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_run( self, evaluation: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Evaluation: + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Required. @@ -491,7 +513,7 @@ async def create_run( Default value is "application/json". :paramtype content_type: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ @@ -501,15 +523,15 @@ async def create_run( params_added_on={"2025-05-15-preview": ["api_version", "content_type", "accept"]}, ) async def create_run( - self, evaluation: Union[_models2.Evaluation, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Evaluation: + self, evaluation: Union[_models.Evaluation, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Is one of the following types: Evaluation, JSON, IO[bytes] Required. - :type evaluation: ~azure.ai.projects.models.Evaluation or JSON or IO[bytes] + :type evaluation: ~azure.ai.projects.onedp.models.Evaluation or JSON or IO[bytes] :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -524,7 +546,7 @@ async def create_run( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Evaluation] = kwargs.pop("cls", None) + cls: ClsType[_models.Evaluation] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -564,7 +586,7 @@ async def create_run( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Evaluation, response.json()) + deserialized = _deserialize(_models.Evaluation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -578,7 +600,7 @@ class DatasetsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`datasets` attribute. """ @@ -597,9 +619,9 @@ def list_versions( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models2.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> AsyncIterable["_models2.DatasetVersion"]: + ) -> AsyncIterable["_models.DatasetVersion"]: """List all versions of the given DatasetVersion. :param name: The name of the resource. Required. @@ -615,15 +637,15 @@ def list_versions( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -677,7 +699,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.DatasetVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.DatasetVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -706,9 +728,9 @@ def list_latest( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models2.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> AsyncIterable["_models2.DatasetVersion"]: + ) -> AsyncIterable["_models.DatasetVersion"]: """List the latest version of each DatasetVersion. :keyword top: Top count of results, top count cannot be greater than the page size. If topCount @@ -722,15 +744,15 @@ def list_latest( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.DatasetVersion] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -783,7 +805,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.DatasetVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.DatasetVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -806,7 +828,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2.DatasetVersion: + async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: """Get the specific version of the DatasetVersion. :param name: The name of the resource. Required. @@ -814,7 +836,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. :param version: The specific version id of the DatasetVersion to retrieve. Required. :type version: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -828,7 +850,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) _request = build_datasets_get_version_request( name=name, @@ -861,7 +883,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.DatasetVersion, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -921,26 +943,26 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: @overload async def create( - self, name: str, body: _models2.DatasetVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DatasetVersion: + self, name: str, body: _models.DatasetVersion, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the DatasetVersion to create. Required. - :type body: ~azure.ai.projects.models.DatasetVersion + :type body: ~azure.ai.projects.onedp.models.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -951,14 +973,14 @@ async def create( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -969,23 +991,23 @@ async def create( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create( - self, name: str, body: Union[_models2.DatasetVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.DatasetVersion: + self, name: str, body: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the DatasetVersion to create. Is one of the following types: DatasetVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1000,7 +1022,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1049,7 +1071,7 @@ async def create( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.DatasetVersion, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1061,11 +1083,11 @@ async def create_version( self, name: str, version: str, - body: _models2.DatasetVersion, + body: _models.DatasetVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -1073,19 +1095,19 @@ async def create_version( :param version: The specific version id of the DatasetVersion to create or replace. Required. :type version: str :param body: The definition of the DatasetVersion to create. Required. - :type body: ~azure.ai.projects.models.DatasetVersion + :type body: ~azure.ai.projects.onedp.models.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -1098,14 +1120,14 @@ async def create_version( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -1118,14 +1140,14 @@ async def create_version( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_version( - self, name: str, version: str, body: Union[_models2.DatasetVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.DatasetVersion: + self, name: str, version: str, body: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -1134,9 +1156,9 @@ async def create_version( :type version: str :param body: The definition of the DatasetVersion to create. Is one of the following types: DatasetVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1151,7 +1173,7 @@ async def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1193,7 +1215,7 @@ async def create_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.DatasetVersion, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1205,11 +1227,11 @@ async def start_pending_upload_version( self, name: str, version: str, - body: _models2.PendingUploadRequest, + body: _models.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -1217,19 +1239,19 @@ async def start_pending_upload_version( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param body: Parameters for the action. Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def start_pending_upload_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -1242,14 +1264,14 @@ async def start_pending_upload_version( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def start_pending_upload_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -1262,14 +1284,14 @@ async def start_pending_upload_version( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def start_pending_upload_version( - self, name: str, version: str, body: Union[_models2.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PendingUploadResponse: + self, name: str, version: str, body: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -1278,9 +1300,9 @@ async def start_pending_upload_version( :type version: str :param body: Parameters for the action. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest or JSON or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1295,7 +1317,7 @@ async def start_pending_upload_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PendingUploadResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1337,7 +1359,7 @@ async def start_pending_upload_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1346,26 +1368,26 @@ async def start_pending_upload_version( @overload async def start_pending_upload( - self, name: str, body: _models2.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + self, name: str, body: _models.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: Parameters for the action. Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def start_pending_upload( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -1376,14 +1398,14 @@ async def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def start_pending_upload( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -1394,23 +1416,23 @@ async def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def start_pending_upload( - self, name: str, body: Union[_models2.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PendingUploadResponse: + self, name: str, body: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: Parameters for the action. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest or JSON or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1425,7 +1447,7 @@ async def start_pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PendingUploadResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1466,7 +1488,7 @@ async def start_pending_upload( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1480,7 +1502,7 @@ class IndexesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`indexes` attribute. """ @@ -1499,9 +1521,9 @@ def list_versions( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models2.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> AsyncIterable["_models2.Index"]: + ) -> AsyncIterable["_models.Index"]: """List all versions of the given Index. :param name: The name of the resource. Required. @@ -1517,15 +1539,15 @@ def list_versions( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of Index - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1579,7 +1601,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Index], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Index], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1608,9 +1630,9 @@ def list_latest( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models2.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> AsyncIterable["_models2.Index"]: + ) -> AsyncIterable["_models.Index"]: """List the latest version of each Index. :keyword top: Top count of results, top count cannot be greater than the page size. If topCount @@ -1624,15 +1646,15 @@ def list_latest( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of Index - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Index] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1685,7 +1707,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Index], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Index], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -1708,7 +1730,7 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2.Index: + async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Index: """Get the specific version of the Index. :param name: The name of the resource. Required. @@ -1716,7 +1738,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. :param version: The specific version id of the Index to retrieve. Required. :type version: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1730,7 +1752,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) _request = build_indexes_get_version_request( name=name, @@ -1763,7 +1785,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Index, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1823,26 +1845,26 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: @overload async def create( - self, name: str, body: _models2.Index, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Index: + self, name: str, body: _models.Index, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the Index to create. Required. - :type body: ~azure.ai.projects.models.Index + :type body: ~azure.ai.projects.onedp.models.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Index: + ) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -1853,14 +1875,14 @@ async def create( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Index: + ) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -1871,21 +1893,21 @@ async def create( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create(self, name: str, body: Union[_models2.Index, JSON, IO[bytes]], **kwargs: Any) -> _models2.Index: + async def create(self, name: str, body: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the Index to create. Is one of the following types: Index, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1900,7 +1922,7 @@ async def create(self, name: str, body: Union[_models2.Index, JSON, IO[bytes]], _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1949,7 +1971,7 @@ async def create(self, name: str, body: Union[_models2.Index, JSON, IO[bytes]], if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Index, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1958,8 +1980,8 @@ async def create(self, name: str, body: Union[_models2.Index, JSON, IO[bytes]], @overload async def create_version( - self, name: str, version: str, body: _models2.Index, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Index: + self, name: str, version: str, body: _models.Index, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -1967,19 +1989,19 @@ async def create_version( :param version: The specific version id of the Index to create or replace. Required. :type version: str :param body: The definition of the Index to create. Required. - :type body: ~azure.ai.projects.models.Index + :type body: ~azure.ai.projects.onedp.models.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Index: + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -1992,14 +2014,14 @@ async def create_version( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.Index: + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -2012,14 +2034,14 @@ async def create_version( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async async def create_version( - self, name: str, version: str, body: Union[_models2.Index, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.Index: + self, name: str, version: str, body: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -2028,9 +2050,9 @@ async def create_version( :type version: str :param body: The definition of the Index to create. Is one of the following types: Index, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2045,7 +2067,7 @@ async def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2087,7 +2109,7 @@ async def create_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Index, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2101,7 +2123,7 @@ class DeploymentsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`deployments` attribute. """ @@ -2113,13 +2135,13 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, name: str, **kwargs: Any) -> _models2.Deployment: + async def get(self, name: str, **kwargs: Any) -> _models.Deployment: """Get a deployed model. :param name: Name of the deployment. Required. :type name: str :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Deployment + :rtype: ~azure.ai.projects.onedp.models.Deployment :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2133,7 +2155,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Deployment: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.Deployment] = kwargs.pop("cls", None) + cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) _request = build_deployments_get_request( name=name, @@ -2170,7 +2192,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.Deployment: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.Deployment, response.json()) + deserialized = _deserialize(_models.Deployment, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2186,7 +2208,7 @@ def list( top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models2.Deployment"]: + ) -> AsyncIterable["_models.Deployment"]: """List all deployed models in the project. :keyword model_publisher: Model publisher to filter models by. Default value is None. @@ -2199,14 +2221,14 @@ def list( :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of Deployment - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.Deployment] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models2.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2260,7 +2282,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.Deployment], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Deployment], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2289,7 +2311,7 @@ class EvaluationResultsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`evaluation_results` attribute. """ @@ -2314,9 +2336,9 @@ def list_versions( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models2.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> AsyncIterable["_models2.EvaluationResult"]: + ) -> AsyncIterable["_models.EvaluationResult"]: """List all versions of the given EvaluationResult. :param name: The name of the resource. Required. @@ -2332,15 +2354,16 @@ def list_versions( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of EvaluationResult - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluationResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.EvaluationResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.EvaluationResult]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EvaluationResult]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2394,7 +2417,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.EvaluationResult], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluationResult], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2427,9 +2450,9 @@ def list_latest( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models2.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> AsyncIterable["_models2.EvaluationResult"]: + ) -> AsyncIterable["_models.EvaluationResult"]: """List the latest version of each EvaluationResult. :keyword top: Top count of results, top count cannot be greater than the page size. If topCount @@ -2443,15 +2466,16 @@ def list_latest( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of EvaluationResult - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.EvaluationResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.EvaluationResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models2.EvaluationResult]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EvaluationResult]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2504,7 +2528,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.EvaluationResult], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluationResult], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -2531,7 +2555,7 @@ async def get_next(next_link=None): method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "name", "version", "accept"]}, ) - async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2.EvaluationResult: + async def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluationResult: """Get the specific version of the EvaluationResult. :param name: The name of the resource. Required. @@ -2539,7 +2563,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. :param version: The specific version id of the EvaluationResult to retrieve. Required. :type version: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2553,7 +2577,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.EvaluationResult] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationResult] = kwargs.pop("cls", None) _request = build_evaluation_results_get_version_request( name=name, @@ -2586,7 +2610,7 @@ async def get_version(self, name: str, version: str, **kwargs: Any) -> _models2. if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.EvaluationResult, response.json()) + deserialized = _deserialize(_models.EvaluationResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2650,26 +2674,26 @@ async def delete_version(self, name: str, version: str, **kwargs: Any) -> None: @overload async def create( - self, name: str, body: _models2.EvaluationResult, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.EvaluationResult: + self, name: str, body: _models.EvaluationResult, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the EvaluationResult to create. Required. - :type body: ~azure.ai.projects.models.EvaluationResult + :type body: ~azure.ai.projects.onedp.models.EvaluationResult :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -2680,14 +2704,14 @@ async def create( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -2698,7 +2722,7 @@ async def create( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2718,17 +2742,17 @@ async def create( }, ) async def create( - self, name: str, body: Union[_models2.EvaluationResult, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.EvaluationResult: + self, name: str, body: Union[_models.EvaluationResult, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the EvaluationResult to create. Is one of the following types: EvaluationResult, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationResult or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.EvaluationResult or JSON or IO[bytes] :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2743,7 +2767,7 @@ async def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.EvaluationResult] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2792,7 +2816,7 @@ async def create( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.EvaluationResult, response.json()) + deserialized = _deserialize(_models.EvaluationResult, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2804,11 +2828,11 @@ async def create_version( self, name: str, version: str, - body: _models2.EvaluationResult, + body: _models.EvaluationResult, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -2816,19 +2840,19 @@ async def create_version( :param version: The specific version id of the EvaluationResult to create or replace. Required. :type version: str :param body: The definition of the EvaluationResult to create. Required. - :type body: ~azure.ai.projects.models.EvaluationResult + :type body: ~azure.ai.projects.onedp.models.EvaluationResult :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -2841,14 +2865,14 @@ async def create_version( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -2861,7 +2885,7 @@ async def create_version( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -2871,8 +2895,8 @@ async def create_version( params_added_on={"2025-05-15-preview": ["api_version", "name", "version", "content_type", "accept"]}, ) async def create_version( - self, name: str, version: str, body: Union[_models2.EvaluationResult, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.EvaluationResult: + self, name: str, version: str, body: Union[_models.EvaluationResult, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -2881,9 +2905,9 @@ async def create_version( :type version: str :param body: The definition of the EvaluationResult to create. Is one of the following types: EvaluationResult, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationResult or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.EvaluationResult or JSON or IO[bytes] :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2898,7 +2922,7 @@ async def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.EvaluationResult] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2940,7 +2964,7 @@ async def create_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.EvaluationResult, response.json()) + deserialized = _deserialize(_models.EvaluationResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2952,11 +2976,11 @@ async def start_pending_upload( self, name: str, version: str, - body: _models2.PendingUploadRequest, + body: _models.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -2964,19 +2988,19 @@ async def start_pending_upload( :param version: The specific version id of the EvaluationResult to operate on. Required. :type version: str :param body: Parameters for the action. Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def start_pending_upload( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -2989,14 +3013,14 @@ async def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def start_pending_upload( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -3009,7 +3033,7 @@ async def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3019,8 +3043,8 @@ async def start_pending_upload( params_added_on={"2025-05-15-preview": ["api_version", "name", "version", "content_type", "accept"]}, ) async def start_pending_upload( - self, name: str, version: str, body: Union[_models2.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models2.PendingUploadResponse: + self, name: str, version: str, body: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -3029,9 +3053,9 @@ async def start_pending_upload( :type version: str :param body: Parameters for the action. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest or JSON or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3046,7 +3070,7 @@ async def start_pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.PendingUploadResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -3088,7 +3112,7 @@ async def start_pending_upload( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3102,7 +3126,7 @@ class RedTeamsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.aio.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s :attr:`red_teams` attribute. """ @@ -3118,13 +3142,13 @@ def __init__(self, *args, **kwargs) -> None: method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "name", "client_request_id", "accept"]}, ) - async def get(self, name: str, **kwargs: Any) -> _models2.RedTeam: + async def get(self, name: str, **kwargs: Any) -> _models.RedTeam: """Get a redteam by name. :param name: Identifier of the red team. Required. :type name: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3138,7 +3162,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.RedTeam: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models2.RedTeam] = kwargs.pop("cls", None) + cls: ClsType[_models.RedTeam] = kwargs.pop("cls", None) _request = build_red_teams_get_request( name=name, @@ -3175,7 +3199,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.RedTeam: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.RedTeam, response.json()) + deserialized = _deserialize(_models.RedTeam, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3191,7 +3215,7 @@ async def get(self, name: str, **kwargs: Any) -> _models2.RedTeam: ) def list( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncIterable["_models2.RedTeam"]: + ) -> AsyncIterable["_models.RedTeam"]: """List a redteam by name. :keyword top: The number of result items to return. Default value is None. @@ -3199,14 +3223,14 @@ def list( :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of RedTeam - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.models.RedTeam] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.ai.projects.onedp.models.RedTeam] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models2.RedTeam]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RedTeam]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3258,7 +3282,7 @@ def prepare_request(next_link=None): async def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models2.RedTeam], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.RedTeam], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, AsyncList(list_of_elem) @@ -3282,24 +3306,24 @@ async def get_next(next_link=None): @overload async def create_run( - self, red_team: _models2.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.RedTeam: + self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.models.RedTeam + :type red_team: ~azure.ai.projects.onedp.models.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_run( self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.RedTeam: + ) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Required. @@ -3308,14 +3332,14 @@ async def create_run( Default value is "application/json". :paramtype content_type: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ @overload async def create_run( self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models2.RedTeam: + ) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Required. @@ -3324,7 +3348,7 @@ async def create_run( Default value is "application/json". :paramtype content_type: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3333,14 +3357,14 @@ async def create_run( method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "content_type", "accept"]}, ) - async def create_run(self, red_team: Union[_models2.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models2.RedTeam: + async def create_run(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :type red_team: ~azure.ai.projects.onedp.models.RedTeam or JSON or IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3355,7 +3379,7 @@ async def create_run(self, red_team: Union[_models2.RedTeam, JSON, IO[bytes]], * _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models2.RedTeam] = kwargs.pop("cls", None) + cls: ClsType[_models.RedTeam] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -3395,9 +3419,27 @@ async def create_run(self, red_team: Union[_models2.RedTeam, JSON, IO[bytes]], * if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models2.RedTeam, response.json()) + deserialized = _deserialize(_models.RedTeam, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + +class ServicePatternsBuildingBlocksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.onedp.aio.AIProjectClient`'s + :attr:`building_blocks` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/_patch.py similarity index 93% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/_patch.py index 34293afa0e87..eec8145b67d2 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/aio/operations/_patch.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/aio/operations/_patch.py @@ -51,7 +51,7 @@ async def _create_dataset_and_get_its_container_client( body=PendingUploadRequest(pending_upload_type=PendingUploadType.TEMPORARY_BLOB_REFERENCE), ) if pending_upload_response.dataset_version: - output_version: str = pending_upload_response.dataset_version + output_version: str = pending_upload_response.dataset_version else: raise ValueError("Dataset version is not present in the response") @@ -102,9 +102,12 @@ async def _create_dataset_and_get_its_container_client( # https://learn.microsoft.com/azure/storage/blobs/storage-blob-upload-python # See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python#azure-storage-blob-containerclient-from-container-url - return await ContainerClient.from_container_url( - container_url=pending_upload_response.blob_reference_for_consumption.blob_uri, # Of the form: "https://.blob.core.windows.net/?" - ), output_version + return ( + await ContainerClient.from_container_url( + container_url=pending_upload_response.blob_reference_for_consumption.blob_uri, # Of the form: "https://.blob.core.windows.net/?" + ), + output_version, + ) async def upload_file_and_create( self, *, name: str, version: Optional[str] = None, file: str, **kwargs: Any @@ -130,11 +133,13 @@ async def upload_file_and_create( if path_file.is_dir(): raise ValueError("The provided file is actually a folder. Use method `create_and_upload_folder` instead") - container_client, output_version = await self._create_dataset_and_get_its_container_client(name=name, input_version=version) - + container_client, output_version = await self._create_dataset_and_get_its_container_client( + name=name, input_version=version + ) + async with container_client: - with open(file=file, mode="rb") as data: # TODO: What is the best async options for file reading? + with open(file=file, mode="rb") as data: # TODO: What is the best async options for file reading? blob_name = path_file.name # Extract the file name from the path. logger.debug( @@ -186,7 +191,9 @@ async def upload_folder_and_create_version( if Path(path_folder).is_file(): raise ValueError("The provided folder is actually a file. Use method `create_and_upload_file` instead.") - container_client, output_version = await self._create_dataset_and_get_its_container_client(name=name, input_version=version) + container_client, output_version = await self._create_dataset_and_get_its_container_client( + name=name, input_version=version + ) async with container_client: @@ -201,7 +208,9 @@ async def upload_folder_and_create_version( file_path, blob_name, ) - with file_path.open("rb") as data: # Open the file for reading in binary mode # TODO: async version? + with file_path.open( + "rb" + ) as data: # Open the file for reading in binary mode # TODO: async version? # See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python#azure-storage-blob-containerclient-upload-blob container_client.upload_blob(name=str(blob_name), data=data, **kwargs) logger.debug("[%s] Done uploaded.", inspect.currentframe().f_code.co_name) diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_enums.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_enums.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_enums.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_enums.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_models.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_models.py similarity index 96% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_models.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_models.py index 668aab02134b..e195277cfadd 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_models.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_models.py @@ -26,7 +26,7 @@ class Index(_model_base.Model): :ivar type: Type of index. Required. Known values are: "AzureSearch", "CosmosDBNoSqlVectorStore", and "ManagedAzureSearch". - :vartype type: str or ~azure.ai.projects.models.IndexType + :vartype type: str or ~azure.ai.projects.onedp.models.IndexType :ivar stage: Asset stage. :vartype stage: str :ivar id: A unique identifier for the asset, assetId probably?. @@ -95,7 +95,7 @@ class AzureAISearchIndex(Index, discriminator="AzureSearch"): :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] :ivar type: Type of index. Required. Azure search - :vartype type: str or ~azure.ai.projects.models.AZURE_SEARCH + :vartype type: str or ~azure.ai.projects.onedp.models.AZURE_SEARCH :ivar connection_name: Name of connection to Azure AI Search. Required. :vartype connection_name: str :ivar index_name: Name of index in Azure AI Search resource to attach. Required. @@ -141,7 +141,7 @@ class BlobReferenceForConsumption(_model_base.Model): :ivar storage_account_arm_id: ARM ID of the storage account to use. Required. :vartype storage_account_arm_id: str :ivar credential: Credential info to access the storage account. Required. - :vartype credential: ~azure.ai.projects.models.SasCredential + :vartype credential: ~azure.ai.projects.onedp.models.SasCredential """ blob_uri: str = rest_field(name="blobUri", visibility=["read", "create", "update", "delete", "query"]) @@ -181,12 +181,12 @@ class Connection(_model_base.Model): :vartype name: str :ivar type: Category of the connection. Required. Known values are: "AzureOpenAI", "AzureBlob", "CognitiveSearch", "CosmosDB", "ApiKey", "AppInsights", and "CustomKeys". - :vartype type: str or ~azure.ai.projects.models.ConnectionType + :vartype type: str or ~azure.ai.projects.onedp.models.ConnectionType :ivar target: The connection URL to be used for this service. Required. :vartype target: str :ivar auth_type: The authentication type used by the connection. Required. Known values are: "ApiKey", "AAD", "SAS", "CustomKeys", and "None". - :vartype auth_type: str or ~azure.ai.projects.models.AuthenticationType + :vartype auth_type: str or ~azure.ai.projects.onedp.models.AuthenticationType :ivar metadata: Metadata of the connection. Required. :vartype metadata: dict[str, str] """ @@ -221,7 +221,7 @@ class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] :ivar type: Type of index. Required. CosmosDB - :vartype type: str or ~azure.ai.projects.models.COSMOS_DB + :vartype type: str or ~azure.ai.projects.onedp.models.COSMOS_DB :ivar connection_name: Name of connection to CosmosDB. Required. :vartype connection_name: str :ivar database_name: Name of the CosmosDB Database. Required. @@ -229,7 +229,7 @@ class CosmosDBIndex(Index, discriminator="CosmosDBNoSqlVectorStore"): :ivar container_name: Name of CosmosDB Container. Required. :vartype container_name: str :ivar embedding_configuration: Embedding model configuration. Required. - :vartype embedding_configuration: ~azure.ai.projects.models.EmbeddingConfiguration + :vartype embedding_configuration: ~azure.ai.projects.onedp.models.EmbeddingConfiguration """ type: Literal[IndexType.COSMOS_DB] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -280,7 +280,7 @@ class DatasetVersion(_model_base.Model): `_. Required. :vartype dataset_uri: str :ivar type: Dataset type. Required. Known values are: "uri_file" and "uri_folder". - :vartype type: str or ~azure.ai.projects.models.DatasetType + :vartype type: str or ~azure.ai.projects.onedp.models.DatasetType :ivar is_reference: Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted. :vartype is_reference: bool @@ -349,7 +349,7 @@ class Deployment(_model_base.Model): ModelDeployment :ivar type: The type of the deployment. Required. "ModelDeployment" - :vartype type: str or ~azure.ai.projects.models.DeploymentType + :vartype type: str or ~azure.ai.projects.onedp.models.DeploymentType :ivar name: Name of the deployment. Required. :vartype name: str """ @@ -421,7 +421,7 @@ class Evaluation(_model_base.Model): :ivar id: Identifier of the evaluation. Required. :vartype id: str :ivar data: Data for evaluation. Required. - :vartype data: ~azure.ai.projects.models.InputData + :vartype data: ~azure.ai.projects.onedp.models.InputData :ivar display_name: Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. :vartype display_name: str @@ -436,7 +436,7 @@ class Evaluation(_model_base.Model): property cannot be removed. :vartype properties: dict[str, str] :ivar evaluators: Evaluators to be used for the evaluation. Required. - :vartype evaluators: dict[str, ~azure.ai.projects.models.EvaluatorConfiguration] + :vartype evaluators: dict[str, ~azure.ai.projects.onedp.models.EvaluatorConfiguration] :ivar outputs: Read-only result outputs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{projectName}/evaluationresults/{name}/{version}', 'logId': @@ -503,7 +503,7 @@ class EvaluationResult(_model_base.Model): :ivar result_type: Type of Evaluation result. Known values are: "Benchmark", "Evaluation", "Redteam", and "Simulation". - :vartype result_type: str or ~azure.ai.projects.models.ResultType + :vartype result_type: str or ~azure.ai.projects.onedp.models.ResultType :ivar model_name: Model Name. :vartype model_name: str :ivar model_version: Model Version. @@ -667,7 +667,7 @@ class FileDatasetVersion(DatasetVersion, discriminator="uri_file"): :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] :ivar type: Dataset type. Required. URI file. - :vartype type: str or ~azure.ai.projects.models.URI_FILE + :vartype type: str or ~azure.ai.projects.onedp.models.URI_FILE :ivar open_ai_purpose: Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features. Required. :vartype open_ai_purpose: str @@ -724,7 +724,7 @@ class FolderDatasetVersion(DatasetVersion, discriminator="uri_folder"): :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] :ivar type: Dataset type. Required. URI folder. - :vartype type: str or ~azure.ai.projects.models.URI_FOLDER + :vartype type: str or ~azure.ai.projects.onedp.models.URI_FOLDER """ type: Literal[DatasetType.URI_FOLDER] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"]) # type: ignore @@ -831,7 +831,7 @@ class ManagedAzureAISearchIndex(Index, discriminator="ManagedAzureSearch"): :ivar tags: Tag dictionary. Tags can be added, removed, and updated. :vartype tags: dict[str, str] :ivar type: Type of index. Required. Managed Azure Search - :vartype type: str or ~azure.ai.projects.models.MANAGED_AZURE_SEARCH + :vartype type: str or ~azure.ai.projects.onedp.models.MANAGED_AZURE_SEARCH :ivar vector_store_id: Vector store id of managed index. Required. :vartype vector_store_id: str """ @@ -868,7 +868,7 @@ class ModelDeployment(Deployment, discriminator="ModelDeployment"): :ivar name: Name of the deployment. Required. :vartype name: str :ivar type: The type of the deployment. Required. Model deployment - :vartype type: str or ~azure.ai.projects.models.MODEL_DEPLOYMENT + :vartype type: str or ~azure.ai.projects.onedp.models.MODEL_DEPLOYMENT :ivar model_name: Publisher-specific name of the deployed model. Required. :vartype model_name: str :ivar model_version: Publisher-specific version of the deployed model. Required. @@ -878,7 +878,7 @@ class ModelDeployment(Deployment, discriminator="ModelDeployment"): :ivar capabilities: Capabilities of deployed model. Required. :vartype capabilities: dict[str, str] :ivar sku: Sku of the model deployment. Required. - :vartype sku: ~azure.ai.projects.models.Sku + :vartype sku: ~azure.ai.projects.onedp.models.Sku :ivar connection_name: Name of the connection the deployment comes from. :vartype connection_name: str """ @@ -924,7 +924,7 @@ class PendingUploadRequest(_model_base.Model): :vartype connection_name: str :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Required. Temporary Blob Reference is the only supported type. - :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE + :vartype pending_upload_type: str or ~azure.ai.projects.onedp.models.TEMPORARY_BLOB_REFERENCE """ pending_upload_id: Optional[str] = rest_field( @@ -965,7 +965,8 @@ class PendingUploadResponse(_model_base.Model): """Represents the response for a pending upload request. :ivar blob_reference_for_consumption: Container-level read, write, list SAS. Required. - :vartype blob_reference_for_consumption: ~azure.ai.projects.models.BlobReferenceForConsumption + :vartype blob_reference_for_consumption: + ~azure.ai.projects.onedp.models.BlobReferenceForConsumption :ivar pending_upload_id: ID for this upload request. Required. :vartype pending_upload_id: str :ivar dataset_version: Version of dataset to be created if user did not specify version when @@ -973,7 +974,7 @@ class PendingUploadResponse(_model_base.Model): :vartype dataset_version: str :ivar pending_upload_type: TemporaryBlobReference is the only supported type. Required. Temporary Blob Reference is the only supported type. - :vartype pending_upload_type: str or ~azure.ai.projects.models.TEMPORARY_BLOB_REFERENCE + :vartype pending_upload_type: str or ~azure.ai.projects.onedp.models.TEMPORARY_BLOB_REFERENCE """ blob_reference_for_consumption: "_models.BlobReferenceForConsumption" = rest_field( @@ -1027,7 +1028,7 @@ class RedTeam(_model_base.Model): :vartype num_turns: int :ivar attack_strategy: List of attack strategies or nested lists of attack strategies. Required. - :vartype attack_strategy: list[str or ~azure.ai.projects.models.AttackStrategy] + :vartype attack_strategy: list[str or ~azure.ai.projects.onedp.models.AttackStrategy] :ivar simulation_only: Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result. Required. :vartype simulation_only: bool @@ -1038,7 +1039,7 @@ class RedTeam(_model_base.Model): }. Required. :vartype outputs: dict[str, str] :ivar risk_categories: List of risk categories to generate attack objectives for. Required. - :vartype risk_categories: list[str or ~azure.ai.projects.models.RiskCategory] + :vartype risk_categories: list[str or ~azure.ai.projects.onedp.models.RiskCategory] :ivar application_scenario: Application scenario for the red team operation, to generate scenario specific attacks. :vartype application_scenario: str diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/models/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/models/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/__init__.py similarity index 93% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/__init__.py index cf2e70df6dd4..f6be99bbed9c 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/__init__.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/__init__.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import +from ._operations import ServicePatternsOperations # type: ignore from ._operations import ConnectionsOperations # type: ignore from ._operations import EvaluationsOperations # type: ignore from ._operations import DatasetsOperations # type: ignore @@ -25,6 +26,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "ServicePatternsOperations", "ConnectionsOperations", "EvaluationsOperations", "DatasetsOperations", diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/_operations.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/_operations.py similarity index 90% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/_operations.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/_operations.py index f06d7e51ca74..c35e8eba1e7b 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/_operations.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/_operations.py @@ -31,7 +31,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .. import models as _models1 +from .. import models as _models from .._configuration import AIProjectClientConfiguration from .._model_base import SdkJSONEncoder, _deserialize from .._serialization import Deserializer, Serializer @@ -75,7 +75,7 @@ def build_connections_get_request(name: str, **kwargs: Any) -> HttpRequest: def build_connections_list_request( *, - connection_type: Optional[Union[str, _models1.ConnectionType]] = None, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, top: Optional[int] = None, skip: Optional[int] = None, maxpagesize: Optional[int] = None, @@ -186,7 +186,7 @@ def build_datasets_list_versions_request( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -225,7 +225,7 @@ def build_datasets_list_latest_request( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -376,7 +376,7 @@ def build_datasets_start_pending_upload_version_request( # pylint: disable=name accept = _headers.pop("Accept", "application/json") # Construct URL - _url = "/datasets/{name}/versions/{version}/startPendingUploadVersion" + _url = "/datasets/{name}/versions/{version}/startPendingUpload" path_format_arguments = { "name": _SERIALIZER.url("name", name, "str"), "version": _SERIALIZER.url("version", version, "str"), @@ -430,7 +430,7 @@ def build_indexes_list_versions_request( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -469,7 +469,7 @@ def build_indexes_list_latest_request( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -676,7 +676,7 @@ def build_evaluation_results_list_versions_request( # pylint: disable=name-too- top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -715,7 +715,7 @@ def build_evaluation_results_list_latest_request( # pylint: disable=name-too-lo top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -964,13 +964,35 @@ def build_red_teams_create_run_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +class ServicePatternsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.onedp.AIProjectClient`'s + :attr:`service_patterns` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.building_blocks = ServicePatternsBuildingBlocksOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + class ConnectionsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`connections` attribute. """ @@ -982,13 +1004,13 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, name: str, **kwargs: Any) -> _models1.Connection: + def get(self, name: str, **kwargs: Any) -> _models.Connection: """Get a connection by name. :param name: The name of the resource. Required. :type name: str :return: Connection. The Connection is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Connection + :rtype: ~azure.ai.projects.onedp.models.Connection :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1002,7 +1024,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Connection: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.Connection] = kwargs.pop("cls", None) + cls: ClsType[_models.Connection] = kwargs.pop("cls", None) _request = build_connections_get_request( name=name, @@ -1039,7 +1061,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Connection: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Connection, response.json()) + deserialized = _deserialize(_models.Connection, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1050,30 +1072,30 @@ def get(self, name: str, **kwargs: Any) -> _models1.Connection: def list( self, *, - connection_type: Optional[Union[str, _models1.ConnectionType]] = None, + connection_type: Optional[Union[str, _models.ConnectionType]] = None, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models1.Connection"]: + ) -> Iterable["_models.Connection"]: """List all connections in the project. :keyword connection_type: Specific type of connection to return in list. Known values are: "AzureOpenAI", "AzureBlob", "CognitiveSearch", "CosmosDB", "ApiKey", "AppInsights", and "CustomKeys". Default value is None. - :paramtype connection_type: str or ~azure.ai.projects.models.ConnectionType + :paramtype connection_type: str or ~azure.ai.projects.onedp.models.ConnectionType :keyword top: The number of result items to return. Default value is None. :paramtype top: int :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of Connection - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Connection] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.Connection] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models1.Connection]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Connection]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1126,7 +1148,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.Connection], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Connection], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1155,7 +1177,7 @@ class EvaluationsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`evaluations` attribute. """ @@ -1171,13 +1193,13 @@ def __init__(self, *args, **kwargs): method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "name", "client_request_id", "accept"]}, ) - def get(self, name: str, **kwargs: Any) -> _models1.Evaluation: + def get(self, name: str, **kwargs: Any) -> _models.Evaluation: """Get an evaluation run by name. :param name: Identifier of the evaluation. Required. :type name: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1191,7 +1213,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Evaluation: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.Evaluation] = kwargs.pop("cls", None) + cls: ClsType[_models.Evaluation] = kwargs.pop("cls", None) _request = build_evaluations_get_request( name=name, @@ -1228,7 +1250,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Evaluation: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Evaluation, response.json()) + deserialized = _deserialize(_models.Evaluation, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1244,7 +1266,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Evaluation: ) def list( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models1.Evaluation"]: + ) -> Iterable["_models.Evaluation"]: """List evaluation runs. :keyword top: The number of result items to return. Default value is None. @@ -1252,14 +1274,14 @@ def list( :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of Evaluation - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Evaluation] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.Evaluation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models1.Evaluation]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Evaluation]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1311,7 +1333,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.Evaluation], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Evaluation], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1335,24 +1357,24 @@ def get_next(next_link=None): @overload def create_run( - self, evaluation: _models1.Evaluation, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Evaluation: + self, evaluation: _models.Evaluation, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Required. - :type evaluation: ~azure.ai.projects.models.Evaluation + :type evaluation: ~azure.ai.projects.onedp.models.Evaluation :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_run( self, evaluation: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Evaluation: + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Required. @@ -1361,14 +1383,14 @@ def create_run( Default value is "application/json". :paramtype content_type: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_run( self, evaluation: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Evaluation: + ) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Required. @@ -1377,7 +1399,7 @@ def create_run( Default value is "application/json". :paramtype content_type: str :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ @@ -1386,14 +1408,14 @@ def create_run( method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "content_type", "accept"]}, ) - def create_run(self, evaluation: Union[_models1.Evaluation, JSON, IO[bytes]], **kwargs: Any) -> _models1.Evaluation: + def create_run(self, evaluation: Union[_models.Evaluation, JSON, IO[bytes]], **kwargs: Any) -> _models.Evaluation: """Creates an evaluation run. :param evaluation: Evaluation to be run. Is one of the following types: Evaluation, JSON, IO[bytes] Required. - :type evaluation: ~azure.ai.projects.models.Evaluation or JSON or IO[bytes] + :type evaluation: ~azure.ai.projects.onedp.models.Evaluation or JSON or IO[bytes] :return: Evaluation. The Evaluation is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Evaluation + :rtype: ~azure.ai.projects.onedp.models.Evaluation :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1408,7 +1430,7 @@ def create_run(self, evaluation: Union[_models1.Evaluation, JSON, IO[bytes]], ** _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Evaluation] = kwargs.pop("cls", None) + cls: ClsType[_models.Evaluation] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1448,7 +1470,7 @@ def create_run(self, evaluation: Union[_models1.Evaluation, JSON, IO[bytes]], ** if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Evaluation, response.json()) + deserialized = _deserialize(_models.Evaluation, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1462,7 +1484,7 @@ class DatasetsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`datasets` attribute. """ @@ -1481,9 +1503,9 @@ def list_versions( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> Iterable["_models1.DatasetVersion"]: + ) -> Iterable["_models.DatasetVersion"]: """List all versions of the given DatasetVersion. :param name: The name of the resource. Required. @@ -1499,15 +1521,15 @@ def list_versions( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1561,7 +1583,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.DatasetVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.DatasetVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1590,9 +1612,9 @@ def list_latest( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> Iterable["_models1.DatasetVersion"]: + ) -> Iterable["_models.DatasetVersion"]: """List the latest version of each DatasetVersion. :keyword top: Top count of results, top count cannot be greater than the page size. If topCount @@ -1606,15 +1628,15 @@ def list_latest( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of DatasetVersion - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.DatasetVersion] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.DatasetVersion] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.DatasetVersion]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.DatasetVersion]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1667,7 +1689,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.DatasetVersion], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.DatasetVersion], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -1690,7 +1712,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.DatasetVersion: + def get_version(self, name: str, version: str, **kwargs: Any) -> _models.DatasetVersion: """Get the specific version of the DatasetVersion. :param name: The name of the resource. Required. @@ -1698,7 +1720,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Datase :param version: The specific version id of the DatasetVersion to retrieve. Required. :type version: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1712,7 +1734,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Datase _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) _request = build_datasets_get_version_request( name=name, @@ -1745,7 +1767,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Datase if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.DatasetVersion, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1807,26 +1829,26 @@ def delete_version( # pylint: disable=inconsistent-return-statements @overload def create( - self, name: str, body: _models1.DatasetVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DatasetVersion: + self, name: str, body: _models.DatasetVersion, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the DatasetVersion to create. Required. - :type body: ~azure.ai.projects.models.DatasetVersion + :type body: ~azure.ai.projects.onedp.models.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -1837,14 +1859,14 @@ def create( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -1855,23 +1877,23 @@ def create( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def create( - self, name: str, body: Union[_models1.DatasetVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.DatasetVersion: + self, name: str, body: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: """Create a new DatasetVersion. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the DatasetVersion to create. Is one of the following types: DatasetVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1886,7 +1908,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -1935,7 +1957,7 @@ def create( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.DatasetVersion, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -1947,11 +1969,11 @@ def create_version( self, name: str, version: str, - body: _models1.DatasetVersion, + body: _models.DatasetVersion, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -1959,19 +1981,19 @@ def create_version( :param version: The specific version id of the DatasetVersion to create or replace. Required. :type version: str :param body: The definition of the DatasetVersion to create. Required. - :type body: ~azure.ai.projects.models.DatasetVersion + :type body: ~azure.ai.projects.onedp.models.DatasetVersion :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -1984,14 +2006,14 @@ def create_version( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.DatasetVersion: + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -2004,14 +2026,14 @@ def create_version( Default value is "application/json". :paramtype content_type: str :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def create_version( - self, name: str, version: str, body: Union[_models1.DatasetVersion, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.DatasetVersion: + self, name: str, version: str, body: Union[_models.DatasetVersion, JSON, IO[bytes]], **kwargs: Any + ) -> _models.DatasetVersion: """Create a new or replace an existing DatasetVersion with the given version id. :param name: The name of the resource. Required. @@ -2020,9 +2042,9 @@ def create_version( :type version: str :param body: The definition of the DatasetVersion to create. Is one of the following types: DatasetVersion, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.DatasetVersion or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.DatasetVersion or JSON or IO[bytes] :return: DatasetVersion. The DatasetVersion is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.DatasetVersion + :rtype: ~azure.ai.projects.onedp.models.DatasetVersion :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2037,7 +2059,7 @@ def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.DatasetVersion] = kwargs.pop("cls", None) + cls: ClsType[_models.DatasetVersion] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2079,7 +2101,7 @@ def create_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.DatasetVersion, response.json()) + deserialized = _deserialize(_models.DatasetVersion, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2091,11 +2113,11 @@ def start_pending_upload_version( self, name: str, version: str, - body: _models1.PendingUploadRequest, + body: _models.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2103,19 +2125,19 @@ def start_pending_upload_version( :param version: The specific version id of the DatasetVersion to operate on. Required. :type version: str :param body: Parameters for the action. Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def start_pending_upload_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2128,14 +2150,14 @@ def start_pending_upload_version( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def start_pending_upload_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2148,14 +2170,14 @@ def start_pending_upload_version( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def start_pending_upload_version( - self, name: str, version: str, body: Union[_models1.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.PendingUploadResponse: + self, name: str, version: str, body: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset for a specific version. :param name: The name of the resource. Required. @@ -2164,9 +2186,9 @@ def start_pending_upload_version( :type version: str :param body: Parameters for the action. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest or JSON or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2181,7 +2203,7 @@ def start_pending_upload_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.PendingUploadResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2223,7 +2245,7 @@ def start_pending_upload_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2232,26 +2254,26 @@ def start_pending_upload_version( @overload def start_pending_upload( - self, name: str, body: _models1.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + self, name: str, body: _models.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: Parameters for the action. Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def start_pending_upload( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -2262,14 +2284,14 @@ def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def start_pending_upload( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -2280,23 +2302,23 @@ def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def start_pending_upload( - self, name: str, body: Union[_models1.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.PendingUploadResponse: + self, name: str, body: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a dataset. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: Parameters for the action. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest or JSON or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2311,7 +2333,7 @@ def start_pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.PendingUploadResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2352,7 +2374,7 @@ def start_pending_upload( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2366,7 +2388,7 @@ class IndexesOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`indexes` attribute. """ @@ -2385,9 +2407,9 @@ def list_versions( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> Iterable["_models1.Index"]: + ) -> Iterable["_models.Index"]: """List all versions of the given Index. :param name: The name of the resource. Required. @@ -2403,15 +2425,15 @@ def list_versions( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of Index - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2465,7 +2487,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.Index], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Index], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2494,9 +2516,9 @@ def list_latest( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> Iterable["_models1.Index"]: + ) -> Iterable["_models.Index"]: """List the latest version of each Index. :keyword top: Top count of results, top count cannot be greater than the page size. If topCount @@ -2510,15 +2532,15 @@ def list_latest( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of Index - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Index] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.Index] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.Index]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Index]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -2571,7 +2593,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.Index], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Index], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -2594,7 +2616,7 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Index: + def get_version(self, name: str, version: str, **kwargs: Any) -> _models.Index: """Get the specific version of the Index. :param name: The name of the resource. Required. @@ -2602,7 +2624,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Index: :param version: The specific version id of the Index to retrieve. Required. :type version: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2616,7 +2638,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Index: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) _request = build_indexes_get_version_request( name=name, @@ -2649,7 +2671,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Index: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Index, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2711,24 +2733,24 @@ def delete_version( # pylint: disable=inconsistent-return-statements @overload def create( - self, name: str, body: _models1.Index, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Index: + self, name: str, body: _models.Index, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the Index to create. Required. - :type body: ~azure.ai.projects.models.Index + :type body: ~azure.ai.projects.onedp.models.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create(self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models1.Index: + def create(self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -2739,14 +2761,14 @@ def create(self, name: str, body: JSON, *, content_type: str = "application/json Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Index: + ) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -2757,21 +2779,21 @@ def create( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create(self, name: str, body: Union[_models1.Index, JSON, IO[bytes]], **kwargs: Any) -> _models1.Index: + def create(self, name: str, body: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any) -> _models.Index: """Create a new Index. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the Index to create. Is one of the following types: Index, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2786,7 +2808,7 @@ def create(self, name: str, body: Union[_models1.Index, JSON, IO[bytes]], **kwar _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2835,7 +2857,7 @@ def create(self, name: str, body: Union[_models1.Index, JSON, IO[bytes]], **kwar if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Index, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -2844,8 +2866,8 @@ def create(self, name: str, body: Union[_models1.Index, JSON, IO[bytes]], **kwar @overload def create_version( - self, name: str, version: str, body: _models1.Index, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Index: + self, name: str, version: str, body: _models.Index, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -2853,19 +2875,19 @@ def create_version( :param version: The specific version id of the Index to create or replace. Required. :type version: str :param body: The definition of the Index to create. Required. - :type body: ~azure.ai.projects.models.Index + :type body: ~azure.ai.projects.onedp.models.Index :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Index: + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -2878,14 +2900,14 @@ def create_version( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.Index: + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -2898,14 +2920,14 @@ def create_version( Default value is "application/json". :paramtype content_type: str :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace def create_version( - self, name: str, version: str, body: Union[_models1.Index, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.Index: + self, name: str, version: str, body: Union[_models.Index, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Index: """Create a new or replace an existing Index with the given version id. :param name: The name of the resource. Required. @@ -2914,9 +2936,9 @@ def create_version( :type version: str :param body: The definition of the Index to create. Is one of the following types: Index, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.Index or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.Index or JSON or IO[bytes] :return: Index. The Index is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Index + :rtype: ~azure.ai.projects.onedp.models.Index :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2931,7 +2953,7 @@ def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.Index] = kwargs.pop("cls", None) + cls: ClsType[_models.Index] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -2973,7 +2995,7 @@ def create_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Index, response.json()) + deserialized = _deserialize(_models.Index, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -2987,7 +3009,7 @@ class DeploymentsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`deployments` attribute. """ @@ -2999,13 +3021,13 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, name: str, **kwargs: Any) -> _models1.Deployment: + def get(self, name: str, **kwargs: Any) -> _models.Deployment: """Get a deployed model. :param name: Name of the deployment. Required. :type name: str :return: Deployment. The Deployment is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.Deployment + :rtype: ~azure.ai.projects.onedp.models.Deployment :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3019,7 +3041,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Deployment: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.Deployment] = kwargs.pop("cls", None) + cls: ClsType[_models.Deployment] = kwargs.pop("cls", None) _request = build_deployments_get_request( name=name, @@ -3056,7 +3078,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.Deployment: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.Deployment, response.json()) + deserialized = _deserialize(_models.Deployment, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3072,7 +3094,7 @@ def list( top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models1.Deployment"]: + ) -> Iterable["_models.Deployment"]: """List all deployed models in the project. :keyword model_publisher: Model publisher to filter models by. Default value is None. @@ -3085,14 +3107,14 @@ def list( :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of Deployment - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.Deployment] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.Deployment] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models1.Deployment]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.Deployment]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3146,7 +3168,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.Deployment], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.Deployment], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3175,7 +3197,7 @@ class EvaluationResultsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`evaluation_results` attribute. """ @@ -3200,9 +3222,9 @@ def list_versions( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> Iterable["_models1.EvaluationResult"]: + ) -> Iterable["_models.EvaluationResult"]: """List all versions of the given EvaluationResult. :param name: The name of the resource. Required. @@ -3218,15 +3240,15 @@ def list_versions( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of EvaluationResult - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluationResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.EvaluationResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.EvaluationResult]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EvaluationResult]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3280,7 +3302,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.EvaluationResult], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluationResult], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3313,9 +3335,9 @@ def list_latest( top: Optional[int] = None, skip: Optional[str] = None, tags: Optional[str] = None, - list_view_type: Optional[Union[str, _models1.ListViewType]] = None, + list_view_type: Optional[Union[str, _models.ListViewType]] = None, **kwargs: Any - ) -> Iterable["_models1.EvaluationResult"]: + ) -> Iterable["_models.EvaluationResult"]: """List the latest version of each EvaluationResult. :keyword top: Top count of results, top count cannot be greater than the page size. If topCount @@ -3329,15 +3351,15 @@ def list_latest( :keyword list_view_type: [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Known values are: "ActiveOnly", "ArchivedOnly", and "All". Default value is None. - :paramtype list_view_type: str or ~azure.ai.projects.models.ListViewType + :paramtype list_view_type: str or ~azure.ai.projects.onedp.models.ListViewType :return: An iterator like instance of EvaluationResult - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.EvaluationResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.EvaluationResult] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[List[_models1.EvaluationResult]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.EvaluationResult]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -3390,7 +3412,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.EvaluationResult], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.EvaluationResult], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -3417,7 +3439,7 @@ def get_next(next_link=None): method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "name", "version", "accept"]}, ) - def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.EvaluationResult: + def get_version(self, name: str, version: str, **kwargs: Any) -> _models.EvaluationResult: """Get the specific version of the EvaluationResult. :param name: The name of the resource. Required. @@ -3425,7 +3447,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Evalua :param version: The specific version id of the EvaluationResult to retrieve. Required. :type version: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3439,7 +3461,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Evalua _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.EvaluationResult] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationResult] = kwargs.pop("cls", None) _request = build_evaluation_results_get_version_request( name=name, @@ -3472,7 +3494,7 @@ def get_version(self, name: str, version: str, **kwargs: Any) -> _models1.Evalua if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.EvaluationResult, response.json()) + deserialized = _deserialize(_models.EvaluationResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3538,26 +3560,26 @@ def delete_version( # pylint: disable=inconsistent-return-statements @overload def create( - self, name: str, body: _models1.EvaluationResult, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.EvaluationResult: + self, name: str, body: _models.EvaluationResult, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the EvaluationResult to create. Required. - :type body: ~azure.ai.projects.models.EvaluationResult + :type body: ~azure.ai.projects.onedp.models.EvaluationResult :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( self, name: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -3568,14 +3590,14 @@ def create( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create( self, name: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. @@ -3586,7 +3608,7 @@ def create( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3606,17 +3628,17 @@ def create( }, ) def create( - self, name: str, body: Union[_models1.EvaluationResult, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.EvaluationResult: + self, name: str, body: Union[_models.EvaluationResult, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationResult: """Create a new EvaluationResult. The version id will be generated by the service. :param name: The name of the resource. Required. :type name: str :param body: The definition of the EvaluationResult to create. Is one of the following types: EvaluationResult, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationResult or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.EvaluationResult or JSON or IO[bytes] :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3631,7 +3653,7 @@ def create( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.EvaluationResult] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -3680,7 +3702,7 @@ def create( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.EvaluationResult, response.json()) + deserialized = _deserialize(_models.EvaluationResult, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -3692,11 +3714,11 @@ def create_version( self, name: str, version: str, - body: _models1.EvaluationResult, + body: _models.EvaluationResult, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -3704,19 +3726,19 @@ def create_version( :param version: The specific version id of the EvaluationResult to create or replace. Required. :type version: str :param body: The definition of the EvaluationResult to create. Required. - :type body: ~azure.ai.projects.models.EvaluationResult + :type body: ~azure.ai.projects.onedp.models.EvaluationResult :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_version( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -3729,14 +3751,14 @@ def create_version( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_version( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.EvaluationResult: + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -3749,7 +3771,7 @@ def create_version( Default value is "application/json". :paramtype content_type: str :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3759,8 +3781,8 @@ def create_version( params_added_on={"2025-05-15-preview": ["api_version", "name", "version", "content_type", "accept"]}, ) def create_version( - self, name: str, version: str, body: Union[_models1.EvaluationResult, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.EvaluationResult: + self, name: str, version: str, body: Union[_models.EvaluationResult, JSON, IO[bytes]], **kwargs: Any + ) -> _models.EvaluationResult: """Create a new or replace an existing EvaluationResult with the given version id. :param name: The name of the resource. Required. @@ -3769,9 +3791,9 @@ def create_version( :type version: str :param body: The definition of the EvaluationResult to create. Is one of the following types: EvaluationResult, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.EvaluationResult or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.EvaluationResult or JSON or IO[bytes] :return: EvaluationResult. The EvaluationResult is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.EvaluationResult + :rtype: ~azure.ai.projects.onedp.models.EvaluationResult :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3786,7 +3808,7 @@ def create_version( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.EvaluationResult] = kwargs.pop("cls", None) + cls: ClsType[_models.EvaluationResult] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -3828,7 +3850,7 @@ def create_version( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.EvaluationResult, response.json()) + deserialized = _deserialize(_models.EvaluationResult, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3840,11 +3862,11 @@ def start_pending_upload( self, name: str, version: str, - body: _models1.PendingUploadRequest, + body: _models.PendingUploadRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -3852,19 +3874,19 @@ def start_pending_upload( :param version: The specific version id of the EvaluationResult to operate on. Required. :type version: str :param body: Parameters for the action. Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def start_pending_upload( self, name: str, version: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -3877,14 +3899,14 @@ def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload def start_pending_upload( self, name: str, version: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.PendingUploadResponse: + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -3897,7 +3919,7 @@ def start_pending_upload( Default value is "application/json". :paramtype content_type: str :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ @@ -3907,8 +3929,8 @@ def start_pending_upload( params_added_on={"2025-05-15-preview": ["api_version", "name", "version", "content_type", "accept"]}, ) def start_pending_upload( - self, name: str, version: str, body: Union[_models1.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any - ) -> _models1.PendingUploadResponse: + self, name: str, version: str, body: Union[_models.PendingUploadRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.PendingUploadResponse: """Create or start a pending upload of a evaluation results for a specific version. :param name: The name of the resource. Required. @@ -3917,9 +3939,9 @@ def start_pending_upload( :type version: str :param body: Parameters for the action. Is one of the following types: PendingUploadRequest, JSON, IO[bytes] Required. - :type body: ~azure.ai.projects.models.PendingUploadRequest or JSON or IO[bytes] + :type body: ~azure.ai.projects.onedp.models.PendingUploadRequest or JSON or IO[bytes] :return: PendingUploadResponse. The PendingUploadResponse is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.PendingUploadResponse + :rtype: ~azure.ai.projects.onedp.models.PendingUploadResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -3934,7 +3956,7 @@ def start_pending_upload( _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.PendingUploadResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.PendingUploadResponse] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -3976,7 +3998,7 @@ def start_pending_upload( if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.PendingUploadResponse, response.json()) + deserialized = _deserialize(_models.PendingUploadResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -3990,7 +4012,7 @@ class RedTeamsOperations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.ai.projects.AIProjectClient`'s + :class:`~azure.ai.projects.onedp.AIProjectClient`'s :attr:`red_teams` attribute. """ @@ -4006,13 +4028,13 @@ def __init__(self, *args, **kwargs): method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "name", "client_request_id", "accept"]}, ) - def get(self, name: str, **kwargs: Any) -> _models1.RedTeam: + def get(self, name: str, **kwargs: Any) -> _models.RedTeam: """Get a redteam by name. :param name: Identifier of the red team. Required. :type name: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4026,7 +4048,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.RedTeam: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models1.RedTeam] = kwargs.pop("cls", None) + cls: ClsType[_models.RedTeam] = kwargs.pop("cls", None) _request = build_red_teams_get_request( name=name, @@ -4063,7 +4085,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.RedTeam: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.RedTeam, response.json()) + deserialized = _deserialize(_models.RedTeam, response.json()) if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore @@ -4079,7 +4101,7 @@ def get(self, name: str, **kwargs: Any) -> _models1.RedTeam: ) def list( self, *, top: Optional[int] = None, skip: Optional[int] = None, **kwargs: Any - ) -> Iterable["_models1.RedTeam"]: + ) -> Iterable["_models.RedTeam"]: """List a redteam by name. :keyword top: The number of result items to return. Default value is None. @@ -4087,14 +4109,14 @@ def list( :keyword skip: The number of result items to skip. Default value is None. :paramtype skip: int :return: An iterator like instance of RedTeam - :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.models.RedTeam] + :rtype: ~azure.core.paging.ItemPaged[~azure.ai.projects.onedp.models.RedTeam] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} maxpagesize = kwargs.pop("maxpagesize", None) - cls: ClsType[List[_models1.RedTeam]] = kwargs.pop("cls", None) + cls: ClsType[List[_models.RedTeam]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -4146,7 +4168,7 @@ def prepare_request(next_link=None): def extract_data(pipeline_response): deserialized = pipeline_response.http_response.json() - list_of_elem = _deserialize(List[_models1.RedTeam], deserialized.get("value", [])) + list_of_elem = _deserialize(List[_models.RedTeam], deserialized.get("value", [])) if cls: list_of_elem = cls(list_of_elem) # type: ignore return deserialized.get("nextLink") or None, iter(list_of_elem) @@ -4170,22 +4192,22 @@ def get_next(next_link=None): @overload def create_run( - self, red_team: _models1.RedTeam, *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.RedTeam: + self, red_team: _models.RedTeam, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Required. - :type red_team: ~azure.ai.projects.models.RedTeam + :type red_team: ~azure.ai.projects.onedp.models.RedTeam :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_run(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models1.RedTeam: + def create_run(self, red_team: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Required. @@ -4194,14 +4216,14 @@ def create_run(self, red_team: JSON, *, content_type: str = "application/json", Default value is "application/json". :paramtype content_type: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ @overload def create_run( self, red_team: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models1.RedTeam: + ) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Required. @@ -4210,7 +4232,7 @@ def create_run( Default value is "application/json". :paramtype content_type: str :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ @@ -4219,14 +4241,14 @@ def create_run( method_added_on="2025-05-15-preview", params_added_on={"2025-05-15-preview": ["api_version", "content_type", "accept"]}, ) - def create_run(self, red_team: Union[_models1.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models1.RedTeam: + def create_run(self, red_team: Union[_models.RedTeam, JSON, IO[bytes]], **kwargs: Any) -> _models.RedTeam: """Creates a redteam run. :param red_team: Redteam to be run. Is one of the following types: RedTeam, JSON, IO[bytes] Required. - :type red_team: ~azure.ai.projects.models.RedTeam or JSON or IO[bytes] + :type red_team: ~azure.ai.projects.onedp.models.RedTeam or JSON or IO[bytes] :return: RedTeam. The RedTeam is compatible with MutableMapping - :rtype: ~azure.ai.projects.models.RedTeam + :rtype: ~azure.ai.projects.onedp.models.RedTeam :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -4241,7 +4263,7 @@ def create_run(self, red_team: Union[_models1.RedTeam, JSON, IO[bytes]], **kwarg _params = kwargs.pop("params", {}) or {} content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models1.RedTeam] = kwargs.pop("cls", None) + cls: ClsType[_models.RedTeam] = kwargs.pop("cls", None) content_type = content_type or "application/json" _content = None @@ -4281,9 +4303,27 @@ def create_run(self, red_team: Union[_models1.RedTeam, JSON, IO[bytes]], **kwarg if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models1.RedTeam, response.json()) + deserialized = _deserialize(_models.RedTeam, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + +class ServicePatternsBuildingBlocksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.ai.projects.onedp.AIProjectClient`'s + :attr:`building_blocks` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: AIProjectClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/_patch.py similarity index 95% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/_patch.py index 2be105b5fd7f..3cc5cee5e67a 100644 --- a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/operations/_patch.py +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/operations/_patch.py @@ -51,7 +51,7 @@ def _create_dataset_and_get_its_container_client( body=PendingUploadRequest(pending_upload_type=PendingUploadType.TEMPORARY_BLOB_REFERENCE), ) if pending_upload_response.dataset_version: - output_version: str = pending_upload_response.dataset_version + output_version: str = pending_upload_response.dataset_version else: raise ValueError("Dataset version is not present in the response") @@ -102,9 +102,12 @@ def _create_dataset_and_get_its_container_client( # https://learn.microsoft.com/azure/storage/blobs/storage-blob-upload-python # See https://learn.microsoft.com/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python#azure-storage-blob-containerclient-from-container-url - return ContainerClient.from_container_url( - container_url=pending_upload_response.blob_reference_for_consumption.blob_uri, # Of the form: "https://.blob.core.windows.net/?" - ), output_version + return ( + ContainerClient.from_container_url( + container_url=pending_upload_response.blob_reference_for_consumption.blob_uri, # Of the form: "https://.blob.core.windows.net/?" + ), + output_version, + ) def upload_file_and_create( self, *, name: str, version: Optional[str] = None, file: str, **kwargs: Any @@ -130,7 +133,9 @@ def upload_file_and_create( if path_file.is_dir(): raise ValueError("The provided file is actually a folder. Use method `create_and_upload_folder` instead") - container_client, output_version = self._create_dataset_and_get_its_container_client(name=name, input_version=version) + container_client, output_version = self._create_dataset_and_get_its_container_client( + name=name, input_version=version + ) with container_client: @@ -186,7 +191,9 @@ def upload_folder_and_create_version( if Path(path_folder).is_file(): raise ValueError("The provided folder is actually a file. Use method `create_and_upload_file` instead.") - container_client, output_version = self._create_dataset_and_get_its_container_client(name=name, input_version=version) + container_client, output_version = self._create_dataset_and_get_its_container_client( + name=name, input_version=version + ) with container_client: diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/py.typed b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/py.typed similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/py.typed rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/py.typed diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/operations/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/operations/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/operations/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/operations/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/operations/_operations.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/operations/_operations.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/operations/_operations.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/operations/_operations.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/operations/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/operations/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/aio/operations/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/aio/operations/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/__init__.py diff --git a/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/__init__.py new file mode 100644 index 000000000000..d55ccad1f573 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/operations/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/operations/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/operations/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/operations/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/operations/_operations.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/operations/_operations.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/operations/_operations.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/operations/_operations.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/operations/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/operations/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/aio/operations/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/aio/operations/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/operations/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/operations/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/operations/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/operations/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/operations/_operations.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/operations/_operations.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/operations/_operations.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/operations/_operations.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/operations/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/operations/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/buildingblocks/operations/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/buildingblocks/operations/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/operations/__init__.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/operations/__init__.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/operations/__init__.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/operations/__init__.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/operations/_operations.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/operations/_operations.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/operations/_operations.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/operations/_operations.py diff --git a/sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/operations/_patch.py b/sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/operations/_patch.py similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/azure/ai/projects/servicepatterns/operations/_patch.py rename to sdk/ai/azure-ai-projects-onedp/azure/ai/projects/onedp/servicepatterns/operations/_patch.py diff --git a/sdk/ai/azure-ai-projects-dp1/dev_requirements.txt b/sdk/ai/azure-ai-projects-onedp/dev_requirements.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/dev_requirements.txt rename to sdk/ai/azure-ai-projects-onedp/dev_requirements.txt diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/conftest.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/conftest.py new file mode 100644 index 000000000000..dd8e527abab1 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + aiproject_subscription_id = os.environ.get("AIPROJECT_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + aiproject_tenant_id = os.environ.get("AIPROJECT_TENANT_ID", "00000000-0000-0000-0000-000000000000") + aiproject_client_id = os.environ.get("AIPROJECT_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + aiproject_client_secret = os.environ.get("AIPROJECT_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aiproject_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aiproject_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aiproject_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=aiproject_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations.py new file mode 100644 index 000000000000..a3cde4337fbe --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectConnectionsOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_connections_get(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.connections.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_connections_list(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.connections.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations_async.py new file mode 100644 index 000000000000..27f8d231a481 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_connections_operations_async.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectConnectionsOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_connections_get(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.connections.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_connections_list(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.connections.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations.py new file mode 100644 index 000000000000..0a9241cd13bc --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations.py @@ -0,0 +1,129 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectDatasetsOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_list_versions(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.list_versions( + name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_list_latest(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.list_latest() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_get_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.get_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_delete_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.delete_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_create(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.create( + name="str", + body={ + "datasetUri": "str", + "name": "str", + "openAIPurpose": "str", + "type": "uri_file", + "version": "str", + "description": "str", + "id": "str", + "isReference": bool, + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_create_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.create_version( + name="str", + version="str", + body={ + "datasetUri": "str", + "name": "str", + "openAIPurpose": "str", + "type": "uri_file", + "version": "str", + "description": "str", + "id": "str", + "isReference": bool, + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_start_pending_upload_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.start_pending_upload_version( + name="str", + version="str", + body={"pendingUploadType": "str", "connectionName": "str", "pendingUploadId": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_datasets_start_pending_upload(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.datasets.start_pending_upload( + name="str", + body={"pendingUploadType": "str", "connectionName": "str", "pendingUploadId": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations_async.py new file mode 100644 index 000000000000..a1b34b002a18 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_datasets_operations_async.py @@ -0,0 +1,130 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectDatasetsOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_list_versions(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.datasets.list_versions( + name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_list_latest(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.datasets.list_latest() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_get_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.datasets.get_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_delete_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.datasets.delete_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_create(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.datasets.create( + name="str", + body={ + "datasetUri": "str", + "name": "str", + "openAIPurpose": "str", + "type": "uri_file", + "version": "str", + "description": "str", + "id": "str", + "isReference": bool, + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_create_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.datasets.create_version( + name="str", + version="str", + body={ + "datasetUri": "str", + "name": "str", + "openAIPurpose": "str", + "type": "uri_file", + "version": "str", + "description": "str", + "id": "str", + "isReference": bool, + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_start_pending_upload_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.datasets.start_pending_upload_version( + name="str", + version="str", + body={"pendingUploadType": "str", "connectionName": "str", "pendingUploadId": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_datasets_start_pending_upload(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.datasets.start_pending_upload( + name="str", + body={"pendingUploadType": "str", "connectionName": "str", "pendingUploadId": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations.py new file mode 100644 index 000000000000..b0e1e586d866 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations.py @@ -0,0 +1,33 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectDeploymentsOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_deployments_get(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.deployments.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_deployments_list(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.deployments.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations_async.py new file mode 100644 index 000000000000..3958d83eab29 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_deployments_operations_async.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectDeploymentsOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_deployments_get(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.deployments.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_deployments_list(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.deployments.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations.py new file mode 100644 index 000000000000..b68d4d88d17a --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectEvaluationResultsOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_list_versions(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.list_versions( + name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_list_latest(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.list_latest() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_get_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.get_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_delete_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.delete_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_create(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.create( + name="str", + body={ + "name": "str", + "version": "str", + "BlobUri": "str", + "DatasetFamily": "str", + "DatasetName": "str", + "Metrics": {"str": 0.0}, + "ModelAssetId": "str", + "ModelName": "str", + "ModelVersion": "str", + "ResultType": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_create_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.create_version( + name="str", + version="str", + body={ + "name": "str", + "version": "str", + "BlobUri": "str", + "DatasetFamily": "str", + "DatasetName": "str", + "Metrics": {"str": 0.0}, + "ModelAssetId": "str", + "ModelName": "str", + "ModelVersion": "str", + "ResultType": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluation_results_start_pending_upload(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.start_pending_upload( + name="str", + version="str", + body={"pendingUploadType": "str", "connectionName": "str", "pendingUploadId": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations_async.py new file mode 100644 index 000000000000..b90df81464cd --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluation_results_operations_async.py @@ -0,0 +1,126 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectEvaluationResultsOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_list_versions(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.list_versions( + name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_list_latest(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.evaluation_results.list_latest() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_get_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluation_results.get_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_delete_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluation_results.delete_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_create(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluation_results.create( + name="str", + body={ + "name": "str", + "version": "str", + "BlobUri": "str", + "DatasetFamily": "str", + "DatasetName": "str", + "Metrics": {"str": 0.0}, + "ModelAssetId": "str", + "ModelName": "str", + "ModelVersion": "str", + "ResultType": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_create_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluation_results.create_version( + name="str", + version="str", + body={ + "name": "str", + "version": "str", + "BlobUri": "str", + "DatasetFamily": "str", + "DatasetName": "str", + "Metrics": {"str": 0.0}, + "ModelAssetId": "str", + "ModelName": "str", + "ModelVersion": "str", + "ResultType": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluation_results_start_pending_upload(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluation_results.start_pending_upload( + name="str", + version="str", + body={"pendingUploadType": "str", "connectionName": "str", "pendingUploadId": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations.py new file mode 100644 index 000000000000..b689851e0c0b --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations.py @@ -0,0 +1,54 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectEvaluationsOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluations_get(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluations.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluations_list(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluations.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_evaluations_create_run(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.evaluations.create_run( + evaluation={ + "data": "input_data", + "evaluators": {"str": {"id": "str", "dataMapping": {"str": "str"}, "initParams": {"str": {}}}}, + "id": "str", + "outputs": {"str": "str"}, + "description": "str", + "displayName": "str", + "properties": {"str": "str"}, + "status": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations_async.py new file mode 100644 index 000000000000..8f7309a47de4 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_evaluations_operations_async.py @@ -0,0 +1,55 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectEvaluationsOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluations_get(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluations.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluations_list(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.evaluations.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_evaluations_create_run(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.evaluations.create_run( + evaluation={ + "data": "input_data", + "evaluators": {"str": {"id": "str", "dataMapping": {"str": "str"}, "initParams": {"str": {}}}}, + "id": "str", + "outputs": {"str": "str"}, + "description": "str", + "displayName": "str", + "properties": {"str": "str"}, + "status": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations.py new file mode 100644 index 000000000000..9a9e4dc614a8 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectIndexesOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_indexes_list_versions(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.indexes.list_versions( + name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_indexes_list_latest(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.indexes.list_latest() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_indexes_get_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.indexes.get_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_indexes_delete_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.indexes.delete_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_indexes_create(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.indexes.create( + name="str", + body={ + "connectionName": "str", + "indexName": "str", + "name": "str", + "type": "AzureSearch", + "version": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_indexes_create_version(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.indexes.create_version( + name="str", + version="str", + body={ + "connectionName": "str", + "indexName": "str", + "name": "str", + "type": "AzureSearch", + "version": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations_async.py new file mode 100644 index 000000000000..a54e2fedb856 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_indexes_operations_async.py @@ -0,0 +1,103 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectIndexesOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_indexes_list_versions(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.indexes.list_versions( + name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_indexes_list_latest(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.indexes.list_latest() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_indexes_get_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.indexes.get_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_indexes_delete_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.indexes.delete_version( + name="str", + version="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_indexes_create(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.indexes.create( + name="str", + body={ + "connectionName": "str", + "indexName": "str", + "name": "str", + "type": "AzureSearch", + "version": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_indexes_create_version(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.indexes.create_version( + name="str", + version="str", + body={ + "connectionName": "str", + "indexName": "str", + "name": "str", + "type": "AzureSearch", + "version": "str", + "description": "str", + "id": "str", + "stage": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations.py new file mode 100644 index 000000000000..2cab66d614b0 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations.py @@ -0,0 +1,56 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import AIProjectClientTestBase, AIProjectPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectRedTeamsOperations(AIProjectClientTestBase): + @AIProjectPreparer() + @recorded_by_proxy + def test_red_teams_get(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.red_teams.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_red_teams_list(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.red_teams.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy + def test_red_teams_create_run(self, aiproject_endpoint): + client = self.create_client(endpoint=aiproject_endpoint) + response = client.red_teams.create_run( + red_team={ + "attackStrategy": ["str"], + "id": "str", + "numTurns": 0, + "outputs": {"str": "str"}, + "riskCategories": ["str"], + "scanName": "str", + "simulationOnly": bool, + "applicationScenario": "str", + "properties": {"str": "str"}, + "status": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations_async.py new file mode 100644 index 000000000000..5b7e15d68800 --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/test_ai_project_red_teams_operations_async.py @@ -0,0 +1,57 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import AIProjectPreparer +from testpreparer_async import AIProjectClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestAIProjectRedTeamsOperationsAsync(AIProjectClientTestBaseAsync): + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_red_teams_get(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.red_teams.get( + name="str", + ) + + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_red_teams_list(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = client.red_teams.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @AIProjectPreparer() + @recorded_by_proxy_async + async def test_red_teams_create_run(self, aiproject_endpoint): + client = self.create_async_client(endpoint=aiproject_endpoint) + response = await client.red_teams.create_run( + red_team={ + "attackStrategy": ["str"], + "id": "str", + "numTurns": 0, + "outputs": {"str": "str"}, + "riskCategories": ["str"], + "scanName": "str", + "simulationOnly": bool, + "applicationScenario": "str", + "properties": {"str": "str"}, + "status": "str", + "tags": {"str": "str"}, + }, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer.py new file mode 100644 index 000000000000..a1c48db04a3f --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.ai.projects.onedp import AIProjectClient +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools + + +class AIProjectClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(AIProjectClient) + return self.create_client_from_credential( + AIProjectClient, + credential=credential, + endpoint=endpoint, + ) + + +AIProjectPreparer = functools.partial( + PowerShellPreparer, "aiproject", aiproject_endpoint="https://fake_aiproject_endpoint.com" +) diff --git a/sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer_async.py b/sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer_async.py new file mode 100644 index 000000000000..5a7d4906a0bc --- /dev/null +++ b/sdk/ai/azure-ai-projects-onedp/generated_tests/testpreparer_async.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from azure.ai.projects.onedp.aio import AIProjectClient +from devtools_testutils import AzureRecordedTestCase + + +class AIProjectClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(AIProjectClient, is_async=True) + return self.create_client_from_credential( + AIProjectClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/sdk/ai/azure-ai-projects-dp1/pyproject.toml b/sdk/ai/azure-ai-projects-onedp/pyproject.toml similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/pyproject.toml rename to sdk/ai/azure-ai-projects-onedp/pyproject.toml diff --git a/sdk/ai/azure-ai-projects-dp1/pyrightconfig.json b/sdk/ai/azure-ai-projects-onedp/pyrightconfig.json similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/pyrightconfig.json rename to sdk/ai/azure-ai-projects-onedp/pyrightconfig.json diff --git a/sdk/ai/azure-ai-projects-dp1/samples/connections/sample_connections.py b/sdk/ai/azure-ai-projects-onedp/samples/connections/sample_connections.py similarity index 83% rename from sdk/ai/azure-ai-projects-dp1/samples/connections/sample_connections.py rename to sdk/ai/azure-ai-projects-onedp/samples/connections/sample_connections.py index 527bace0c0d6..a495b17d8135 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/connections/sample_connections.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/connections/sample_connections.py @@ -24,22 +24,25 @@ """ import os -from azure.ai.projects.dp1 import AIProjectClient -from azure.ai.projects.dp1.models import ConnectionType from azure.identity import DefaultAzureCredential +from azure.core.credentials import AzureKeyCredential +from azure.ai.projects.onedp import AIProjectClient +from azure.ai.projects.onedp.models import ConnectionType endpoint = os.environ["PROJECT_ENDPOINT"] -connection_name = os.environ["CONNECTION_NAME"] +#connection_name = os.environ["CONNECTION_NAME"] with AIProjectClient( endpoint=endpoint, - credential=DefaultAzureCredential(), + #credential=DefaultAzureCredential(), + credential=AzureKeyCredential(os.environ["PROJECT_API_KEY"]), ) as project_client: print("List the properties of all connections") connections = project_client.connections.list() for connection in connections: print(connection) + exit() print("List the properties of all connections of a particular type (in this case, Azure OpenAI connections)") connections = project_client.connections.list( diff --git a/sdk/ai/azure-ai-projects-dp1/samples/connections/sample_connections_async.py b/sdk/ai/azure-ai-projects-onedp/samples/connections/sample_connections_async.py similarity index 84% rename from sdk/ai/azure-ai-projects-dp1/samples/connections/sample_connections_async.py rename to sdk/ai/azure-ai-projects-onedp/samples/connections/sample_connections_async.py index 730517fd1c31..18ca2324627c 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/connections/sample_connections_async.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/connections/sample_connections_async.py @@ -26,23 +26,26 @@ import asyncio import os from azure.identity.aio import DefaultAzureCredential -from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import ConnectionType +from azure.core.credentials import AzureKeyCredential +from azure.ai.projects.onedp.aio import AIProjectClient +from azure.ai.projects.onedp.models import ConnectionType async def sample_connections_async() -> None: endpoint = os.environ["PROJECT_ENDPOINT"] - connection_name = os.environ["CONNECTION_NAME"] + #connection_name = os.environ["CONNECTION_NAME"] async with AIProjectClient( endpoint=endpoint, - credential=DefaultAzureCredential(), + #credential=DefaultAzureCredential(), + credential=AzureKeyCredential(os.environ["PROJECT_API_KEY"]), ) as project_client: print("List the properties of all connections") async for connection in project_client.connections.list(): print(connection) + exit() print("List the properties of all connections of a particular type (in this case, Azure OpenAI connections)") async for connection in project_client.connections.list( diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_datasets.py b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_datasets.py similarity index 95% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_datasets.py rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_datasets.py index 67fb28488d06..b5a6b0998080 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_datasets.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_datasets.py @@ -24,8 +24,8 @@ import os from azure.identity import DefaultAzureCredential -from azure.ai.projects.1dp import AIProjectClient -from azure.ai.projects.models import DatasetVersion, ListViewType +from azure.ai.projects.onedp import AIProjectClient +from azure.ai.projects.onedp.models import DatasetVersion, ListViewType endpoint = os.environ["PROJECT_ENDPOINT"] dataset_name = os.environ["DATASET_NAME"] diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_datasets_async.py b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_datasets_async.py similarity index 96% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_datasets_async.py rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_datasets_async.py index 4d5e01fdf213..5e2184c44e4e 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_datasets_async.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_datasets_async.py @@ -25,8 +25,8 @@ import asyncio import os from azure.identity.aio import DefaultAzureCredential -from azure.ai.projects.aio import AIProjectClient -from azure.ai.projects.models import DatasetVersion +from azure.ai.projects.onedp.aio import AIProjectClient +from azure.ai.projects.onedp.models import DatasetVersion async def sample_datasets_async() -> None: diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_file1.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_file1.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_file1.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_file1.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_file2.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_file2.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_file2.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_file2.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder1/sample_file3.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder1/sample_file3.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder1/sample_file3.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder1/sample_file3.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder1/sample_file4.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder1/sample_file4.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder1/sample_file4.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder1/sample_file4.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_file5.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_file5.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_file5.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_file5.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_file6.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_file6.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_file6.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_file6.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_file7.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_file7.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_file7.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_file7.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_folder3/sample_file8.txt b/sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_folder3/sample_file8.txt similarity index 100% rename from sdk/ai/azure-ai-projects-dp1/samples/datasets/sample_folder/sample_subfolder2/sample_folder3/sample_file8.txt rename to sdk/ai/azure-ai-projects-onedp/samples/datasets/sample_folder/sample_subfolder2/sample_folder3/sample_file8.txt diff --git a/sdk/ai/azure-ai-projects-dp1/samples/deployments/sample_deployments.py b/sdk/ai/azure-ai-projects-onedp/samples/deployments/sample_deployments.py similarity index 81% rename from sdk/ai/azure-ai-projects-dp1/samples/deployments/sample_deployments.py rename to sdk/ai/azure-ai-projects-onedp/samples/deployments/sample_deployments.py index 00b42d9a1fee..6f7486bc878a 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/deployments/sample_deployments.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/deployments/sample_deployments.py @@ -24,26 +24,27 @@ import os from azure.identity import DefaultAzureCredential -from azure.ai.projects.dp1 import AIProjectClient +from azure.core.credentials import AzureKeyCredential +from azure.ai.projects.onedp import AIProjectClient endpoint = os.environ["PROJECT_ENDPOINT"] deployment_name = os.environ["DEPLOYMENT_NAME"] -#model_publisher = os.environ["MODEL_PUBLISHER"] +model_publisher = os.environ["MODEL_PUBLISHER"] with AIProjectClient( endpoint=endpoint, - credential=DefaultAzureCredential(), + #credential=DefaultAzureCredential(), + credential=AzureKeyCredential(os.environ["PROJECT_API_KEY"]), ) as project_client: print("List all deployments:") for deployment in project_client.deployments.list(): print(deployment) - exit() print(f"List all deployments by the model publisher `{model_publisher}`:") for deployment in project_client.deployments.list(model_publisher=model_publisher): print(deployment) - print("Get a single deployment named `f{deployment_name}`:") + print(f"Get a single deployment named `{deployment_name}`:") deployment = project_client.deployments.get(deployment_name) print(deployment) diff --git a/sdk/ai/azure-ai-projects-dp1/samples/deployments/sample_deployments_async.py b/sdk/ai/azure-ai-projects-onedp/samples/deployments/sample_deployments_async.py similarity index 89% rename from sdk/ai/azure-ai-projects-dp1/samples/deployments/sample_deployments_async.py rename to sdk/ai/azure-ai-projects-onedp/samples/deployments/sample_deployments_async.py index bf8388a8cf74..e7fa22e73b1a 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/deployments/sample_deployments_async.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/deployments/sample_deployments_async.py @@ -25,7 +25,8 @@ import asyncio import os from azure.identity.aio import DefaultAzureCredential -from azure.ai.projects.aio import AIProjectClient +from azure.core.credentials import AzureKeyCredential +from azure.ai.projects.onedp.aio import AIProjectClient async def sample_deployments_async() -> None: @@ -36,7 +37,8 @@ async def sample_deployments_async() -> None: async with AIProjectClient( endpoint=endpoint, - credential=DefaultAzureCredential(), + #credential=DefaultAzureCredential(), + credential=AzureKeyCredential(os.environ["PROJECT_API_KEY"]), ) as project_client: print("List all deployments:") diff --git a/sdk/ai/azure-ai-projects-dp1/samples/indexes/sample_indexes.py b/sdk/ai/azure-ai-projects-onedp/samples/indexes/sample_indexes.py similarity index 96% rename from sdk/ai/azure-ai-projects-dp1/samples/indexes/sample_indexes.py rename to sdk/ai/azure-ai-projects-onedp/samples/indexes/sample_indexes.py index 1390b768d34f..7c0bf628d783 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/indexes/sample_indexes.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/indexes/sample_indexes.py @@ -24,7 +24,7 @@ import os from azure.identity import DefaultAzureCredential -from azure.ai.projects.1dp import AIProjectClient +from azure.ai.projects.onedp import AIProjectClient endpoint = os.environ["PROJECT_ENDPOINT"] index_name = os.environ["INDEX_NAME"] diff --git a/sdk/ai/azure-ai-projects-dp1/samples/indexes/sample_indexes_async.py b/sdk/ai/azure-ai-projects-onedp/samples/indexes/sample_indexes_async.py similarity index 97% rename from sdk/ai/azure-ai-projects-dp1/samples/indexes/sample_indexes_async.py rename to sdk/ai/azure-ai-projects-onedp/samples/indexes/sample_indexes_async.py index 98af377de0fa..7b79c9c30424 100644 --- a/sdk/ai/azure-ai-projects-dp1/samples/indexes/sample_indexes_async.py +++ b/sdk/ai/azure-ai-projects-onedp/samples/indexes/sample_indexes_async.py @@ -24,7 +24,7 @@ import asyncio import os from azure.identity.aio import DefaultAzureCredential -from azure.ai.projects.aio import AIProjectClient +from azure.ai.projects.onedp.aio import AIProjectClient async def sample_indexes_async() -> None: diff --git a/sdk/ai/azure-ai-projects-dp1/setup.py b/sdk/ai/azure-ai-projects-onedp/setup.py similarity index 96% rename from sdk/ai/azure-ai-projects-dp1/setup.py rename to sdk/ai/azure-ai-projects-onedp/setup.py index e62425c3ede4..394eea297417 100644 --- a/sdk/ai/azure-ai-projects-dp1/setup.py +++ b/sdk/ai/azure-ai-projects-onedp/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages -PACKAGE_NAME = "azure-ai-projects-dp1" +PACKAGE_NAME = "azure-ai-projects-onedp" PACKAGE_PPRINT_NAME = "Azure AI Projects" PIPY_LONG_DESCRIPTION_BEGIN = "" @@ -27,7 +27,7 @@ # a-b-c => a/b/c -package_folder_path = "azure/ai/projects" # TODO: Restore this once we drop the "-dp": ="PACKAGE_NAME.replace("-", "/") +package_folder_path = PACKAGE_NAME.replace("-", "/") # Version extraction inspired from 'requests' with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: diff --git a/sdk/ai/azure-ai-projects-dp1/tsp-location.yaml b/sdk/ai/azure-ai-projects-onedp/tsp-location.yaml similarity index 67% rename from sdk/ai/azure-ai-projects-dp1/tsp-location.yaml rename to sdk/ai/azure-ai-projects-onedp/tsp-location.yaml index 057f916536c6..a07898c9f4d3 100644 --- a/sdk/ai/azure-ai-projects-dp1/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects-onedp/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai/Azure.AI.Projects -commit: fcfac31c2b4a5cb8efcb246d5bce1a7ec1326b9f +commit: e0679682e1c4fc1ce3589ab85caad876bcfc7379 repo: Azure/azure-rest-api-specs additionalDirectories: