Metadata-Version: 2.2
Name: azure-ai-projects
Version: 1.0.0b6
Summary: Microsoft Azure AI Projects Client Library for Python
Home-page: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ai/azure-ai-projects
Author: Microsoft Corporation
Author-email: azpysdkhelp@microsoft.com
License: MIT License
Keywords: azure sdk,azure,ai,agents,foundry,inference,chat completion,project,evaluation
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: isodate>=0.6.1
Requires-Dist: azure-core>=1.30.0
Requires-Dist: typing-extensions>=4.12.2
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Azure AI Projects client library for Python

Use the AI Projects client library (in preview) to:

* **Enumerate connections** in your Azure AI Foundry project and get connection properties.
For example, get the inference endpoint URL and credentials associated with your Azure OpenAI connection.
* **Get an authenticated Inference client** to do chat completions, for the default Azure OpenAI or AI Services connections in your Azure AI Foundry project. Supports the AzureOpenAI client from the `openai` package, or clients from the `azure-ai-inference` package.
* **Develop Agents using the Azure AI Agent Service**, leveraging an extensive ecosystem of models, tools, and capabilities from OpenAI, Microsoft, and other LLM providers. The Azure AI Agent Service enables the building of Agents for a wide range of generative AI use cases. The package is currently in preview.
* **Run Evaluations** to assess the performance of generative AI applications using various evaluators and metrics. It includes built-in evaluators for quality, risk, and safety, and allows custom evaluators for specific needs.
* **Enable OpenTelemetry tracing**.

[Product documentation](https://aka.ms/azsdk/azure-ai-projects/product-doc)
| [Samples][samples]
| [API reference documentation](https://aka.ms/azsdk/azure-ai-projects/python/reference)
| [Package (PyPI)](https://aka.ms/azsdk/azure-ai-projects/python/package)
| [SDK source code](https://aka.ms/azsdk/azure-ai-projects/python/code)
| [AI Starter Template](https://aka.ms/azsdk/azure-ai-projects/python/ai-starter-template)

## Reporting issues

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.

## Table of contents

- [Getting started](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Prerequisite](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Install the package](https://aka.ms/azsdk/azure-ai-projects/python/code)
- [Key concepts](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Create and authenticate the client](https://aka.ms/azsdk/azure-ai-projects/python/code)
- [Examples](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Enumerate connections](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Get properties of all connections](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Get properties of all connections of a particular type](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Get properties of a default connection](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Get properties of a connection by its connection name](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Get an authenticated ChatCompletionsClient](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Get an authenticated AzureOpenAI client](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Agents (Preview)](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Create an Agent](https://aka.ms/azsdk/azure-ai-projects/python/code) with:
      - [File Search](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Enterprise File Search](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Code interpreter](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Bing grounding](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Azure AI Search](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Function call](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Azure Function Call](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [OpenAPI](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Create thread](https://aka.ms/azsdk/azure-ai-projects/python/code) with
      - [Tool resource](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Create message](https://aka.ms/azsdk/azure-ai-projects/python/code) with:
      - [File search attachment](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Code interpreter attachment](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Execute Run, Run_and_Process, or Stream](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Retrieve message](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Retrieve file](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Tear down by deleting resource](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Tracing](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Evaluation](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Evaluator](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Run Evaluation in the cloud](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Evaluators](https://aka.ms/azsdk/azure-ai-projects/python/code)
      - [Data to be evaluated](https://aka.ms/azsdk/azure-ai-projects/python/code)
        - [[Optional] Azure OpenAI Model](#optional-azure-openai-model)
        - [Example Remote Evaluation](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Tracing](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [Installation](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [How to enable tracing](https://aka.ms/azsdk/azure-ai-projects/python/code)
    - [How to trace your own functions](https://aka.ms/azsdk/azure-ai-projects/python/code)
- [Troubleshooting](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Exceptions](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Logging](https://aka.ms/azsdk/azure-ai-projects/python/code)
  - [Reporting issues](https://aka.ms/azsdk/azure-ai-projects/python/code)
- [Next steps](https://aka.ms/azsdk/azure-ai-projects/python/code)
- [Contributing](https://aka.ms/azsdk/azure-ai-projects/python/code)

<!-- LINKS -->
[samples]: https://aka.ms/azsdk/azure-ai-projects/python/samples/
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[entra_id]: https://learn.microsoft.com/azure/ai-services/authentication?tabs=powershell#authenticate-with-microsoft-entra-id
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
[azure_identity_pip]: https://pypi.org/project/azure-identity/
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
[pip]: https://pypi.org/project/pip/
[azure_sub]: https://azure.microsoft.com/free/
[evaluators]: https://learn.microsoft.com/azure/ai-studio/how-to/develop/evaluate-sdk
[azure_ai_evaluation]: https://learn.microsoft.com/python/api/overview/azure/ai-evaluation-readme
[evaluator_library]: https://learn.microsoft.com/azure/ai-studio/how-to/evaluate-generative-ai-app#view-and-manage-the-evaluators-in-the-evaluator-library

# Release History

## 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
