Langsung ke konten
Skillpedia
API & server (backend)79k Β· #1723

azure-openai-to-responses

Fungsinya

Skill ini memandu pemindahan aplikasi Python yang memakai Azure OpenAI ke Responses API yang lebih baru. Skill ini untuk pengembang yang ingin memperbarui kode lama atau bersiap untuk model yang lebih baru.

Kapan dipakai

  • βœ“Saat Anda punya aplikasi Python yang memakai Azure OpenAI dan ingin beralih ke Responses API.
  • βœ“Saat Anda menyiapkan kode untuk model yang lebih baru yang membutuhkan Responses API di Azure.
  • βœ“Saat Anda melihat peringatan deprecation pada klien AzureOpenAI dan ingin memperbaikinya.

Link skill

https://github.com/microsoft/ai-agents-for-beginners/blob/main/.agents/skills/azure-openai-to-responses/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/microsoft/ai-agents-for-beginners/blob/main/.agents/skills/azure-openai-to-responses/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œPindahkan chatbot Python saya dari chat completions Azure OpenAI ke Responses API.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent pertama-tama memeriksa dengan pengujian kecil bahwa model Azure Anda mendukung API baru. Setelah itu agent memperbarui pengaturan klien, streaming, dan panggilan alat ke format yang baru.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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/AsyncAzureOpenAI to standard OpenAI/AsyncOpenAI client with the v1 endpoint
  • Fix deprecation warnings related to AzureOpenAI constructors or api_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_tokens has 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

⚠️ Older model limitations

WARNING: Older models (those predating gpt-4.1) may not support all Responses API features fully.

Known limitations with older models:

  • reasoning parameter: Not supported on many non-reasoning models. Only migrate reasoning if it was already present in the original code.
  • seed parameter: Not supported in Responses API at all β€” remove from all requests.
  • Structured output via text.format: Older models may not enforce strict: true JSON 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 to 1. 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 be 1 (or omitted). O-series models do not accept other values.
  • max_completion_tokens β†’ max_output_tokens: Apps using the Azure-specific max_completion_tokens must switch to max_output_tokens. Set high values (4096+) because reasoning tokens count against the limit.
  • reasoning_effort: If the app uses reasoning_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.delta may arrive after a longer delay than with GPT models.
  • top_p: Not supported on o-series β€” remove if present.
Pertanyaan umum

Apakah saya perlu memeriksa model saya dulu?

Ya. Skill menyarankan menguji deployment Anda sebelum migrasi, karena tidak semua model mendukung Responses API.

Apakah ini berlaku untuk penyedia AI lain?

Tidak. Skill ini untuk kode Python yang memakai Azure OpenAI.

Apakah ini mencakup login Entra ID?

Ya. Skill menyertakan autentikasi EntraID sebagai salah satu langkah migrasi.

Detail

Deskripsi asli dari pembuat

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

repo: microsoft/ai-agents-for-beginners

Popularitas

Bintang GitHub
79k
Peringkat
#1723
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa