azure-openai-to-responses
できること
このスキルは、Azure OpenAI を使う Python アプリを、新しい Responses API へ移行する作業を案内します。古いコードを更新したい、または新しいモデルに備えたい開発者向けです。
使う場面
- ✓Azure OpenAI を使う Python アプリがあり、Responses API に切り替えたいとき。
- ✓新しいモデルに備えて、Azure で Responses API が必要なコードを準備しているとき。
- ✓AzureOpenAI クライアントの非推奨警告が出ていて、それを直したいとき。
スキルのリンク
https://github.com/microsoft/ai-agents-for-beginners/blob/main/.agents/skills/azure-openai-to-responses/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私の Python のチャットボットを、Azure OpenAI のチャット補完から Responses API へ移行してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まず小さなテストで、Azure のモデルが新しい API に対応しているかを確認します。その後、クライアントの設定、ストリーミング、ツール呼び出しを新しい形式に更新します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Migrate Python Apps from Azure OpenAI Chat Completions to Responses API
AUTHORITATIVE GUIDANCE — FOLLOW EXACTLY
This skill migrates Python codebases using Azure OpenAI Chat Completions to the unified Responses API. Follow these instructions precisely. Do not improvise parameter mappings or invent API shapes.
Triggers
Activate this skill when user wants to:
- Migrate a Python app from Azure OpenAI Chat Completions to Responses API
- Upgrade Python OpenAI SDK usage to the latest API shape against Azure OpenAI
- Prepare Python code for GPT-5 or newer models that require Responses on Azure
- Switch from
AzureOpenAI/AsyncAzureOpenAIto standardOpenAI/AsyncOpenAIclient with the v1 endpoint - Fix deprecation warnings related to
AzureOpenAIconstructors orapi_version
⚠️ Model Compatibility — CHECK FIRST
Before migrating, verify your Azure OpenAI deployment supports the Responses API.
1. Smoke-test your deployment (fastest)
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["AZURE_OPENAI_API_KEY"],
base_url=f"{os.environ['AZURE_OPENAI_ENDPOINT'].rstrip('/')}/openai/v1/",
)
try:
resp = client.responses.create(
model=os.environ["AZURE_OPENAI_DEPLOYMENT"],
input="ping",
max_output_tokens=50,
store=False,
)
print(f"✅ Deployment supports Responses API: {resp.output_text}")
except Exception as e:
print(f"❌ Deployment does NOT support Responses API: {e}")
Note:
max_output_tokenshas a minimum of 16 on Azure OpenAI. Values below 16 return a 400 error. Use 50+ for smoke tests.
If this returns a 404, the deployment's model doesn't support Responses yet — check the reference below or redeploy with a supported model.
2. Check available models in your region (recommended)
Run the built-in model compatibility tool to see what's available with Responses API support in your specific region:
python migrate.py models --subscription YOUR_SUB_ID --location YOUR_REGION
This queries Azure ARM live and shows a compatibility matrix — which models support Responses, structured output, tools, etc. Use --filter gpt-5.1,gpt-5.2 to narrow results or --json for scripting.
3. Full model support reference
- Live query:
python migrate.py models(see above — region-specific, always up to date) - Browse availability: Model summary table and region availability
- Quickstart & guidance: https://aka.ms/openai/start
⚠️ Older model limitations
WARNING: Older models (those predating
gpt-4.1) may not support all Responses API features fully.Known limitations with older models:
reasoningparameter: Not supported on many non-reasoning models. Only migratereasoningif it was already present in the original code.seedparameter: Not supported in Responses API at all — remove from all requests.- Structured output via
text.format: Older models may not enforcestrict: trueJSON schemas reliably.- Tool orchestration: GPT-5+ orchestrates tool calls as part of internal reasoning. Older models on Responses still work but lack this deep integration.
- Temperature constraints: When migrating to
gpt-5, temperature must be omitted or set to1. Older models have no such constraint.
O-series reasoning models (o1, o3-mini, o3, o4-mini)
O-series models have unique parameter constraints. When migrating apps that target o-series models:
temperature: Must be1(or omitted). O-series models do not accept other values.max_completion_tokens→max_output_tokens: Apps using the Azure-specificmax_completion_tokensmust switch tomax_output_tokens. Set high values (4096+) because reasoning tokens count against the limit.reasoning_effort: If the app usesreasoning_effort(low/medium/high), keep it — the Responses API supports this parameter for o-series models.- Streaming behavior: O-series models may buffer output until reasoning completes before emitting text delta events. Streaming still works, but the first
response.output_text.deltamay arrive after a longer delay than with GPT models. top_p: Not supported on o-series — remove if present.
よくある質問
先にモデルを確認する必要がありますか?
はい。スキルは、すべてのモデルが Responses API に対応しているわけではないため、移行の前にデプロイをテストするよう述べています。
ほかの AI プロバイダーでも使えますか?
いいえ。Azure OpenAI を使う Python のコード向けです。
Entra ID によるログインも扱いますか?
はい。移行の手順の中に、EntraID 認証が含まれています。
詳細
作者による元の説明
Migrate Python apps from Azure OpenAI Chat Completions to the Responses API. Covers AzureOpenAI/AsyncAzureOpenAI client migration to the v1 endpoint, streaming, tools, structured output, multi-turn, EntraID auth, and model compatibility checks. Python-focused, Azure OpenAI-specific. USE FOR: migrate to responses API, switch from chat completions, openai responses, upgrade openai SDK, responses API migration, move from completions to responses, gpt-5 migration, azure openai python migration, chat completions to responses, AzureOpenAI to OpenAI client, python azure openai upgrade. DO NOT USE FOR
人気
- GitHubのスター
- 79k
- ランキング
- #1723
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
deploying-scalable-agents
79k動いているAIエージェントを、拡張可能で監視される本番環境へ移すよう、エージェントを支援します。Microsoft Foundry 上で動かします。
jupyter-notebook
79k実験やステップごとのチュートリアル用に、Jupyter ノートブックを作成したり整理したりするよう、エージェントを支援します。既成のテンプレートを使います。
local-ai-agents
79kローカルのモデルとツールを使い、クラウドなしで完全に自分のコンピューター上で動くAIヘルパーを作るよう、エージェントに教えます。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。