Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 0 additions & 69 deletions sdk/ai/azure-ai-projects-dp1/apiview-properties.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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://<your-azure-resouce-name>.??.??.??/api/projects/<your-project-name>`. 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://<ai-services-resource-name>.services.ai.azure.com/api/projects/<project-name>`. 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`.
Expand All @@ -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:
Expand Down
69 changes: 69 additions & 0 deletions sdk/ai/azure-ai-projects-onedp/apiview-properties.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
EvaluationsOperations,
IndexesOperations,
RedTeamsOperations,
ServicePatternsOperations,
)
from .servicepatterns.operations import ServicePatternsOperations

if TYPE_CHECKING:
from azure.core.credentials import TokenCredential
Expand All @@ -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://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. Required.
:type endpoint: str
Expand Down
Loading
Loading