Skip to content

Python Azure AI Projects SDK for new 1DP endpoint #39930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6a71477
First
dargilco Mar 4, 2025
25febb6
Re-emit
dargilco Mar 7, 2025
ec947f7
Emitted code
dargilco Mar 13, 2025
7a2e197
Rename package and folder and re-emit. Add dataset sample stub
dargilco Mar 13, 2025
cf96439
Placeholder for dataset handwritten code and sample
dargilco Mar 17, 2025
b2489ac
Revert previous change. Need to send a PR on this
dargilco Mar 17, 2025
a08c924
Re-emit 3-17-2025 from TypeSpec commit 7afc1fcc4dfe56d91e62593ed88eda…
dargilco Mar 17, 2025
bd16099
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Mar 19, 2025
5304516
Re-emit SDK from latest TypeSpec
dargilco Mar 19, 2025
da95e23
Add datasets methods to upload file or folder, and create new dataset…
dargilco Mar 21, 2025
5801aeb
Add one simple sync & async samples for the Deployment methods (#40186)
dargilco Mar 24, 2025
5d68e46
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Mar 26, 2025
cf24626
Re-emit from TypeSpec
dargilco Mar 26, 2025
fc83331
Re-emit from TypeSpec, which includes api-key auth
dargilco Mar 26, 2025
e09c8f2
Add first version of Indexes samples
dargilco Mar 27, 2025
1886801
Re-emit SDK from latest TypeSpec
dargilco Mar 28, 2025
f12289b
Datasets update to support unversioned calls
dargilco Mar 29, 2025
4bf1eaa
Minor updates to datasets and indexes samples
dargilco Mar 29, 2025
341ec62
Add connection samples. Minor updates to other samples
dargilco Mar 29, 2025
8dc3bd6
Re-emit from TypeSpec, after Agent removal
dargilco Mar 31, 2025
5e1d5d0
Bring over package files, package README. (#40329)
dargilco Apr 2, 2025
8046cda
Re-emit Python SDK for api-version "2025-05-15-preview" (#40328)
dargilco Apr 2, 2025
f32a1b1
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Apr 2, 2025
0a38bcc
Remove folder that was accidentally added a long time ago
dargilco Apr 2, 2025
5aec5de
Re-emit from latest TypeSpec
dargilco Apr 3, 2025
e08e7ff
Remove the 1dp folder
dargilco Apr 3, 2025
62de265
Re-emit from TypeSpec. Fix deployment samples (#40365)
dargilco Apr 3, 2025
2fce349
Fix dataset hand-written code
dargilco Apr 4, 2025
7097f80
Updates to new 1DP Python Projects SDK
dargilco Apr 9, 2025
8614f53
Another round of 1DP Python Projects SDK updates (#40444)
dargilco Apr 10, 2025
1c644d2
Use EntraID only in samples
dargilco Apr 10, 2025
26ab0ac
Split _patch.py files such that we have a separate patch file per sub…
dargilco Apr 11, 2025
105ac45
Fix quality gates to make the PR green (no functional change) (#40475)
dargilco Apr 11, 2025
66a60e8
Add missing dependency on azure-storage-blob. I was accidentally remo…
dargilco Apr 11, 2025
7a45019
Add 1DP to build, so we can publish to internal feed
dargilco Apr 11, 2025
0be28c1
More quality gate fixes. Start working on package README.md
dargilco Apr 11, 2025
4510815
More Sphinx fixes
dargilco Apr 11, 2025
326c24f
Make sure the file pylintrc in the repo root does not get spell checked
dargilco Apr 11, 2025
5356e66
Some initial work on package README.md (#40486)
dargilco Apr 12, 2025
7ce6fbe
Minor changes to make project_client.assistants.get_client() work
dargilco Apr 13, 2025
41cb1e0
Copy over prompt operations (#40508)
dargilco Apr 15, 2025
19bf7a1
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco Apr 15, 2025
d15c0cb
Users/singankit/evaluation 1dp (#40505)
singankit Apr 15, 2025
1955ecd
Update datasets and indexes samples
dargilco Apr 15, 2025
b5f9f03
Merge branch 'feature/azure-ai-projects-1dp' of https://github.com/Az…
dargilco Apr 15, 2025
39aa65f
Set min Python to 3.9 instead of 3.8 (#40525)
dargilco Apr 15, 2025
75a1945
201 for evaluation create (#40542)
singankit Apr 16, 2025
d699f04
Re-emit Python SDK from TypeSpec to get and list connections with sec…
dargilco Apr 17, 2025
a4da8ed
Updates to CHANGELOG.md (#40516)
dargilco Apr 17, 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
8 changes: 8 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"eng/common/docgeneration/Generate-DocIndex.ps1",
"eng/**/*.py",
".gitignore",
"pylintrc",
"tools/azure-sdk-tools/ci_tools/github_tools.py",
"tools/azure-sdk-tools/devtools_testutils/fake_credentials.py",
"tools/azure-sdk-tools/packaging_tools/**",
Expand Down Expand Up @@ -1360,6 +1361,13 @@
"azureopenai"
]
},
{
"filename": "sdk/ai/azure-ai-projects-onedp/**",
"words": [
"aiservices",
"azureai",
]
},
{
"filename": "sdk/ai/azure-ai-inference/**",
"words": [
Expand Down
2 changes: 2 additions & 0 deletions eng/.docsettings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ known_content_issues:
- ['sdk/openai/azure-openai/README.md', '#4554']
- ['sdk/ai/azure-ai-generative/README.md', 'Deprecated package.']
- ['sdk/ai/azure-ai-resources/README.md', 'Deprecated package.']
- ['sdk/ai/azure-ai-projects-onedp/tests/README.md', 'readme has at least one missing required section']


# common.
- ['sdk/appconfiguration/azure-appconfiguration/README.md', 'common']
Expand Down
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ignore-paths=
azure\\mixedreality\\remoterendering\\_api_version.py,
azure/mixedreality/remoterendering/_api_version.py,
(?:.*[/\\]|^)projects/(models/_models.py|_model_base.py|operations/_operations.py|aio/operations/_operations.py)$,
(?:.*[/\\]|^)projects/onedp/(models/_models.py|_model_base.py|operations/_operations.py|aio/operations/_operations.py)$,
# Exclude any path that contains the following directory names
(?:.*[/\\]|^)(?:_vendor|_generated|_restclient|samples|examples|test|tests|doc|\.tox)(?:[/\\]|$)

Expand Down
170 changes: 170 additions & 0 deletions sdk/ai/azure-ai-projects-onedp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# Release History

## 1.0.0b10 (Unreleased)

Major changes happened in this version as the client library switched to using the new AI Foundry data-plane REST APIs.
(TODO: Add link). Please see updated samples.

### Breaking changes

* Endpoint URL is now needed to construct the `AIProjectClient`, instead of using the factory method
`.from_connection_string`. Find this endpoint URL in your AI Foundry project page.
* Agent operations that were previously part of the `azure.ai.projects` package have moved out to a separate new package
`azure-ai-assistants` with a client named `AssistantClient`. See INSERT URL HERE for more information. You can get the `AssistantClient` by calling `.assistant.get_client()` method on your `AIProjectClient`.
* Import `PromptTemplate` from `azure.ai.projects` instead of `azure.ai.projects.prompts`.
* Several changes to `.connections` operations. Please see new connection samples.
* TODO: `.evaluations` methods ..

### Features added

* `.deployment` methods to enumerate the deployed AI models in your AI Foundry project.
* `.datasets` method to upload documents and reference them. These documents will be used to augment the capability
of your selected LLM (RAG pattern).
* `.indexes` methods to handle your AI search indexes and search queries, as part of RAG pattern.
* TODO: `.red_team` methods ...

### Sample updates

### Bugs Fixed

## 1.0.0b9 (2025-04-16)

### Features added

* Utilities to load prompt template strings and Prompty file content
* Added BingCustomSearchTool class with sample
* Added list_threads API to agents namespace
* Added image input support for agents create_message

### Sample updates

* Added `project_client.agents.enable_auto_function_calls(toolset=toolset)` to all samples that has `toolcalls` executed by `azure-ai-project` SDK
* New BingCustomSearchTool sample
* New samples added for image input from url, file and base64

### Breaking Changes

Redesigned automatic function calls because agents retrieved by `update_agent` and `get_agent` do not support them. With the new design, the toolset parameter in `create_agent` no longer executes toolcalls automatically during `create_and_process_run` or `create_stream`. To retain this behavior, call `enable_auto_function_calls` without additional changes.

## 1.0.0b8 (2025-03-28)

### Features added

* New parameters added for Azure AI Search tool, with corresponding sample update.
* Fabric tool REST name updated, along with convenience code.

### Sample updates

* Sample update demonstrating new parameters added for Azure AI Search tool.
* Sample added using OpenAPI tool against authenticated TripAdvisor API spec.

### Bugs Fixed

* Fix for a bug in Agent tracing causing event handler return values to not be returned when tracing is enabled.
* Fix for a bug in Agent tracing causing tool calls not to be recorded in traces.
* Fix for a bug in Agent tracing causing function tool calls to not work properly when tracing is enabled.
* Fix for a bug in Agent streaming, where `agent_id` was not included in the response. This caused the SDK not to make function calls when the thread run status is `requires_action`.

## 1.0.0b7 (2025-03-06)

### Features added

* Add support for parsing URL citations in Agent text messages. See new classes `MessageTextUrlCitationAnnotation` and `MessageDeltaTextUrlCitationAnnotation`.
* Add enum value `ConnectionType.API_KEY` to support enumeration of generic connections that uses API Key authentication.

### Sample updates

* Update sample `sample_agents_bing_grounding.py` with printout of URL citation.
* Add new samples `sample_agents_stream_eventhandler_with_bing_grounding.py` and `sample_agents_stream_iteration_with_bing_grounding.py` with printout of URL citation.

### Bugs Fixed

* Fix a bug in deserialization of `RunStepDeltaFileSearchToolCall` returned during Agent streaming (see [GitHub issue 48333](https://github.com/Azure/azure-sdk-for-net/issues/48333)).
* Fix for Exception raised while parsing Agent streaming response, in some rare cases, for multibyte UTF-8 languages like Chinese.

### Breaking Changes

* Rename input argument `assistant_id` to `agent_id` in all Agent methods to align with the "Agent" terminology. Similarly, rename all `assistant_id` properties on classes.

## 1.0.0b6 (2025-02-14)

### Features added

* Added `trace_function` decorator for conveniently tracing function calls in Agents using OpenTelemetry. Please see the README.md for updated documentation.

### Sample updates

* Added AzureLogicAppTool utility and Logic App sample under `samples/agents`, folder to make Azure Logic App integration with Agents easier.
* Added better observability for Azure AI Search sample for Agents via improved run steps information from the service.
* Added sample to demonstrate how to add custom attributes to telemetry span.

### Bugs Fixed

* Lowered the logging level of "Toolset is not available in the client" from `warning` to `debug` to prevent unnecessary log entries in agent application runs.

## 1.0.0b5 (2025-01-17)

### Features added

* Add method `.inference.get_image_embeddings_client` on `AIProjectClient` to get an authenticated
`ImageEmbeddingsClient` (from the package azure-ai-inference). You need to have azure-ai-inference package
version 1.0.0b7 or above installed for this method to work.

### Bugs Fixed

* Fix for events dropped in streamed Agent response (see [GitHub issue 39028](https://github.com/Azure/azure-sdk-for-python/issues/39028)).
* In Agents, incomplete status thread run event is now deserialized into a ThreadRun object, during stream iteration, and invokes the correct function `on_thread_run` (instead of the wrong function `on_unhandled_event`).
* Fix an error when calling the `to_evaluator_model_config` method of class `ConnectionProperties`. See new input
argument `include_credentials`.

### Breaking Changes

* `submit_tool_outputs_to_run` returns `None` instead of `ThreadRun` (see [GitHub issue 39028](https://github.com/Azure/azure-sdk-for-python/issues/39028)).

## 1.0.0b4 (2024-12-20)

### Bugs Fixed

* Fix for Agent streaming issue (see [GitHub issue 38918](https://github.com/Azure/azure-sdk-for-python/issues/38918))
* Fix for Agent async function `send_email_async` is not called (see [GitHub issue 38898](https://github.com/Azure/azure-sdk-for-python/issues/38898))
* Fix for Agent streaming with event handler fails with "AttributeError: 'MyEventHandler' object has no attribute 'buffer'" (see [GitHub issue 38897](https://github.com/Azure/azure-sdk-for-python/issues/38897))

### Features Added

* Add optional input argument `connection_name` to methods `.inference.get_chat_completions_client`,
`.inference.get_embeddings_client` and `.inference.get_azure_openai_client`.

## 1.0.0b3 (2024-12-13)

### Features Added

* Add support for Structured Outputs for Agents.
* Add option to include file contents, when index search is used for Agents.
* Added objects to inform Agents about Azure Functions.
* Redesigned streaming and event handlers for agents.
* Add `parallel_tool_calls` parameter to allow parallel tool execution for Agents.
* Added `BingGroundingTool` for Agents to use against a Bing API Key connection.
* Added `AzureAiSearchTool` for Agents to use against an Azure AI Search resource.
* Added `OpenApiTool` for Agents, which creates and executes a REST function defined by an OpenAPI spec.
* Added new helper properties in `OpenAIPageableListOfThreadMessage`, `MessageDeltaChunk`, and `ThreadMessage`.
* Rename "AI Studio" to "AI Foundry" in package documents and samples, following recent rebranding.

### Breaking Changes

* The method `.agents.get_messages` was removed. Please use `.agents.list_messages` instead.

## 1.0.0b2 (2024-12-03)

### Bugs Fixed

* Fix a bug in the `.inference` operations when Entra ID authentication is used by the default connection.
* Fixed bugs occurring during streaming in function tool calls by asynchronous agents.
* Fixed bugs that were causing issues with tracing agent asynchronous functionality.
* Fix a bug causing warning about unclosed session, shown when using asynchronous credentials to create agent.
* Fix a bug that would cause agent function tool related function names and parameters to be included in traces even when content recording is not enabled.

## 1.0.0b1 (2024-11-15)

### Features Added

First beta version
21 changes: 21 additions & 0 deletions sdk/ai/azure-ai-projects-onedp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) Microsoft Corporation.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions sdk/ai/azure-ai-projects-onedp/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include *.md
include LICENSE
include azure/ai/projects/onedp/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include azure/__init__.py
include azure/ai/__init__.py
include azure/ai/projects/__init__.py
Loading