Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
28e31cf
Set version to 1.0.0b12. Update dependency on azure-ai-agents to 1.0.0
dargilco May 16, 2025
9ac1655
Re-emit from TypeSpec (#41147)
dargilco May 19, 2025
78e8978
project enable telemetry fix for agents (#41223)
M-Hietala May 20, 2025
5cb5bac
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco May 21, 2025
45650a3
Assortment of changes to Python Projects SDK (#41204)
dargilco May 21, 2025
91c19da
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Jun 3, 2025
26c7de8
New automated tests for Azure AI Projects SDK (#41254)
dargilco Jun 7, 2025
5158fdb
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Jun 9, 2025
c559df5
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Jun 12, 2025
7c7cdc9
Remove the 3 methods `get_chat_completions_client()`, `get_embeddings…
dargilco Jun 13, 2025
03ce878
Re-emit from TypeSpec to rename input argument "body" (#41579)
dargilco Jun 14, 2025
5fd7050
Set release date
dargilco Jun 16, 2025
5046ae7
Set new release date, fix text in changelog
dargilco Jun 21, 2025
58019bc
Update release date again
dargilco Jun 21, 2025
d983757
Make sure more folks can approve a PR merge to Main
dargilco Jun 21, 2025
47f6d42
Update test README.md
dargilco Jun 26, 2025
2775958
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Jun 26, 2025
0c2e34e
Update tests assets
dargilco Jun 26, 2025
f0dd3a7
Update changelog
dargilco Jun 26, 2025
bf09964
Update Projects SDK from tsp for redteam changes (#41794)
slister1001 Jun 26, 2025
d1b9694
Re-fix links in models.py
dargilco Jun 26, 2025
61f37bb
Fix agent tests recordings
dargilco Jun 27, 2025
fe2b31e
New test assets
dargilco Jun 27, 2025
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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@

# PRLabel: %AI Projects
# ServiceLabel: %AI Projects %Service Attention
/sdk/ai/azure-ai-projects/ @dargilco @jhakulin
/sdk/ai/azure-ai-projects/ @dargilco @jhakulin @trangevi @glharper @nick863 @howieleung


# PRLabel: %HDInsight
Expand Down
53 changes: 49 additions & 4 deletions sdk/ai/azure-ai-projects/AGENTS_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Agents migration guide from Hub-based projects to Endpoint-based projects.
This guide describes migration from hub-based to Endpoint-based projects. To create a Endpoint-based project, please use one of the deployment scripts on [foundry samples repository](https://github.com/azure-ai-foundry/foundry-samples/tree/main/samples/microsoft/infrastructure-setup) appropriate for your scenario, also you can use Azure AI Foundry UI. The support of hub-based projects was dropped in `azure-ai-projects` version `1.0.0b11`. In this document, we show the operation implementation of before `1.0.0b11` in **Hub-based** secion, followed by code for `azure-ai-projects` version `1.0.0b11` or later in **Endpoint-based**.
# Agents migration guide from Hub-based projects to Endpoint-based projects

This guide describes migration from hub-based to Endpoint-based projects. To create a Endpoint-based project, please use one of the deployment scripts on [foundry samples repository](https://github.com/azure-ai-foundry/foundry-samples/tree/main/samples/microsoft/infrastructure-setup) appropriate for your scenario, also you can use Azure AI Foundry UI. The support of hub-based projects was dropped in `azure-ai-projects` version `1.0.0b11`. In this document, we show the operation implementation of before `1.0.0b11` in **Hub-based** section, followed by code for `azure-ai-projects` version `1.0.0b11` or later in **Endpoint-based**.

## Import changes

Expand Down Expand Up @@ -109,9 +110,11 @@ Files Operations
| `project_client.agents.delete_file` | `project_client.agents.files.delete` |

## API changes

1. Create project. The connection string is replaced by the endpoint. The project endpoint URL has the form https://\<your-ai-services-account-name\>.services.ai.azure.com/api/projects/\<your-project-name\>. It can be found in your Azure AI Foundry Project overview page.

**Hub-based**

```python
project_client = AIProjectClient.from_connection_string(
credential=DefaultAzureCredential(),
Expand All @@ -120,22 +123,27 @@ Files Operations
```

**Endpoint-based**

```python
project_client = AIProjectClient(endpoint=endpoint, credential=DefaultAzureCredential())
```

2. Crate an agent. In the new versions of SDK, the agent can be created using project client or directly created by using `AgentsClient` constructor. In the code below, `project_client.agents`is an `AgentsClient` instance so `project_client.agents` and `agents_client` can be used interchangeably. For simplicity we will use ` project_client.agents `.

**Hub-based**

```python
agent = project_client.agents.create_agent(
model= "gpt-4o",
name="my-assistant",
instructions="You are helpful assistant",
)
```
**Endpoint-based**

Agent is instantiated using `AIProjectClient `
**Endpoint-based**

Agent is instantiated using `AIProjectClient`

```python
agent = project_client.agents.create_agent(
model="gpt-4o",
Expand All @@ -145,6 +153,7 @@ Files Operations
```

Agent is instantiated using `AgentsClient` constructor:

```python
from azure.ai.agents import AgentsClient

Expand All @@ -158,9 +167,11 @@ Files Operations
instructions="You are helpful agent",
)
```

3. List agents. New version of SDK allows more convenient ways of listing threads, messages and agents by returning `ItemPaged` and `AsyncItemPaged`. The list of returned items is split by pages, which may be consequently returned to user. Below we will demonstrate this mechanism for agents. The `limit` parameter defines the number of items on the page. This example is also applicable for listing threads, runs, run steps, vector stores, files in vector store, and messages.

**Hub-based**

```python
has_more = True
last_id = None
Expand All @@ -173,6 +184,7 @@ Files Operations
```

**Endpoint-based**

```python
agents = project_client.agents.list_agents(limit=2)
# Iterate items by page. Each page will be limited by two items.
Expand All @@ -190,29 +202,36 @@ Files Operations
4. Delete agent. In versions azure-ai-projects 1.0.0b11, all deletion operations used to return deletion status, for example, deletion of agent was returning `AgentDeletionStatus`. In 1.0.0b11 and later, these operations do not return a value.

**Hub-based**

```python
deletion_status = project_client.agents.delete_agent(agent.id)
print(deletion_status.deleted)
```

**Endpoint-based**

```python
project_client.agents.delete_agent(agent.id)
```

5. Create a thread.

**Hub-based**

```python
thread = project_client.agents.create_thread()
```

**Endpoint-based**

```python
thread = project_client.agents.threads.create()
```

6. List threads.

**Hub-based**

```python
with project_client:
last_id = None
Expand All @@ -229,6 +248,7 @@ Files Operations
```

**Endpoint-based**

```python
threads = project_client.agents.threads.list(limit=2)
# Iterate items by page. Each page will be limited by two items.
Expand All @@ -246,42 +266,52 @@ Files Operations
7. Delete the thread. In previous SDK thread deletion used to return ` ThreadDeletionStatus` object, while in new version it does not return value.

**Hub-based**

```python
delete_status = project_client.agents.delete_thread(tread_id)
print(delete_status.deleted)
```

**Endpoint-based**

```python
project_client.agents.threads.delete(tread_id)
```

8. Create the message on a thread.

**Hub-based**

```python
message = project_client.agents.create_message(thread_id=thread.id, role="user", content="The message text.")
```

**Endpoint-based**

```python
message = agents_client.messages.create(thread_id=thread.id, role="user", content=" The message text."")
```

9. Create and get the run.

**Hub-based**

```python
run = project_client.agents.runs.create(thread_id=thread.id, agent_id=agent.id)
run = project_client.agents.get_run(thread_id=thread.id, run_id=run.id)
```

**Endpoint-based**

```python
run = project_client.agents.runs.create(thread_id=thread.id, agent_id=agent.id)
run = project_client.agents.runs.get(thread_id=thread.id, run_id=run.id)
```

10. List Runs.

**Hub-based**

```python
has_more = True
last_id = None
Expand All @@ -294,6 +324,7 @@ Files Operations
```

**Endpoint-based**

```python
runs = project_client.agents.runs.list(thread.id)
for one_run in runs:
Expand All @@ -303,6 +334,7 @@ Files Operations
11. List Run steps.

**Hub-based**

```python
has_more = True
last_id = None
Expand All @@ -315,6 +347,7 @@ Files Operations
```

**Endpoint-based**

```python
run_steps = project_client.agents.run_steps.list(thread.id, run.id)
for one_run_step in run_steps:
Expand All @@ -324,6 +357,7 @@ Files Operations
12. Using streams.

**Hub-based**

```python
with project_client.agents.create_stream(thread_id=thread.id, agent_id=agent.id) as stream:
for event_type, event_data, func_return in stream:
Expand All @@ -334,6 +368,7 @@ Files Operations
```

**Endpoint-based**

```python
with project_client.agents.runs.stream(thread_id=thread.id, agent_id=agent.id, event_handler=MyEventHandler()) as stream:
for event_type, event_data, func_return in stream:
Expand All @@ -346,6 +381,7 @@ Files Operations
13. List messages.

**Hub-based**

```python
messages = project_client.agents.list_messages(thread_id=thread.id)
# In code below we assume that the number of messages fits one page for brevity.
Expand All @@ -356,16 +392,19 @@ Files Operations
```

**Endpoint-based**

```python
messages = project_client.agents.messages.list(thread_id=thread.id)
for msg in messages:
if msg.text_messages:
last_text = msg.text_messages[-1]
print(f"{msg.role}: {last_text.text.value}")
```

14. Create, list and delete files are now handled by file operations, again, delete call in new SDK version does not return a value.

**Hub-based**

```python
# Create file
file = project_client.agents.upload_file_and_poll(file_path="product_info_1.md", purpose=FilePurpose.AGENTS)
Expand All @@ -379,6 +418,7 @@ Files Operations
```

**Endpoint-based**

```python
# Create file
file = project_client.agents.files.upload_and_poll(file_path=asset_file_path, purpose=FilePurpose.AGENTS)
Expand All @@ -389,9 +429,11 @@ Files Operations
# Delete file.
project_client.agents.files.delete(file_id=file.id)
```

15. Create, list vector store files list and delete vector stores.

**Hub-based**

```python
# Create a vector store with no file and wait for it to be processed
vector_store = project_client.agents.create_vector_store_and_poll(file_ids=[file.id], name="sample_vector_store")
Expand Down Expand Up @@ -421,6 +463,7 @@ Files Operations
```

**Endpoint-based**

```python
# Create a vector store with no file and wait for it to be processed
vector_store = project_client.agents.vector_stores.create_and_poll(file_ids=[file.id], name="my_vectorstore")
Expand All @@ -441,6 +484,7 @@ Files Operations
16. Vector store batch file search.

**Hub-based**

```python
# Batch upload files
vector_store_file_batch = project_client.agents.create_vector_store_file_batch_and_poll(
Expand All @@ -460,6 +504,7 @@ Files Operations
```

**Endpoint-based**

```python
# Batch upload files
vector_store_file_batch = project_client.agents.vector_store_file_batches.create_and_poll(
Expand Down
24 changes: 24 additions & 0 deletions sdk/ai/azure-ai-projects/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Release History

## 1.0.0b12 (2025-06-23)

### Breaking changes

* These 3 methods on `AIProjectClient` were removed: `.inference.get_chat_completions_client()`,
`.inference.get_embeddings_client()` and `.inference.get_image_embeddings_client()`.
For guidance on obtaining an authenticated `azure-ai-inference` client for your AI Foundry Project,
refer to the updated samples in the `samples\inference` directory. For example,
[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.
* Method argument name changes:
* In method `.indexes.create_or_update()` argument `body` was renamed `index`.
* In method `.datasets.create_or_update()` argument `body` was renamed `dataset_version`.
* In method `.datasets.pending_upload()` argument `body` was renamed `pending_upload_request`.

### Bugs Fixed

* Fix to package function `enable_telemetry()` to correctly instrument `azure-ai-agents`.
* Updated RedTeam target type visibility to allow for type being sent in the JSON for redteam run creation.

### Other

* Set dependency on `azure-ai-agents` version `1.0.0` or above,
now that we have a stable release of the Agents package.

## 1.0.0b11 (2025-05-15)

There have been significant updates with the release of version 1.0.0b11, including breaking changes.
Expand Down
Loading