mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] Remove deprecated Python OpenAI/Azure AI surfaces (#4990)
* [BREAKING] Remove deprecated Python OpenAI/Azure AI surfaces Also clean up follow-on docs, environment guidance, package metadata, and lab test stability. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix deleted semantic-kernel sample links Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * improve foundry language * Fix A2A Foundry sample regression Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
a5eacbbe65
commit
3a49b1d6dd
@@ -33,7 +33,8 @@ This folder contains examples demonstrating how to use Anthropic's Claude models
|
||||
### Foundry
|
||||
|
||||
- `ANTHROPIC_FOUNDRY_API_KEY`: Your Foundry Anthropic API key
|
||||
- `ANTHROPIC_FOUNDRY_ENDPOINT`: The endpoint URL for your Foundry Anthropic resource
|
||||
- `ANTHROPIC_FOUNDRY_RESOURCE`: Your Foundry resource name (for example `my-foundry-resource`)
|
||||
- `ANTHROPIC_FOUNDRY_BASE_URL`: Optional full Foundry Anthropic base URL alternative to `ANTHROPIC_FOUNDRY_RESOURCE`
|
||||
- `ANTHROPIC_CHAT_MODEL_ID`: The Claude model to use in Foundry (e.g., `claude-haiku-4-5`)
|
||||
|
||||
### Claude Agent
|
||||
|
||||
@@ -22,8 +22,11 @@ This example requires `anthropic>=0.74.0` and an endpoint in Foundry for Anthrop
|
||||
To use the Foundry integration ensure you have the following environment variables set:
|
||||
- ANTHROPIC_FOUNDRY_API_KEY
|
||||
Alternatively you can pass in a azure_ad_token_provider function to the AsyncAnthropicFoundry constructor.
|
||||
- ANTHROPIC_FOUNDRY_ENDPOINT
|
||||
Should be something like https://<your-resource-name>.services.ai.azure.com/anthropic/
|
||||
- ANTHROPIC_FOUNDRY_RESOURCE
|
||||
Should be the resource name portion of your Foundry Anthropic URL, such as <your-resource-name>.
|
||||
- ANTHROPIC_FOUNDRY_BASE_URL
|
||||
Optional alternative to ANTHROPIC_FOUNDRY_RESOURCE. Should be something like
|
||||
https://<your-resource-name>.services.ai.azure.com/anthropic/
|
||||
- ANTHROPIC_CHAT_MODEL_ID
|
||||
Should be something like claude-haiku-4-5
|
||||
"""
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ async def main() -> None:
|
||||
# authentication option.
|
||||
agent = Agent(
|
||||
client=OpenAIChatCompletionClient(
|
||||
model=os.environ["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"],
|
||||
model=os.environ["AZURE_OPENAI_DEPLOYMENT_NAME"],
|
||||
azure_endpoint=os.environ["AZURE_OPENAI_ENDPOINT"],
|
||||
credential=AzureCliCredential(),
|
||||
),
|
||||
|
||||
@@ -27,7 +27,7 @@ Both approaches allow you to extend the framework for your specific use cases wh
|
||||
|
||||
## Understanding Raw Client Classes
|
||||
|
||||
The framework provides `Raw...Client` classes (e.g., `RawOpenAIChatClient`, `RawOpenAIChatCompletionClient`, `RawAzureAIClient`) that are intermediate implementations without middleware, telemetry, or function invocation support.
|
||||
The framework provides `Raw...Client` classes (e.g., `RawOpenAIChatClient`, `RawOpenAIChatCompletionClient`, `RawFoundryChatClient`) that are intermediate implementations without middleware, telemetry, or function invocation support.
|
||||
|
||||
### Warning: Raw Clients Should Not Normally Be Used Directly
|
||||
|
||||
@@ -62,8 +62,8 @@ For most use cases, use the fully-featured public client classes which already h
|
||||
|
||||
- `OpenAIChatCompletionClient` - OpenAI Chat Completions API with all layers
|
||||
- `OpenAIChatClient` - OpenAI Responses API with all layers
|
||||
- `AzureOpenAIChatClient` - Azure OpenAI Chat with all layers
|
||||
- `AzureOpenAIResponsesClient` - Azure OpenAI Responses with all layers
|
||||
- `AzureAIClient` - Azure AI Project with all layers
|
||||
- `OpenAIChatCompletionClient` - Azure OpenAI Chat Completions with all layers
|
||||
- `OpenAIChatClient` - Azure OpenAI Responses with all layers
|
||||
- `FoundryChatClient` - Azure AI Foundry project-backed chat with all layers
|
||||
|
||||
These clients handle the layer composition correctly and provide the full feature set out of the box.
|
||||
|
||||
Reference in New Issue
Block a user