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
@@ -21,7 +21,7 @@ This folder contains focused middleware samples for `Agent`, chat clients, tools
|
||||
|
||||
## Running the usage tracking sample
|
||||
|
||||
The new usage tracking sample uses `OpenAIResponsesClient`, so set the usual OpenAI responses environment variables first:
|
||||
The new usage tracking sample uses `OpenAIChatClient`, so set the usual OpenAI responses environment variables first:
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY="your-openai-api-key"
|
||||
|
||||
@@ -19,7 +19,7 @@ from agent_framework import (
|
||||
ResponseStream,
|
||||
tool,
|
||||
)
|
||||
from agent_framework.openai import OpenAIResponsesClient
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
from dotenv import load_dotenv
|
||||
from pydantic import Field
|
||||
|
||||
@@ -190,7 +190,7 @@ async def main() -> None:
|
||||
# For authentication, run `az login` command in terminal or replace AzureCliCredential with preferred
|
||||
# authentication option.
|
||||
agent = Agent(
|
||||
client=OpenAIResponsesClient(
|
||||
client=OpenAIChatClient(
|
||||
middleware=[validate_weather_middleware, weather_override_middleware],
|
||||
),
|
||||
name="WeatherAgent",
|
||||
|
||||
@@ -19,7 +19,7 @@ from agent_framework import (
|
||||
chat_middleware,
|
||||
tool,
|
||||
)
|
||||
from agent_framework.openai import OpenAIResponsesClient
|
||||
from agent_framework.openai import OpenAIChatClient
|
||||
from dotenv import load_dotenv
|
||||
from pydantic import Field
|
||||
|
||||
@@ -53,7 +53,7 @@ def _reset_usage_counters() -> None:
|
||||
def _create_agent() -> Agent:
|
||||
"""Create the shared agent used by both demonstrations."""
|
||||
return Agent(
|
||||
client=OpenAIResponsesClient(),
|
||||
client=OpenAIChatClient(),
|
||||
instructions=(
|
||||
"You are a weather assistant. Always call the weather tool before answering weather questions, "
|
||||
"then summarize the tool result in one short paragraph."
|
||||
|
||||
Reference in New Issue
Block a user