Skip to content

Commit 1eeeb44

Browse files
authored
Changes for stable release of azure-ai-projects SDK (version 1.0.0) (#42054)
1 parent 57734a3 commit 1eeeb44

File tree

75 files changed

+1207
-4576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1207
-4576
lines changed

sdk/ai/azure-ai-projects/CHANGELOG.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,34 @@
11
# Release History
22

3+
## 1.0.0 (Unreleased)
4+
5+
First stable version of the client library. The client library now uses version `v1` of the
6+
AI Foundry [data plane REST APIs](https://aka.ms/azsdk/azure-ai-projects/ga-rest-api-reference).
7+
8+
### Breaking changes
9+
10+
* Features that are still in preview were removed from this stable release. This includes:
11+
* Evaluation operations (property `.evaluations`)
12+
* Red-Team operations (property `.red_teams`)
13+
* Class `PromptTemplate`.
14+
* Package function `enable_telemetry()`
15+
* Classes were renamed:
16+
* Class `Sku` was renamed `ModelDeploymentSku`
17+
* Class `SasCredential` was renamed `BlobReferenceSasCredential`
18+
* Class `AssetCredentialResponse` was renamed `DatasetCredential`
19+
* Method `.inference.get_azure_openai_client()` was renamed `.get_openai_client()`. The `.inference` property was removed.
20+
The method is documented as returning an object of type `OpenAI`, but it still returns an object of the derived type `AzureOpenAI`.
21+
The function implementation has not changed.
22+
* Method `.telemetry.get_connection_string()` was renamed `.telemetry.get_application_insights_connection_string()`
23+
24+
### Sample updates
25+
26+
* Added a new Dataset sample named `sample_datasets_download.py` to show how you can download all files referenced by a certain Dataset (following a question in [this GitHub issue](https://github.com/Azure/azure-sdk-for-python/issues/41960))
27+
* Two samples added showing how to do a `responses` operation using an authenticated Azure OpenAI client created
28+
using `get_openai_client()`.
29+
* Existing inference samples that used the package function `enable_telemetry()` were updated to remove this call,
30+
and instead add the necessary tracing configuration calls to the sample.
31+
332
## 1.0.0b12 (2025-06-23)
433

534
### Breaking changes
@@ -8,7 +37,7 @@
837
`.inference.get_embeddings_client()` and `.inference.get_image_embeddings_client()`.
938
For guidance on obtaining an authenticated `azure-ai-inference` client for your AI Foundry Project,
1039
refer to the updated samples in the `samples\inference` directory. For example,
11-
[sample_chat_completions_with_azure_ai_inference_client.py](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/inference/sample_chat_completions_with_azure_ai_inference_client.py). Alternatively, use the `.inference.get_azure_openai_client()` method to perform chat completions with an Azure OpenAI client.
40+
`sample_chat_completions_with_azure_ai_inference_client.py`. Alternatively, use the `.inference.get_azure_openai_client()` method to perform chat completions with an Azure OpenAI client.
1241
* Method argument name changes:
1342
* In method `.indexes.create_or_update()` argument `body` was renamed `index`.
1443
* In method `.datasets.create_or_update()` argument `body` was renamed `dataset_version`.

sdk/ai/azure-ai-projects/README.md

Lines changed: 23 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,8 @@ resources in your Azure AI Foundry Project. Use it to:
99
* **Enumerate connected Azure resources** in your Foundry project using the `.connections` operations.
1010
* **Upload documents and create Datasets** to reference them using the `.datasets` operations.
1111
* **Create and enumerate Search Indexes** using the `.indexes` operations.
12-
* **Read a Prompty file or string** and render messages for inference clients, using the `PromptTemplate` class.
13-
* **Run Evaluations** to assess the performance of generative AI applications, using the `evaluations` operations.
14-
* **Enable OpenTelemetry tracing** using the `enable_telemetry` function.
1512

16-
The client library uses version `2025-05-15-preview` of the AI Foundry [data plane REST APIs](https://aka.ms/azsdk/azure-ai-projects/rest-api-reference).
17-
18-
> **Note:** There have been significant updates with the release of version 1.0.0b11, including breaking changes.
19-
please see new code snippets below and the samples folder. Agents are now implemented in a separate package `azure-ai-agents`
20-
which will get installed automatically when you install `azure-ai-projects`. You can continue using ".agents"
21-
operations on the `AIProjectsClient` to create, run and delete agents, as before.
22-
See [full set of Agents samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ai/azure-ai-agents/samples)
23-
in their new location. Also see the [change log for the 1.0.0b11 release](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/CHANGELOG.md).
13+
The client library uses the version `v1` of the AI Foundry [data plane REST APIs](https://aka.ms/azsdk/azure-ai-projects/ga-rest-api-reference).
2414

2515
[Product documentation](https://aka.ms/azsdk/azure-ai-projects/product-doc)
2616
| [Samples][samples]
@@ -30,7 +20,7 @@ in their new location. Also see the [change log for the 1.0.0b11 release](https:
3020

3121
## Reporting issues
3222

33-
To report an issue with the client library, or request additional features, please open a GitHub issue [here](https://github.com/Azure/azure-sdk-for-python/issues). Mention the package name "azure-ai-projects" in the title or content.
23+
To report an issue with the client library, or request additional features, please open a [GitHub issue here](https://github.com/Azure/azure-sdk-for-python/issues). Mention the package name "azure-ai-projects" in the title or content.
3424

3525
## Getting started
3626

@@ -137,7 +127,7 @@ Update the `api_version` value with one found in the "Data plane - inference" ro
137127
print(
138128
"Get an authenticated Azure OpenAI client for the parent AI Services resource, and perform a chat completion operation:"
139129
)
140-
with project_client.inference.get_azure_openai_client(api_version="2024-10-21") as client:
130+
with project_client.get_openai_client(api_version="2024-10-21") as client:
141131

142132
response = client.chat.completions.create(
143133
model=model_deployment_name,
@@ -154,9 +144,7 @@ with project_client.inference.get_azure_openai_client(api_version="2024-10-21")
154144
print(
155145
"Get an authenticated Azure OpenAI client for a connected Azure OpenAI service, and perform a chat completion operation:"
156146
)
157-
with project_client.inference.get_azure_openai_client(
158-
api_version="2024-10-21", connection_name=connection_name
159-
) as client:
147+
with project_client.get_openai_client(api_version="2024-10-21", connection_name=connection_name) as client:
160148

161149
response = client.chat.completions.create(
162150
model=model_deployment_name,
@@ -197,6 +185,17 @@ for deployment in project_client.deployments.list(model_name=model_name):
197185
print(f"Get a single deployment named `{model_deployment_name}`:")
198186
deployment = project_client.deployments.get(model_deployment_name)
199187
print(deployment)
188+
189+
# At the moment, the only deployment type supported is ModelDeployment
190+
if isinstance(deployment, ModelDeployment):
191+
print(f"Type: {deployment.type}")
192+
print(f"Name: {deployment.name}")
193+
print(f"Model Name: {deployment.model_name}")
194+
print(f"Model Version: {deployment.model_version}")
195+
print(f"Model Publisher: {deployment.model_publisher}")
196+
print(f"Capabilities: {deployment.capabilities}")
197+
print(f"SKU: {deployment.sku}")
198+
print(f"Connection Name: {deployment.connection_name}")
200199
```
201200

202201
<!-- END SNIPPET -->
@@ -275,8 +274,8 @@ dataset = project_client.datasets.get(name=dataset_name, version=dataset_version
275274
print(dataset)
276275

277276
print(f"Get credentials of an existing Dataset version `{dataset_version_1}`:")
278-
asset_credential = project_client.datasets.get_credentials(name=dataset_name, version=dataset_version_1)
279-
print(asset_credential)
277+
dataset_credential = project_client.datasets.get_credentials(name=dataset_name, version=dataset_version_1)
278+
print(dataset_credential)
280279

281280
print("List latest versions of all Datasets:")
282281
for dataset in project_client.datasets.list():
@@ -329,72 +328,13 @@ project_client.indexes.delete(name=index_name, version=index_version)
329328

330329
<!-- END SNIPPET -->
331330

332-
### Evaluation
333-
334-
Evaluation in Azure AI Project client library provides quantitive, AI-assisted quality and safety metrics to asses performance and Evaluate LLM Models, GenAI Application and Agents. Metrics are defined as evaluators. Built-in or custom evaluators can provide comprehensive evaluation insights.
331+
## Tracing
335332

336-
The code below shows some evaluation operations. Full list of sample can be found under "evaluation" folder in the [package samples][samples]
337-
338-
<!-- SNIPPET:sample_evaluations.evaluations_sample-->
339-
340-
```python
341-
print("Upload a single file and create a new Dataset to reference the file.")
342-
dataset: DatasetVersion = project_client.datasets.upload_file(
343-
name=dataset_name,
344-
version=dataset_version,
345-
file_path=data_file,
346-
)
347-
print(dataset)
333+
The AI Projects client library can be configured to emit OpenTelemetry traces for all its REST API calls. These can be viewed in the "Tracing" tab in your AI Foundry Project page, once you add an Application Insights resource and configured your application appropriately. Agent operations (via the `.agents` property) can also be instrumented, as well as OpenAI client library operations (client created by calling `get_openai_client()` method). For local debugging purposes, traces can also be omitted to the console. For more information see:
348334

349-
print("Create an evaluation")
350-
evaluation: Evaluation = Evaluation(
351-
display_name="Sample Evaluation Test",
352-
description="Sample evaluation for testing",
353-
# Sample Dataset Id : azureai://accounts/<account_name>/projects/<project_name>/data/<dataset_name>/versions/<version>
354-
data=InputDataset(id=dataset.id if dataset.id else ""),
355-
evaluators={
356-
"relevance": EvaluatorConfiguration(
357-
id=EvaluatorIds.RELEVANCE.value,
358-
init_params={
359-
"deployment_name": model_deployment_name,
360-
},
361-
data_mapping={
362-
"query": "${data.query}",
363-
"response": "${data.response}",
364-
},
365-
),
366-
"violence": EvaluatorConfiguration(
367-
id=EvaluatorIds.VIOLENCE.value,
368-
init_params={
369-
"azure_ai_project": endpoint,
370-
},
371-
),
372-
"bleu_score": EvaluatorConfiguration(
373-
id=EvaluatorIds.BLEU_SCORE.value,
374-
),
375-
},
376-
)
377-
378-
evaluation_response: Evaluation = project_client.evaluations.create(
379-
evaluation,
380-
headers={
381-
"model-endpoint": model_endpoint,
382-
"api-key": model_api_key,
383-
},
384-
)
385-
print(evaluation_response)
386-
387-
print("Get evaluation")
388-
get_evaluation_response: Evaluation = project_client.evaluations.get(evaluation_response.name)
389-
390-
print(get_evaluation_response)
391-
392-
print("List evaluations")
393-
for evaluation in project_client.evaluations.list():
394-
print(evaluation)
395-
```
396-
397-
<!-- END SNIPPET -->
335+
* [Trace AI applications using OpenAI SDK](https://learn.microsoft.com/azure/ai-foundry/how-to/develop/trace-application)
336+
* Chat-completion samples with console or Azure Monitor tracing enabled. See `samples\inference\azure-openai` folder.
337+
* The Tracing section in the [README.md file of the azure-ai-agents package](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-agents/README.md#tracing).
398338

399339
## Troubleshooting
400340

@@ -465,7 +405,7 @@ For more information, see [Configure logging in the Azure libraries for Python](
465405

466406
### Reporting issues
467407

468-
To report an issue with the client library, or request additional features, please open a GitHub issue [here](https://github.com/Azure/azure-sdk-for-python/issues). Mention the package name "azure-ai-projects" in the title or content.
408+
To report an issue with the client library, or request additional features, please open a [GitHub issue here](https://github.com/Azure/azure-sdk-for-python/issues). Mention the package name "azure-ai-projects" in the title or content.
469409

470410
## Next steps
471411

@@ -492,6 +432,3 @@ additional questions or comments.
492432
[samples]: https://aka.ms/azsdk/azure-ai-projects/python/samples/
493433
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
494434
[azure_sub]: https://azure.microsoft.com/free/
495-
[evaluators]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk
496-
[azure_ai_evaluation]: https://learn.microsoft.com/python/api/overview/azure/ai-evaluation-readme
497-
[evaluator_library]: https://learn.microsoft.com/azure/ai-studio/how-to/evaluate-generative-ai-app#view-and-manage-the-evaluators-in-the-evaluator-library
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"apiVersion": "2025-05-15-preview"
2+
"apiVersion": "v1"
33
}
Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,38 @@
11
{
22
"CrossLanguagePackageId": "Azure.AI.Projects",
33
"CrossLanguageDefinitionId": {
4-
"azure.ai.projects.models.AgentEvaluation": "Azure.AI.Projects.AgentEvaluation",
5-
"azure.ai.projects.models.AgentEvaluationRedactionConfiguration": "Azure.AI.Projects.AgentEvaluationRedactionConfiguration",
6-
"azure.ai.projects.models.AgentEvaluationRequest": "Azure.AI.Projects.AgentEvaluationRequest",
7-
"azure.ai.projects.models.AgentEvaluationResult": "Azure.AI.Projects.AgentEvaluationResult",
8-
"azure.ai.projects.models.AgentEvaluationSamplingConfiguration": "Azure.AI.Projects.AgentEvaluationSamplingConfiguration",
94
"azure.ai.projects.models.BaseCredentials": "Azure.AI.Projects.BaseCredentials",
105
"azure.ai.projects.models.ApiKeyCredentials": "Azure.AI.Projects.ApiKeyCredentials",
11-
"azure.ai.projects.models.AssetCredentialResponse": "Azure.AI.Projects.AssetCredentialResponse",
126
"azure.ai.projects.models.Index": "Azure.AI.Projects.Index",
137
"azure.ai.projects.models.AzureAISearchIndex": "Azure.AI.Projects.AzureAISearchIndex",
14-
"azure.ai.projects.models.TargetConfig": "Azure.AI.Projects.TargetConfig",
15-
"azure.ai.projects.models.AzureOpenAIModelConfiguration": "Azure.AI.Projects.AzureOpenAIModelConfiguration",
168
"azure.ai.projects.models.BlobReference": "Azure.AI.Projects.BlobReference",
9+
"azure.ai.projects.models.BlobReferenceSasCredential": "Azure.AI.Projects.SasCredential",
1710
"azure.ai.projects.models.Connection": "Azure.AI.Projects.Connection",
1811
"azure.ai.projects.models.CosmosDBIndex": "Azure.AI.Projects.CosmosDBIndex",
1912
"azure.ai.projects.models.CustomCredential": "Azure.AI.Projects.CustomCredential",
13+
"azure.ai.projects.models.DatasetCredential": "Azure.AI.Projects.AssetCredentialResponse",
2014
"azure.ai.projects.models.DatasetVersion": "Azure.AI.Projects.DatasetVersion",
2115
"azure.ai.projects.models.Deployment": "Azure.AI.Projects.Deployment",
2216
"azure.ai.projects.models.EmbeddingConfiguration": "Azure.AI.Projects.EmbeddingConfiguration",
2317
"azure.ai.projects.models.EntraIDCredentials": "Azure.AI.Projects.EntraIDCredentials",
24-
"azure.ai.projects.models.Evaluation": "Azure.AI.Projects.Evaluation",
25-
"azure.ai.projects.models.EvaluatorConfiguration": "Azure.AI.Projects.EvaluatorConfiguration",
2618
"azure.ai.projects.models.FieldMapping": "Azure.AI.Projects.FieldMapping",
2719
"azure.ai.projects.models.FileDatasetVersion": "Azure.AI.Projects.FileDatasetVersion",
2820
"azure.ai.projects.models.FolderDatasetVersion": "Azure.AI.Projects.FolderDatasetVersion",
29-
"azure.ai.projects.models.InputData": "Azure.AI.Projects.InputData",
30-
"azure.ai.projects.models.InputDataset": "Azure.AI.Projects.InputDataset",
3121
"azure.ai.projects.models.ManagedAzureAISearchIndex": "Azure.AI.Projects.ManagedAzureAISearchIndex",
3222
"azure.ai.projects.models.ModelDeployment": "Azure.AI.Projects.ModelDeployment",
23+
"azure.ai.projects.models.ModelDeploymentSku": "Azure.AI.Projects.Sku",
3324
"azure.ai.projects.models.NoAuthenticationCredentials": "Azure.AI.Projects.NoAuthenticationCredentials",
3425
"azure.ai.projects.models.PendingUploadRequest": "Azure.AI.Projects.PendingUploadRequest",
3526
"azure.ai.projects.models.PendingUploadResponse": "Azure.AI.Projects.PendingUploadResponse",
36-
"azure.ai.projects.models.RedTeam": "Azure.AI.Projects.RedTeam",
37-
"azure.ai.projects.models.SasCredential": "Azure.AI.Projects.SasCredential",
3827
"azure.ai.projects.models.SASCredentials": "Azure.AI.Projects.SASCredentials",
39-
"azure.ai.projects.models.Sku": "Azure.AI.Projects.Sku",
4028
"azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType",
4129
"azure.ai.projects.models.CredentialType": "Azure.AI.Projects.CredentialType",
4230
"azure.ai.projects.models.DatasetType": "Azure.AI.Projects.DatasetType",
4331
"azure.ai.projects.models.PendingUploadType": "Azure.AI.Projects.PendingUploadType",
4432
"azure.ai.projects.models.IndexType": "Azure.AI.Projects.IndexType",
4533
"azure.ai.projects.models.DeploymentType": "Azure.AI.Projects.DeploymentType",
46-
"azure.ai.projects.models.AttackStrategy": "Azure.AI.Projects.AttackStrategy",
47-
"azure.ai.projects.models.RiskCategory": "Azure.AI.Projects.RiskCategory",
4834
"azure.ai.projects.operations.ConnectionsOperations.list": "Azure.AI.Projects.Connections.list",
4935
"azure.ai.projects.aio.operations.ConnectionsOperations.list": "Azure.AI.Projects.Connections.list",
50-
"azure.ai.projects.operations.EvaluationsOperations.get": "Azure.AI.Projects.Evaluations.get",
51-
"azure.ai.projects.aio.operations.EvaluationsOperations.get": "Azure.AI.Projects.Evaluations.get",
52-
"azure.ai.projects.operations.EvaluationsOperations.list": "Azure.AI.Projects.Evaluations.list",
53-
"azure.ai.projects.aio.operations.EvaluationsOperations.list": "Azure.AI.Projects.Evaluations.list",
54-
"azure.ai.projects.operations.EvaluationsOperations.create": "Azure.AI.Projects.Evaluations.create",
55-
"azure.ai.projects.aio.operations.EvaluationsOperations.create": "Azure.AI.Projects.Evaluations.create",
56-
"azure.ai.projects.operations.EvaluationsOperations.create_agent_evaluation": "Azure.AI.Projects.Evaluations.createAgentEvaluation",
57-
"azure.ai.projects.aio.operations.EvaluationsOperations.create_agent_evaluation": "Azure.AI.Projects.Evaluations.createAgentEvaluation",
5836
"azure.ai.projects.operations.DatasetsOperations.list_versions": "Azure.AI.Projects.Datasets.listVersions",
5937
"azure.ai.projects.aio.operations.DatasetsOperations.list_versions": "Azure.AI.Projects.Datasets.listVersions",
6038
"azure.ai.projects.operations.DatasetsOperations.list": "Azure.AI.Projects.Datasets.listLatest",
@@ -82,12 +60,6 @@
8260
"azure.ai.projects.operations.DeploymentsOperations.get": "Azure.AI.Projects.Deployments.get",
8361
"azure.ai.projects.aio.operations.DeploymentsOperations.get": "Azure.AI.Projects.Deployments.get",
8462
"azure.ai.projects.operations.DeploymentsOperations.list": "Azure.AI.Projects.Deployments.list",
85-
"azure.ai.projects.aio.operations.DeploymentsOperations.list": "Azure.AI.Projects.Deployments.list",
86-
"azure.ai.projects.operations.RedTeamsOperations.get": "Azure.AI.Projects.RedTeams.get",
87-
"azure.ai.projects.aio.operations.RedTeamsOperations.get": "Azure.AI.Projects.RedTeams.get",
88-
"azure.ai.projects.operations.RedTeamsOperations.list": "Azure.AI.Projects.RedTeams.list",
89-
"azure.ai.projects.aio.operations.RedTeamsOperations.list": "Azure.AI.Projects.RedTeams.list",
90-
"azure.ai.projects.operations.RedTeamsOperations.create": "Azure.AI.Projects.RedTeams.create",
91-
"azure.ai.projects.aio.operations.RedTeamsOperations.create": "Azure.AI.Projects.RedTeams.create"
63+
"azure.ai.projects.aio.operations.DeploymentsOperations.list": "Azure.AI.Projects.Deployments.list"
9264
}
9365
}

sdk/ai/azure-ai-projects/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/ai/azure-ai-projects",
5-
"Tag": "python/ai/azure-ai-projects_8e58b42168"
5+
"Tag": "python/ai/azure-ai-projects_387988b492"
66
}

0 commit comments

Comments
 (0)