Registry / llm-agents / azure-ai-agents

azure-ai-agents

JSON →
library1.1.0pypypi✓ verified 24d ago

The Azure AI Agents Client Library for Python provides tools for building AI agents that can interact with users and other services on the Azure platform. It allows developers to create, configure, and manage conversational AI experiences. The current version is 1.1.0, and it follows the Azure SDK release cadence, with frequent beta updates and less frequent, but regular, stable releases.

pip install azure-ai-agents
INSTALL
IMPORT
SIG · AZURE-AI-AGENTS
A
azure-ai-agents
llm-agentspythonv1.1.0
Install
2.5s avg
Import
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 25.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.000s · 26MB
24MB installed
● package 24MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AgentClient
from azure.ai.agents import AgentClient
from azure.ai.agents import AgentClient

This quickstart demonstrates how to initialize the `AgentClient` using an API key and send a basic chat message. It expects the `AZURE_AGENT_ENDPOINT` and `AZURE_AGENT_API_KEY` environment variables to be set for authentication. For more advanced scenarios, including agent creation, thread management, and different authentication methods like `DefaultAzureCredential`, consult the official Azure AI Agents documentation.

import os from azure.ai.agents import AgentClient from azure.core.credentials import AzureKeyCredential # Set your Azure AI Agent endpoint and API key as environment variables # AZURE_AGENT_ENDPOINT='https://<your-agent-resource-name>.openai.azure.com' # AZURE_AGENT_API_KEY='your-api-key' endpoint = os.environ.get("AZURE_AGENT_ENDPOINT", "") api_key = os.environ.get("AZURE_AGENT_API_KEY", "") if not endpoint or not api_key: print("Please set AZURE_AGENT_ENDPOINT and AZURE_AGENT_API_KEY environment variables.") else: try: client = AgentClient(endpoint=endpoint, credential=AzureKeyCredential(api_key)) # Example: Create an agent (if not already created) # For a full agent creation example, refer to official documentation. # This quickstart assumes a basic interaction. # Example: Chat with an existing agent or start a new conversation # Note: 'context' with 'thread_id' might be required depending on your agent setup. # This example uses a simplified chat without explicit thread_id for brevity, # but in real applications, manage thread_ids for conversational continuity. chat_response = client.chat( input="Hello, what can you do?", context={} ) print(f"Agent Output: {chat_response.output}") except Exception as e: print(f"An error occurred: {e}")
Debug
Known issues
breakingThe API for `azure-ai-agents` underwent significant changes between its initial beta (`1.0.0b1`) and the stable `1.1.0` release. Code written for beta versions may not be compatible with the stable release.
fix
Review the official documentation and migration guides for `1.1.0` and update your code to reflect the stable API patterns for `AgentClient`, agent creation, and chat interactions.
affects: 1.0.0b1
gotchaProper authentication is mandatory. You must provide an `endpoint` and a `credential` (either `AzureKeyCredential` or a credential from `azure-identity` like `DefaultAzureCredential`). Ensure corresponding environment variables (`AZURE_AGENT_ENDPOINT`, `AZURE_AGENT_API_KEY`, or `AZURE_CLIENT_ID`, etc.) are correctly configured.
fix
Set environment variables like `AZURE_AGENT_ENDPOINT` and `AZURE_AGENT_API_KEY` or `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` for `DefaultAzureCredential`. Refer to `azure-identity` documentation for detailed authentication setup.
affects: All
gotchaWhile the quickstart uses a basic `chat` method, real-world agent interactions often require managing conversation state via `thread_id` within the `context` parameter. Failure to provide a consistent `thread_id` can lead to stateless interactions.
fix
Implement logic to generate and persist `thread_id` values, passing them in the `context` dictionary for `client.chat()` to maintain conversational continuity for your agents.
affects: All
Upgrade
Version history
1.1.0latest on PyPI · released Aug 5, 2025
Audit
Dependencies
azure-corerequiredProvides shared primitives, exceptions, and operations for the Azure SDK for Python.
azure-identityrequiredUsed for authenticating with Azure services, including AgentClient, via various credential types.
Agent activity
42 hits · last 30 days
node
32
panscient.com
1
OpenAI (training)
1
Resources
azure-ai-agents — pip install azure-ai-agents · libregistry