azure-openai-to-responses
Skill76k starsChanged 5 months agoMITView on GitHub
ਅਧਿਕਾਰਤ ਮਾਰਗਦਰਸ਼ਨ — ਬਿਲਕੁਲ ਠੀਕ ਅਨੁਸਰਣ ਕਰੋ ਇਹ ਸਕਿਲ ਉਹ Python ਕੋਡਬੇਸ ਮਾਈਗ੍ਰੇਟ ਕਰਦਾ ਹੈ ਜੋ Azure OpenAI ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ Unified Responses API ਵੱਲ। ਇਹ ਨਿਰਦੇਸ਼ਾਂ ਨੂੰ ਬਿਲਕੁਲ ਸੁਚੱਜੇ ਤੌਰ 'ਤੇ ਫਾਲੋ ਕਰੋ। ਪੈਰਾਮੀਟਰ ਮੈਪਿੰਗਸ ਚੇਤਰ ਕਰਨ ਜਾਂ API ਸ਼ੇਪ ਵਿਚ ਬਦਲਾਵ ਕਰਨ ਦੀ ਕੋਸ਼ਿਸ਼ ਨਾ ਕਰੋ। ਇਸ ਸਕਿਲ ਨੂੰ ਐਕਟੀਵੇਟ ਕਰੋ ਜਦੋਂ ਯੂਜ਼ਰ ਚਾਹੁੰਦਾ ਹੈ: - Azure OpenAI ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਤੋਂ Responses API ਵੱਲ Python ਐਪ ਮਾਈਗ੍ਰੇਟ ਕਰਨੀ - Python OpenAI SDK ਵਰਤੋਂ ਨੂੰ Azure…
- Reads credentials
- Commits and pushes
2 other projects use a version of this, 1 of them edited.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- microsoft/generative-ai-for-beginnerstheir own version, first seen Jul 14, 2026
- Azure-Samples/azure-openai-to-responsesedited, first seen Apr 6, 2026
Who's talking about microsoft/ai-agents-for-beginners
- @rodtrent.com“AI Agents for Beginners - 10 Lessons teaching everything you need to know to start building AI Agents …”Bluesky · Feb 14, 2025 · 25 likes
- A Hacker News story“Lessons to Get Started Building AI Agents”Hacker News · Jul 4, 2025 · 10 points
- @rdenadai.dev“Pô, parece legal a grade hein... Deixar na lista aqui pra estudar depois da certificação da AWS.”Bluesky · Sep 7, 2025 · 7 likes
- @alvinashcraft.com“AI Agents for Beginners - 10 Lessons to Get Started Building AI Agents. …”Bluesky · Feb 22, 2025 · 7 likes
- @ottorinobruni.bsky.social“🚨 Want to learn AI Agents from scratch? Microsoft’s free 18-lesson course covers frameworks, tools, RAG, …”Bluesky · Nov 20, 2026 · 4 likes
The biggest 5 of 88 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 88
Talked about on GitHub, Bluesky and Hacker News (88 times).
On GitHub · 50
- Oct 14, 2026"Lesson" is not being translated. (en→ja) — Azure/co-op-translator1 reaction
- Jul 25, 2026Previous and Next lessons have not been translated. (en→jp) — Azure/co-op-translator1 reaction · 1 comment
- Jul 4, 2026Translated the markdown header ## Summary to ## まとめ (en→jp) — Azure/co-op-translator1 reaction · 1 comment
- Mar 31, 2026"Join the [Microsoft Foundry Discord]~" has not been translated. (en→ja) — Azure/co-op-translator1 reaction · 3 comments
- Mar 17, 2026The headline has not been translated (en→ja) — Azure/co-op-translator1 reaction · 2 comments
45 more on GitHub
- Mar 15, 2026Code block before and after it has not been translated. (en→ja) — Azure/co-op-translatorsays it tested it1 reaction · 3 comments
- Nov 18, 2025README Structure — notoriousmic/github-copilot-workshop1 reaction
- Oct 2, 2025[KO] Translation improvement for "{days}" usage — Azure/co-op-translator1 reaction · 1 comment
- Oct 2, 2025[KO] Translation improvement for "{days}" usage — Azure/co-op-translator1 reaction
- Sep 15, 2025HTML tags (e.g., <a>) are stripped or lost during translation — Azure/co-op-translator1 reaction · 2 comments
- Sep 7, 2025``` not handled correctly (en→ja) — Azure/co-op-translator1 reaction · 3 comments
- May 7, 2025Correcting all misc errors found across code samples for Lessons 04, 06, 09. — jabari-max/Mohammadhadi-Jabari1 reaction
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T010: retrieval with source attribution — scenario assessment [05-agentic-rag] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T009: confidence-gated escalation — evaluation experiment [09-metacognition] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T008: allowlisted action policy — failure and recovery example [06-building-trustworthy-agents] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T007: dependency-plan validation — worked example with checks [07-planning-design] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T006: dependency-plan validation — refactor the teaching example [08-multi-agent] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T005: bounded agent loop — offline service adapter [01-intro-to-ai-agents] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T004: trace aggregation — invariant and state trace [10-ai-agents-production] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T003: agent-component routing — compare two approaches [03-agentic-design-patterns] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T002: retrieval with source attribution — boundary-case lesson extension [05-agentic-rag] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Jayesh Aher (261105B306021) — R17-T001: bounded agent loop — runnable concept example [01-intro-to-ai-agents] — S-AI-Final-Projects-SMRU/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T030: model-manifest selection — scenario assessment [17-creating-local-ai-agents] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T029: trace aggregation — evaluation experiment [16-deploying-scalable-agents] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T028: bounded agent loop — failure and recovery example [14-microsoft-agent-framework] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T033: retrieval with source attribution — invariant and state trace [05-agentic-rag] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Yatharth Ujwal (2601010406) — R17-T032: bounded agent loop — compare two approaches [14-microsoft-agent-framework] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T038: prompt-template escaping — failure and recovery example [12-context-engineering] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T037: typed tool dispatch — worked example with checks [04-tool-use] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T036: bounded conversation memory — evaluation experiment [13-agent-memory] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T035: bounded conversation memory — refactor the teaching example [11-agentic-protocols] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Tanmay (2601010364) — R17-T034: retrieval with source attribution — offline service adapter [05-agentic-rag] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T040: confidence-gated escalation — scenario assessment [09-metacognition] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T039: bounded conversation memory — boundary-case lesson extension [13-agent-memory] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T044: bounded conversation memory — invariant and state trace [11-agentic-protocols] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T043: agent-component routing — offline service adapter [03-agentic-design-patterns] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Rudransh (2601010295) — R17-T042: dependency-plan validation — compare two approaches [08-multi-agent] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T049: tamper-evident action receipt — scenario assessment [18-securing-ai-agents] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T048: prompt-template escaping — evaluation experiment [12-context-engineering] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T047: agent-component routing — failure and recovery example [02-explore-agentic-frameworks] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Himanshi Gupta (2601010156) — R17-T046: trace aggregation — worked example with checks [10-ai-agents-production] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Hasrat Marwaha (2601010152) — R17-T050: confidence-gated escalation — runnable concept example [09-metacognition] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Hasrat Marwaha (2601010152) — R17-T055: confidence-gated escalation — offline service adapter [09-metacognition] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Hasrat Marwaha (2601010152) — R17-T052: agent-component routing — compare two approaches [02-explore-agentic-frameworks] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Avi Garg (2601010083) — R17-T057: dependency-plan validation — worked example with checks [08-multi-agent] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 28, 2026Avi Garg (2601010083) — R17-T056: agent-component routing — refactor the teaching example [03-agentic-design-patterns] — s-and-ai-ru-4/ai-agents-for-beginners0 reactions
- Nov 16, 2026agent-skills.github.microsoft.ai-agents-for-beginners: 0-unstable-2026-09-10 → 0-unstable-2026-11-07 — sudosubin/agents.nix0 reactions
- Oct 14, 2026agent-skills.github.microsoft.ai-agents-for-beginners: 0-unstable-2026-07-13 → 0-unstable-2026-09-10 — sudosubin/agents.nix0 reactions
- Sep 30, 2026agent-skills.github.microsoft.ai-agents-for-beginners: init at 0-unstable-2026-07-13 — sudosubin/agents.nix0 reactions
- Sep 6, 2026Batch 78: Claude usage-limit tips, n8n grounding technique, coding-agent CLIs, OSS-to-service ideas — dmavridi6478/business0 reactions
On Bluesky · 35
- Feb 14, 2025AI Agents for Beginners - 10 Lessons teaching everything you need to know to start building AI Agents github.com/microsoft/ai...… — @rodtrent.com25 likes and reposts · 1 reply
- Sep 7, 2025Pô, parece legal a grade hein... Deixar na lista aqui pra estudar depois da certificação da AWS. — @rdenadai.dev7 likes and reposts
- Feb 22, 2025AI Agents for Beginners - 10 Lessons to Get Started Building AI Agents. https://github.com/microsoft/ai-agents-for-beginners #ai #aiagents… — @alvinashcraft.com7 likes and reposts
- Nov 20, 2026🚨 Want to learn AI Agents from scratch? Microsoft’s free 18-lesson course covers frameworks, tools, RAG, multi-agents, production & more… — @ottorinobruni.bsky.social4 likes and reposts
- Apr 4, 202510 Lessons teaching everything you need to know to start building AI Agents github.com/microsoft/ai... — @asiermarques.com3 likes and reposts
30 more on Bluesky
- Mar 23, 2025📦 microsoft / ai-agents-for-beginners ⭐ 5,023 (+55) 🗒 Jupyter Notebook 10 Lessons to Get Started Building AI Agents — @github-trending.bsky.social3 likes and reposts
- Oct 20, 2026Stage 3: Agent fundamentals AI Agents for Beginners, Microsoft (18 lessons, 77k+ stars) github.com/microsoft/a... Hugging Face AI Agents… — @astrodevil1.bsky.social2 likes and reposts · 1 reply
- May 18, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 62,102 (+180) 🗒 Jupyter Notebook 12 Lessons to Get Started… — @github-trending.bsky.social2 likes and reposts
- Dec 17, 2025Microsoft AI agents for beginners resource 👀 #fyp #typescript #agent #coding #llm #viral #viralvideo github.com/microsoft/ai... — @krystalmess.bsky.social2 likes and reposts
- Nov 12, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 44,431 (+193) 🗒 Jupyter Notebook 12 Lessons to Get Started… — @github-trending.bsky.social2 likes and reposts
- Sep 7, 2025AI Agents for Beginners 11 Lessons to Get Started Building AI Agents. https://github.com/microsoft/ai-agents-for-beginners — @pythonhub.dev2 likes and reposts
- Jun 16, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 27,064 (+437) 🗒 Jupyter Notebook 11 Lessons to Get Started… — @github-trending.bsky.social2 likes and reposts
- Apr 26, 2025🚀 Dive into Microsoft’s “AI Agents for Beginners” a 10-lesson course designed to help you build AI agents using tools like Azure AI Agent… — @sean.techsnazzy.com2 likes and reposts
- Apr 21, 2025DesktopCommander MCP is trending on GitHub! Check it out alongside other amazing projects from: @microsoft github.com/microsoft/ai..., @n8n… — @desktopcommander.bsky.social2 likes and reposts
- Feb 14, 2025Microsoft’s #AI Agents for Beginners is a great hands-on resource for learning AI agents from scratch. Perfect for beginners and developers… — @mertyeter.bsky.social2 likes and reposts
- Jul 17, 2026微软开源了一套免费课程《AI Agents for Beginners》,GitHub 已封战 61k+ 星。 课程内容:什么是 AI Agent、怎么用 Tool/MCP、多代理人系统、Context 管理、让 AI 操作浏览器、安全部署——一路到完整实战。… — @anotherbug.com1 likes and repost
- Jun 8, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- May 3, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- Apr 21, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 57,227 (+131) 🗒 Jupyter Notebook 12 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- Feb 14, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- Jan 10, 2026https://github.com/microsoft/ai-agents-for-beginners — @tom-doerr.bsky.social1 likes and repost
- Dec 5, 20254) ai-agents-for-beginners ↳ 11 Lessons teaching everything you need to know to start building AI Agents. GitHub: github.com/microsoft/ai... — @analyticalrohit.bsky.social1 likes and repost · 1 reply
- Sep 8, 2025AI Agent for Beginners: github.com/microsoft/ai... ---- 📌 Join 3,000+ ML enthusiasts and professionals from 100 countries. ✅ Learn AI for… — @analyticalrohit.bsky.social1 likes and repost · 1 reply
- Jul 23, 20254) ai-agents-for-beginners ↳ 11 Lessons teaching everything you need to know to start building AI Agents. GitHub: github.com/microsoft/ai... — @analyticalrohit.bsky.social1 likes and repost · 1 reply
- Jun 12, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 25,485 (+175) 🗒 Jupyter Notebook 11 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- May 29, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 22,020 (+180) 🗒 Jupyter Notebook 11 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- Apr 14, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 14,149 (+688) 🗒 Jupyter Notebook 10 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost · 1 reply
- Apr 10, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / ai-agents-for-beginners ⭐ 11,709 (+403) 🗒 Jupyter Notebook 10 Lessons to Get Started… — @github-trending.bsky.social1 likes and repost
- Mar 23, 2025Fundamentals of building AI Agents, a place to start. github.com/microsoft/ai... — @cloudnativeboy.bsky.social1 likes and repost
- Feb 22, 2025🤖 Include anche esempi di implementazione di workflow usando #Autogen. 🚀 È un contributo davvero interessante. Insieme al corso… — @alessiopomaro.it1 likes and repost · 1 reply
- Jul 1, 20261. Hugging Face — AI Agents Course huggingface.co/learn/agent... 2. Microsoft — AI Agents for Beginners github.com/microsoft/a... 3.… — @aipromptgirl.bsky.social0 likes and reposts · 1 reply
- Jan 3, 2026AI Agents for Beginners (Microsoft) A free, structured 11-lesson course to get started with AI agents the right way.… — @jackfusion.bsky.social0 likes and reposts · 1 reply
- Jul 20, 20252️⃣ AI Agents for Beginners Free 11-part intro course, build your first AI agents step-by-step. 🔗 github.com/microsoft/a... — @arindam-1729.bsky.social0 likes and reposts · 1 reply
- Jun 13, 2025GitHub repo → github.com/microsoft/a... — @arindam-1729.bsky.social0 likes and reposts · 1 reply
- Mar 24, 2025Microsoft's "AI Agents for Beginners," is designed to teach you everything you need to know to start building AI Agents. The course… — @kuanhoong.bsky.social0 likes and reposts · 1 reply
On Hacker News · 3
- Jul 4, 2025Lessons to Get Started Building AI Agents10 points
- Apr 14, 2025AI Agents for Beginners2 points
- Feb 14, 2025AI Agents for Beginners – A 10 Lesson Course2 points
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- Azure-Samples/azure-openai-to-responses★ 615% same
Wrote their own version · 1
- microsoft/generative-ai-for-beginners★ 121ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository338 other files it gives its agents.
- AGENTS.mdAGENTS.md
- translations/ar/AGENTS.mdAGENTS.md
- translations/bg/AGENTS.mdAGENTS.md
- translations/bn/AGENTS.mdAGENTS.md
- translations/cs/AGENTS.mdAGENTS.md
- translations/da/AGENTS.mdAGENTS.md
- translations/de/AGENTS.mdAGENTS.md
- translations/el/AGENTS.mdAGENTS.md
- translations/en/AGENTS.mdAGENTS.md
- translations/es/AGENTS.mdAGENTS.md
- translations/et/AGENTS.mdAGENTS.md
- translations/fa/AGENTS.mdAGENTS.md
- translations/fi/AGENTS.mdAGENTS.md
- translations/fr/AGENTS.mdAGENTS.md
- translations/he/AGENTS.mdAGENTS.md
- translations/hi/AGENTS.mdAGENTS.md
- translations/hr/AGENTS.mdAGENTS.md
- translations/hu/AGENTS.mdAGENTS.md
- translations/id/AGENTS.mdAGENTS.md
- translations/it/AGENTS.mdAGENTS.md
- translations/ja/AGENTS.mdAGENTS.md
- translations/km/AGENTS.mdAGENTS.md
- translations/kn/AGENTS.mdAGENTS.md
- translations/ko/AGENTS.mdAGENTS.md
- translations/lt/AGENTS.mdAGENTS.md
- translations/ml/AGENTS.mdAGENTS.md
- translations/mr/AGENTS.mdAGENTS.md
- translations/ms/AGENTS.mdAGENTS.md
- translations/my/AGENTS.mdAGENTS.md
- translations/ne/AGENTS.mdAGENTS.md
- translations/nl/AGENTS.mdAGENTS.md
- translations/no/AGENTS.mdAGENTS.md
- translations/pa/AGENTS.mdAGENTS.md
- translations/pcm/AGENTS.mdAGENTS.md
- translations/pl/AGENTS.mdAGENTS.md
- translations/pt-BR/AGENTS.mdAGENTS.md
- translations/pt-PT/AGENTS.mdAGENTS.md
- translations/ro/AGENTS.mdAGENTS.md
- translations/ru/AGENTS.mdAGENTS.md
- translations/sk/AGENTS.mdAGENTS.md
- translations/sl/AGENTS.mdAGENTS.md
- translations/sr/AGENTS.mdAGENTS.md
- translations/sv/AGENTS.mdAGENTS.md
- translations/sw/AGENTS.mdAGENTS.md
- translations/ta/AGENTS.mdAGENTS.md
- translations/te/AGENTS.mdAGENTS.md
- translations/th/AGENTS.mdAGENTS.md
- translations/tl/AGENTS.mdAGENTS.md
- translations/tr/AGENTS.mdAGENTS.md
- translations/uk/AGENTS.mdAGENTS.md
- translations/ur/AGENTS.mdAGENTS.md
- translations/vi/AGENTS.mdAGENTS.md
- translations/zh-CN/AGENTS.mdAGENTS.md
- translations/zh-HK/AGENTS.mdAGENTS.md
- translations/zh-MO/AGENTS.mdAGENTS.md
- translations/zh-TW/AGENTS.mdAGENTS.md
- 15-browser-use/llms.txtllms.txt
- azure-openai-to-responsesSkill
- deploying-scalable-agentsSkill
- jupyter-notebookSkill
- The first 60 shown.
The file
Files
Azure OpenAI ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਤੋਂ Responses API ਵਿੱਚ Python ਐਪਸ ਮਾਈਗ੍ਰੇਟ ਕਰੋ
ਅਧਿਕਾਰਤ ਮਾਰਗਦਰਸ਼ਨ — ਬਿਲਕੁਲ ਠੀਕ ਅਨੁਸਰਣ ਕਰੋ
ਇਹ ਸਕਿਲ ਉਹ Python ਕੋਡਬੇਸ ਮਾਈਗ੍ਰੇਟ ਕਰਦਾ ਹੈ ਜੋ Azure OpenAI ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਦੀ ਵਰਤੋਂ ਕਰਦਾ ਹੈ Unified Responses API ਵੱਲ। ਇਹ ਨਿਰਦੇਸ਼ਾਂ ਨੂੰ ਬਿਲਕੁਲ ਸੁਚੱਜੇ ਤੌਰ 'ਤੇ ਫਾਲੋ ਕਰੋ। ਪੈਰਾਮੀਟਰ ਮੈਪਿੰਗਸ ਚੇਤਰ ਕਰਨ ਜਾਂ API ਸ਼ੇਪ ਵਿਚ ਬਦਲਾਵ ਕਰਨ ਦੀ ਕੋਸ਼ਿਸ਼ ਨਾ ਕਰੋ।
ਟ੍ਰਿਗਰ
ਇਸ ਸਕਿਲ ਨੂੰ ਐਕਟੀਵੇਟ ਕਰੋ ਜਦੋਂ ਯੂਜ਼ਰ ਚਾਹੁੰਦਾ ਹੈ:
- Azure OpenAI ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਤੋਂ Responses API ਵੱਲ Python ਐਪ ਮਾਈਗ੍ਰੇਟ ਕਰਨੀ
- Python OpenAI SDK ਵਰਤੋਂ ਨੂੰ Azure OpenAI ਲਈ ਨਵੀਨਤਮ API ਸ਼ੇਪ ਨਾਲ ਅੱਪਗਰੇਡ ਕਰਨਾ
- Python ਕੋਡ ਨੂੰ GPT-5 ਜਾਂ ਵਧੀਕ ਨਵੇਂ ਮਾਡਲਾਂ ਲਈ ਤਿਆਰ ਕਰਨਾ ਜੋ Azure ਉੱਤੇ Responses ਦੀ ਲੋੜ ਰੱਖਦੇ ਹਨ
AzureOpenAI/AsyncAzureOpenAIਤੋਂ ਸਮਾਨv1 ਇੰਡੀਪੌਇਂਟ ਵਾਲੇ ਮਿਆਰੀOpenAI/AsyncOpenAIਕਲਾਇੰਟ ਤੇ ਸਵਿੱਚ ਕਰਨਾAzureOpenAIਕੰਸਟਰਕਟਰ ਜਾਂapi_versionਨਾਲ ਜੁੜੀਆਂ ਡੀਪ੍ਰੀਕੇਸ਼ਨ ਚੇਤਾਵਨੀਆਂ ਸਹੀ ਕਰਨਾ
⚠️ ਮਾਡਲ ਸਮਰਥਨਤਾ — ਪਹਿਲਾਂ ਜਾਂਚੋ
ਮਾਈਗ੍ਰੇਸ਼ਨ ਕਰਨ ਤੋਂ ਪਹਿਲਾਂ, ਯਕੀਨੀ ਬਣਾਓ ਕਿ ਤੁਹਾਡਾ Azure OpenAI ਡਿਪਲੋਇਮੈਂਟ Responses API ਨੂੰ ਸਮਰਥਨ ਕਰਦਾ ਹੈ।
1. ਆਪਣੀ ਡਿਪਲੋਇਮੈਂਟ ਦੀ ਸੁਤੰਤਰ ਜਾਂਚ ਕਰੋ (ਸਭ ਤੋਂ ਤੇਜ਼)
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}")ਨੋਟ:
max_output_tokensਦੇ Azure OpenAI ਤੇ ਘੱਟੋ-ਘੱਟ 16 ਟੋਕਨ ਲਾਜ਼ਮੀ ਹਨ। 16 ਤੋਂ ਘੱਟ ਮੁੱਲ 400 ਐਰਰ ਵਾਪਸ ਕਰਦਾ ਹੈ। smoke ਟੈਸਟ ਲਈ 50+ ਵਰਤੋ।
ਜੇ ਇਹ 404 ਦਿੰਦਾ ਹੈ, ਤਾ ਡਿਪਲੋਇਮੈਂਟ ਦਾ ਮਾਡਲ ਹੁਣ ਤੱਕ Responses ਦਾ ਸਮਰਥਨ ਨਹੀਂ ਕਰਦਾ — ਹੇਠਾਂ ਦਿੱਤਾ ਰੈਫਰੈਂਸ ਜਾਂਚੋ ਜਾਂ ਸਹਾਇਕ ਮਾਡਲ ਨਾਲ ਮੁੜ ਡਿਪਲੋਇ ਕਰਵਾਓ।
2. ਆਪਣੇ ਖੇਤਰ ਵਿੱਚ ਉਪਲੱਬਧ ਮਾਡਲਾਂ ਦੀ ਜਾਂਚ ਕਰੋ (ਸਿਫਾਰਸ਼ੀ)
Responses API ਸਮਰਥਿਤ ਉਪਲੱਬਧਤਾ ਵੇਖਣ ਲਈ ਬਣੀਆ ਮਾਡਲ ਕੰਪੈਟਬਿਲਟੀ ਟੂਲ ਚਲਾਓ:
python migrate.py models --subscription YOUR_SUB_ID --location YOUR_REGIONਇਹ Azure ARM ਲਾਈਵ ਨੂੰ ਕੈਵੇਰੀ ਕਰਦਾ ਹੈ ਅਤੇ ਇਕ ਕੰਪੈਟਬਿਲਟੀ ਮੈਟਰਿਕਸ ਦਿਖਾਉਂਦਾ ਹੈ — ਜਿਸ ਤੋਂ ਪਤਾ ਲੱਗدا ਹੈ ਕਿਹੜੇ ਮਾਡਲ Responses, ਸੰਰਚਿਤ آਉਟਪੁੱਟ, ਟੂਲ ਆਦਿ ਸਮਰਥਨ ਕਰਦੇ ਹਨ। ਨਤੀਜੇ ਸੰਕੁਚਿਤ ਕਰਨ ਲਈ --filter gpt-5.1,gpt-5.2 ਜਾਂ ਸਕ੍ਰਿਪਟਿੰਗ ਲਈ --json ਵਰਤੋ।
3. ਪੂਰਾ ਮਾਡਲ ਸਮਰਥਨ ਰੈਫਰੈਂਸ
- ਲਾਈਵ ਕੈਵੇਰੀ:
python migrate.py models(ਉੱਤੇ ਵੇਖੋ — ਖੇਤਰ-ਨਿਰਧਾਰਿਤ, ਹਮੇਸ਼ਾ ਤਾਜ਼ਾ) - ਉਪਲੱਬਧਤਾ ਵੇਖੋ: ਮਾਡਲ ਸਰੰਸ਼ ਟੇਬਲ ਅਤੇ ਖੇਤਰ ਉਪਲੱਬਧਤਾ
- ਕੁਇਕਸਟਾਰਟ ਅਤੇ ਮਾਰਗਦਰਸ਼ਨ: https://aka.ms/openai/start
⚠️ ਪੁਰਾਣੇ ਮਾਡਲ ਸੀਮਾਵਾਂ
ਚੇਤਾਵਨੀ: ਪੁਰਾਣੇ ਮਾਡਲ (ਜੋ
gpt-4.1ਤੋਂ ਪਹਿਲਾਂ ਦੇ ਹਨ) Responses API ਦੀਆਂ ਸਾਰੀਆਂ ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ ਨੂੰ ਪੂਰੀ ਤਰ੍ਹਾਂ ਸਮਰਥਿਤ ਨਹੀਂ ਕਰ ਸਕਦੇ।ਪੁਰਾਣੇ ਮਾਡਲਾਂ ਨਾਲ ਜਾਣੀਆਂ ਸੀਮਾਵਾਂ:
reasoningਪੈਰਾਮੀਟਰ: ਬਹੁਤ ਸਾਰੇ ਗੈਰ-ਰੀਜ਼ਨਿੰਗ ਮਾਡਲਾਂ ਤੇ ਸਮਰਥਿਤ ਨਹੀਂ। ਕੇਵਲ ਉਹਨਾਂ ਮਾਡਲਾਂ ਲਈreasoningਮਾਈਗ੍ਰੇਟ ਕਰੋ ਜੇ ਉਹ ਮੁਢਲੇ ਕੋਡ ਵਿੱਚ ਪਹਿਲਾਂ ਤੋਂ ਮੌਜੂਦ ਸੀ।seedਪੈਰਾਮੀਟਰ: Responses API ਵਿੱਚ ਨਹੀਂ ਚੱਲਦਾ — ਸਾਰੇ ਅਨੁਰੋਧਾਂ ਤੋਂ ਹਟਾਓ।text.formatਰਾਹੀਂ ਸੰਰਚਿਤ ਆਉਟਪੁੱਟ: ਪੁਰਾਣੇ ਮਾਡਲ ਜ਼ਿਆਦਾਤਰstrict: trueJSON ਸਕੀਮਾਂ ਨੂੰ ਭਰੋਸੇਯੋਗ ਤਰੀਕੇ ਨਾਲ ਲਾਗੂ ਨਹੀਂ ਕਰਦੇ।- ਟੂਲ ਸੰਚਾਲਨ: GPT-5+ ਅੰਦਰੂਨੀ ਰੀਜ਼ਨਿੰਗ ਹਿੱਸੇ ਵਜੋਂ ਟੂਲ ਕਾਲਾਂ ਦਾ ਆਯੋਜਨ ਕਰਦਾ ਹੈ। Responses ਤੇ ਪੁਰਾਣੇ ਮਾਡਲ ਕੰਮ ਕਰਦੇ ਹਨ ਪਰ ਇਹ ਡੂੰਘਾ ਇੰਟਿਗ੍ਰੇਸ਼ਨ ਨਹੀਂ ਹੈ।
- ਤਾਪਮਾਨ ਸੀਮਾਵਾਂ:
gpt-5ਲਈ ਮਾਈਗ੍ਰੇਟ ਕਰਦਿਆਂ, ਤਾਪਮਾਨ ਨੂੰ ਛੱਡਣਾ ਜਾਂ 1 ਸੈੱਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ। ਪੁਰਾਣੇ ਮਾਡਲਾਂ ਉੱਤੇ ਕੋਈ ਐਸਾ ਨਿਯੰਤਰਣ ਨਹੀਂ।
O-ਸੀਰੀਜ਼ ਰੀਜ਼ਨਿੰਗ ਮਾਡਲ (o1, o3-mini, o3, o4-mini)
O-ਸੀਰੀਜ਼ ਮਾਡਲਾਂ ਦੇ ਖਾਸ ਪੈਰਾਮੀਟਰ ਸੀਮਾਵਾਂ ਹਨ। ਐਸੇ ਐਪਲੀਕੇਸ਼ਨਾਂ ਦੀ ਮਾਈਗ੍ਰੇਸ਼ਨ ਕਰਦਿਆਂ ਜੋ ਐਸੇ ਮਾਡਲਾਂ ਨੂੰ ਨਿਯਤ ਕਰਦੀਆਂ ਹਨ:
temperature:1ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ (ਜਾਂ ਛੱਡ ਦੇਣਾ). O-ਸੀਰੀਜ਼ ਮਾਡਲ ਹੋਰ ਮੁੱਲ ਕਬੂਲ ਨਹੀਂ ਕਰਦੇ।max_completion_tokens→max_output_tokens: Azure ਖਾਸmax_completion_tokensਵਰਤ ਰਹੇ ਐਪ ਨੂੰmax_output_tokens'ਤੇ ਸਵਿੱਚ ਕਰਨਾ ਲਾਜ਼ਮੀ। ਉੱਚੀ ਕੀਮਤ (4096+) ਸੈੱਟ ਕਰੋ ਕਿਉਂਕਿ reasoning ਟੋਕਨ ਹੱਦ ਨੂੰ ਪ੍ਰਭਾਵਿਤ ਕਰਦੇ ਹਨ।reasoning_effort: ਜੇ ਐਪreasoning_effort(low/medium/high) ਵਰਤਦਾ ਹੈ, ਤਾਂ ਇਹ ਰੱਖੋ — Responses API ਇਸ ਪੈਰਾਮੀਟਰ ਨੂੰ o-ਸੀਰੀਜ਼ ਮਾਡਲਾਂ ਲਈ ਸਮਰਥਨ ਕਰਦਾ ਹੈ।- ਸਟ੍ਰੀਮਿੰਗ ਵਿਹਾਰ: O-ਸੀਰੀਜ਼ ਮਾਡਲ ਰੀਜ਼ਨਿੰਗ ਸਮਾਪਤ ਹੋਣ ਤੱਕ ਆਉਟਪੁੱਟ ਨੂੰ ਬਫਰ ਕਰ ਸਕਦੇ ਹਨ ਅਤੇ ਫਿਰ ਟੈਕਸਟ ਡੈਲਟਾ ਇਵੈਂਟਸ ਜਾਰੀ ਕਰਦੇ ਹਨ। ਸਟ੍ਰੀਮਿੰਗ ਚੱਲਦੀ ਰਹਿੰਦੀ ਹੈ, ਪਰ ਪਹਿਲਾ
response.output_text.deltaGPT ਮਾਡਲਾਂ ਨਾਲੋਂ ਲੰਮੀ ਦੇਰੀ ਨਾਲ ਆ ਸਕਦਾ ਹੈ। top_p: O-ਸੀਰੀਜ਼ 'ਤੇ ਸਮਰਥਿਤ ਨਹੀਂ — ਜੇ ਮੌਜੂਦ ਹੈ ਤਾਂ ਹਟਾਓ।- ਟੂਲ ਵਰਤੋਂ: O-ਸੀਰੀਜ਼ ਮਾਡਲ Responses API ਰਾਹੀਂ ਟੂਲਾਂ ਨੂੰ GPT ਮਾਡਲਾਂ ਵਾਂਗ ਸਮਰਥਨ ਕਰਦੇ ਹਨ, ਪਰ ਟੂਲ ਕਾਲ ਆਯੋਜਨ ਗੁਣਵੱਤਾ ਮਾਡਲ ਦੁਆਰਾ ਵੱਖਰੀ ਹੁੰਦੀ ਹੈ।
ਕਿਰਿਆ — ਤਤਕਾਲ ਮਾਡਲ ਸਲਾਹ: ਸਕੈਨ ਫੇਜ਼ ਵਿਚ ਜਾਂਚ ਕਰੋ ਕਿ ਐਪ ਕਿਹੜੇ ਮਾਡਲ ਨੂੰ ਨਿਸ਼ਾਨਾ ਬਣਾਉਂਦਾ ਹੈ (ਡਿਪਲੋਇਮੈਂਟ ਨਾਂ, env ਵਰ, ਕੰਫਿਗ)। ਜੇ ਮਾਡਲ gpt-4.1 ਤੋਂ ਪਹਿਲਾਂ ਦਾ ਹੈ (gpt-4.1+ ਨਹੀਂ), ਜਾਂਚਕਾਰ ਨੂੰ ਬਤਾਓ:
- ਮਾਈਗ੍ਰੇਸ਼ਨ ਉਨ੍ਹਾਂ ਦੇ ਮੌਜੂਦਾ ਮਾਡਲ ਉੱਤੇ ਬੁਨਿਆਦੀ ਟੈਕਸਟ, ਚੈਟ, ਸਟ੍ਰੀਮਿੰਗ ਅਤੇ ਟੂਲਾਂ ਲਈ ਕੰਮ ਕਰੇਗੀ।
- ਨਵੇਂ ਮਾਡਲ (
gpt-5.1,gpt-5.2) ਬਿਹਤਰ ਟੂਲ ਆਯੋਜਨ, ਸੰਰਚਿਤ ਆਉਟਪੁੱਟ ਲਾਗੂ ਕਰਨ, reasoning, ਅਤੇ ਖੇਤਰਾਂ ਵਿਚ ਲਭਾਉਂ ਦਾ ਆਫ਼ਰ ਕਰਦੇ ਹਨ। - ਉਹ ਆਪਣੀ ਡਿਪਲੋਇਮੈਂਟ ਅੱਪਗਰੇਡ ਕਰਨ 'ਤੇ ਵਿਚਾਰ ਕਰਨ — ਇਹ ਮਾਈਗ੍ਰੇਸ਼ਨ ਵਿੱਚ ਰੁਕਾਵਟ ਨਹੀਂ ਪੈਂਦਾ।
ਮਾਡਲ ਵਰਜ਼ਨ ਦੇ ਆਧਾਰ ਤੇ ਮਾਈਗ੍ਰੇਟ ਕਰਨ ਤੋਂ ਮਨ ਨਾ ਕਰੋ ਜਾਂ ਰੋਕੋ। ਸਲਾਹ ਜਾਣਕਾਰੀ ਲਈ ਹੈ।
GitHub ਮਾਡਲ Responses API ਨੂੰ ਸਮਰਥਿਤ ਨਹੀਂ ਕਰਦੇ
GitHub ਮਾਡਲ (
models.github.ai,models.inference.ai.azure.com) Responses API ਨੂੰ ਸਮਰਥਿਤ ਨਹੀਂ ਕਰਦੇ।
ਜੇ ਕੋਡਬੇਸ ਵਿੱਚ GitHub ਮਾਡਲ ਕੋਡ ਰਾਹ ਹੈ (ਜਾਂਚੋ ਕਿ base_url models.github.ai ਜਾਂ models.inference.ai.azure.com ਤੇ ਦਿਸਦਾ ਹੈ), ਮਾਈਗ੍ਰੇਸ਼ਨ ਦੌਰਾਨ ਇਸਨੂੰ ਪੂਰੀ ਤਰ੍ਹਾਂ ਹਟਾ ਦਿਓ। Responses API ਲਈ Azure OpenAI, OpenAI ਜਾਂ ਮਿਲਦੇ-ਝੁਲਦੇ ਲੋਕਲ ਇੰਡੀਪੌਇੰਟ (ਜਿਵੇਂ Ollama Responses ਸਮਰਥਨ ਨਾਲ) ਲਾਜ਼ਮੀ ਹੈ।
ਸਕੈਨ ਦੌਰਾਨ ਕਿਰਿਆ:
- ਕਿਸੇ ਵੀ GitHub ਮਾਡਲ ਕੋਡ ਰਾਹ ਨੂੰ ਹਟਾਉਣ ਲਈ ਨਿਸ਼ਾਨ ਲਗਾਓ।
ਫਰੇਮਵਰਕ ਮਾਈਗ੍ਰੇਸ਼ਨ
ਬਹੁਤ ਸਾਰੀਆਂ ਐਪਸ OpenAI ਦੇ ਉੱਪਰ ਵਧੇਰੇ ਪੱਧਰੀ ਫਰੇਮਵਰਕ ਵਰਤਦੀਆਂ ਹਨ। ਇਨ੍ਹਾਂ ਦੀ ਮਾਈਗ੍ਰੇਸ਼ਨ ਦੌਰਾਨ ਫਰੇਮਵਰਕ ਦੀ ਆਪਣੀ API ਬਦਲਦੀ ਹੈ — ਸਿਰਫ ਹੀ OpenAI ਕਾਲਾਂ ਨਹੀਂ।
ਮਾਈਕ੍ਰੋਸਾਫਟ ਏਜੰਟ ਫਰੇਮਵਰਕ (MAF)
ਪਹਿਲਾਂ ਆਪਣੀ MAF ਵਰਜ਼ਨ ਜਾਂਚੋ — ਮਾਈਗ੍ਰੇਸ਼ਨ ਇਸ ਗੱਲ ਤੇ ਨਿਰਭਰ ਕਰਦੀ ਹੈ ਕਿ ਤੁਸੀਂ MAF 1.0.0+ ਜਾਂ 1.0.0 ਤੋਂ ਪੂਰਵ ਬੀਟਾ/ਰਿਲੀਜ਼ ਕੈਂਡਿਡੇਟ ਤੇ ਹੋ।
MAF 1.0.0+ (agent-framework-openai >= 1.0.0)
OpenAIChatClient ਹਾਲੇ ਹੀ Responses API ਵਰਤਦਾ ਹੈ — ਕੋਈ ਮਾਈਗ੍ਰੇਸ਼ਨ ਲੋੜੀਂਦਾ ਨਹੀਂ। ਜੇ ਕੋਡਬੇਸ ਪ੍ਰਾਚੀਨ OpenAIChatCompletionClient (ਜੋ chat.completions.create ਵਰਤਦਾ ਹੈ) ਵਰਤਦਾ ਹੈ, ਤਾ ਇਸ ਨੂੰ OpenAIChatClient ਨਾਲ ਬਦਲੋ।
| ਪਹਿਲਾਂ | ਬਾਅਦ |
from agent_framework.openai import OpenAIChatCompletionClient | from agent_framework.openai import OpenAIChatClient |
OpenAIChatCompletionClient(...) | OpenAIChatClient(...) |
ਆਪਣਾ ਵਰਜ਼ਨ ਜਾਂਚਣ ਲਈ: python -c "import agent_framework_openai; print(agent_framework_openai.__version__)"
MAF pre-1.0.0 (ਬੀਟਾ/ਰਿਲੀਜ਼ ਕੈਂਡਿਡੇਟ)
pre-1.0.0 MAF ਵਿੱਚ, OpenAIChatClient ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਵਰਤਦਾ ਸੀ। agent-framework-openai>=1.0.0 ਵਿੱਚ ਅੱਪਗਰੇਡ ਕਰੋ ਜਿਥੇ OpenAIChatClientResponses API ਨੂੰ ਡਿਫਾਲਟ ਵਜੋਂ ਵਰਤਦਾ ਹੈ।
ਹੋਰ ਕੋਈ ਬਦਲਾਅ ਦੀ ਲੋੜ ਨਹੀਂ — Agent ਅਤੇ ਟੂਲ API ਇੱਕੋ ਜਿਹੇ ਹੀ ਰਹਿੰਦੇ ਹਨ।
ਲਾਂਗਚੇਨ (langchain-openai)
ChatOpenAI() ਵਿੱਚ use_responses_api=True ਸ਼ਾਮਲ ਕਰੋ। ਨਾਲ ਹੀ .content ਤੋਂ .text ਤੱਕ Responses ਐਕਸੈੱਸ ਅਪਡੇਟ ਕਰੋ।
| ਪਹਿਲਾਂ | ਬਾਅਦ |
ChatOpenAI(model=..., base_url=..., api_key=...) | ChatOpenAI(model=..., base_url=..., api_key=..., use_responses_api=True) |
result['messages'][-1].content | result['messages'][-1].text |
ਪੂਰੇ ਪਹਿਲਾਂ/ਬਾਅਦ ਕੋਡ ਉਦਾਹਰਨਾਂ ਲਈ, cheat-sheet.md ਵੇਖੋ।
ਫਰੰਟਐਂਡ ਮਾਈਗ੍ਰੇਸ਼ਨ ਮਾਰਗਦਰਸ਼ਨ
Responses API ਸਰਵਰ-ਸਾਈਡ ਮੁੱਦਾ ਹੈ। ਆਪਣਾ Python ਬੈਕਐਂਡ ਮਾਈਗ੍ਰੇਟ ਕਰੋ; ਫਰੰਟਐਂਡ ਦਾ HTTP ਕਿਰਾਰਦਾਰ ਬਦਲੇ ਬਗੈਰ ਰਹਿਣਾ ਚਾਹੀਦਾ ਹੈ ਜੇਕਰ ਬੈਕਐਂਡ ਇੱਕ ਸੁਤੰਤਰ ਪਾਸ-ਥਰੂ ਨਾ ਹੋਵੇ — उस स्थिति में, Responses ਕੋਲ ਰਿਕਵੇਸਟ ਸ਼ੇਪ ਅਪਣਾਉਣ ਤੇ ਵਿਚਾਰ ਕਰੋ ਤਾਂ ਜੋ ਬਦਲਾਵ ਲੇਅਰ ਹਟਾਈ ਜਾ ਸਕੇ। ਜੇ ਫਰੰਟਐਂਡ ਸਿੱਧਾ OpenAI ਨੂੰ ਕਲੀਐਂਟ-ਸਾਈਡ ਕੀ ਨਾਲ ਕਾਲ ਕਰਦਾ ਹੈ, ਤਾ ਉਹਨਾਂ ਕਾਲਾਂ ਨੂੰ ਪਹਿਲਾਂ ਬੈਕਐਂਡ ਵਿੱਚ ਸਥਾਨਾਂਤਰਿਤ ਕਰੋ।
@microsoft/ai-chat-protocol ਡੀਪ੍ਰੀਕੇਸ਼ਨ
@microsoft/ai-chat-protocol npm ਪੈਕੇਜ ਡੀਪ੍ਰੀਕੇਟਡ ਹੈ ਅਤੇ ਇਸ ਨੂੰ ndjson-readablestream ਨਾਲ ਬਦਲਣਾ ਚਾਹੀਦਾ ਹੈ। ਜੇ ਤੁਸੀਂ ਇਸਨੂੰ ਕਿਸੇ ਫਰੰਟਐਂਡ ਵਿੱਚ ਵੇਖਦੇ ਹੋ:
- CDN ਸਕ੍ਰਿਪਟ ਟੈਗ ਬਦਲੋ:
<!-- Before --> <script src="https://cdn.jsdelivr.net/npm/@microsoft/ai-chat-protocol@.../dist/iife/index.js"></script> <!-- After --> <script src="https://cdn.jsdelivr.net/npm/ndjson-readablestream@1.0.7/dist/ndjson-readablestream.umd.js"></script> AIChatProtocolClientਦੀ ਇੰਸਟੈਂਸੀਏਸ਼ਨ ਹਟਾਓ (new ChatProtocol.AIChatProtocolClient("/chat"))।client.getStreamedCompletion(messages)ਦੀ ਥਾਂ ਬੈਕਐਂਡ ਸਟ੍ਰੀਮਿੰਗ ਇੰਡੀਪੌਇੰਟ ਲਈ ਸਿੱਧੀfetch()ਕਾਲ ਕਰੋ।for await (const response of result)ਨੂੰfor await (const chunk of readNDJSONStream(response.body))ਨਾਲ ਬਦਲੋ।- ਪ੍ਰਾਪਰਟੀ ਐਕਸੈੱਸ ਨੂੰ
response.delta.content/response.errorਤੋਂchunk.delta.content/chunk.errorਵੱਲ ਅਪਡੇਟ ਕਰੋ।
ਲਕਸ਼
- ਸਾਰੇ Python ਕਾਲ ਸਾਈਟਾਂ ਦੀ ਗਿਣਤੀ ਕਰੋ ਜੋ Azure OpenAI ਖਿਲਾਫ਼ ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਜਾਂ ਪ੍ਰਾਚੀਨ ਕੰਪਲੀਸ਼ਨਸ ਵਰਤਦੇ ਹਨ।
- Python ਕੋਡਬੇਸ ਲਈ ਮਾਈਗ੍ਰੇਸ਼ਨ ਯੋਜਨਾ ਅਤੇ ਕ੍ਰਮ ਦੇਣ।
- Responses API 'ਤੇ ਸਵਿੱਚ ਕਰਨ ਲਈ ਸੁਰੱਖਿਅਤ, ਘੱਟੋ-ਘੱਟ ਸੋਧਾਂ ਲਾਗੂ ਕਰੋ।
- Responses ਆਉਟਪੁੱਟ ਸਕੀਮਾ ਖਪਤ ਕਰਨ ਲਈ ਕਾਲਰਜ਼ ਨੂੰ ਅਪਡੇਟ ਕਰੋ; ਕੋਈ ਬੈਕਕਾਮਪੈਟ ਰੈਪਰ ਨਹੀਂ।
- ਟੈਸਟ/ਲਿੰਟ ਚਲਾਓ; ਮਾਈਗ੍ਰੇਸ਼ਨ ਨਾਲ ਆਏ ਛੋਟੇ ਤੂਟੇ ਦੁਰੁਸਤ ਕਰੋ।
- ਛੋটা, ਸਮੀਖਿਆ ਯੋਗ ਬਦਲਾਅ ਸੈੱਟ ਤਿਆਰ ਕਰੋ ਅਤੇ ਅੰਤੀਮ ਸਾਰ ਸਣੇ diff ਦਿਓ (ਕਮੇਟ ਨਾ ਕਰੋ)।
ਸੁਰੱਖਿਆ ਨਿਯਮ
- ਸਿਰਫ Git ਵਰਕਸਪੇਸ ਦੇ ਅੰਦਰ ਫਾਈਲਾਂ ਸੋਧੋ। ਕਿੰਨੇ ਵੀ ਬਾਹਰ ਨਾ ਲਿਖੋ।
- ਪਿੱਛਲੇ-ਅਨੁਕੂਲਤਾ ਸਿਮ ਜੋੜੋ ਨਾ; ਕੋਡ ਨੂੰ ਨਵੇਂ API ਸ਼ੇਪ 'ਤੇ ਮਾਈਗ੍ਰੇਟ ਕਰੋ।
- ਕੋਈ ਟੋਮਸਟੋਨ/ਸੰਕਰਮਣ ਕਮੈਂਟ ਜਾਂ ਬੈਕਅੱਪ ਫਾਈਲਾਂ ਨਾ ਛੱਡੋ।
- ਜੇ पहਲਾਂ ਸਟ੍ਰੀਮਿੰਗ ਵਰਤੀ ਗਈ ਹੋਵੇ ਤਾਂ ਸਟ੍ਰੀਮਿੰਗ ਸੈਮੀਟਿਕਸ ਰੱਖੋ; ਨਹੀਂ ਤਾਂ ਗੈਰ-ਸਟ੍ਰੀਮਿੰਗ ਵਰਤੋ।
- ਅਨੁਮਤੀ ਮੋਡ ਵਿੱਚ ਕਮਾਂਡ ਜਾਂ ਨੈੱਟਵਰਕ ਕਾਲਾਂ ਦੌੜਾਉਣ ਤੋਂ ਪਹਿਲਾਂ ਮਨਜ਼ੂਰੀ ਲਓ।
git add/git commit/git pushਨਾ ਚਲਾਓ; ਸਿਰਫ ਵਰਕਿੰਗ-ਟਰੀ ਸੋਧਾਂ ਬਣਾਓ।
ਕਦਮ 0: Azure OpenAI ਕਲਾਇੰਟ ਮਾਈਗ੍ਰੇਸ਼ਨ (ਪ੍ਰਧਾਨ ਸ਼ਰਤ)
ਜੇ ਕੋਡਬੇਸ AzureOpenAI ਜਾਂ AsyncAzureOpenAI ਕੰਸਟਰਕਟਰ ਵਰਤਦਾ ਹੈ, ਤਾਂ ਪਹਿਲਾਂ ਮਿਆਰੀ OpenAI / AsyncOpenAI ਕੰਸਟਰਕਟਰ ਵੱਲ ਮਾਈਗ੍ਰੇਟ ਕਰੋ। Azure ਖਾਸ ਕੰਸਟਰਕਟਰ openai>=1.108.1 ਵਿੱਚ ਡੀਪ੍ਰੀਕੇਟਡ ਹਨ।
ਵ1 API ਪਥ ਕਿਉਂ?
ਨਵਾਂ /openai/v1 ਇੰਡੀਪੌਇੰਟ ਮਿਆਰੀ OpenAI() ਕਲਾਇੰਟ ਵਰਤਦਾ ਹੈ ਨਾ ਕਿ AzureOpenAI(); api_version ਪੈਰਾਮੀਟਰ ਦੀ ਲੋੜ ਨਹੀਂ, ਅਤੇ ਇਹ OpenAI ਅਤੇ Azure OpenAI ਦੋਹਾਂ 'ਤੇ ਇਕੋ ਜਿਹਾ ਕੰਮ ਕਰਦਾ ਹੈ। ਇੱਕੋ ਕਲਾਇੰਟ ਕੋਡ ਭਵਿੱਖ-ਸੁਰੱਖਿਅਤ ਹੈ — ਵਰਜਨ ਪ੍ਰਬੰਧਨ ਦੀ ਲੋੜ ਨਹੀਂ।
ਮੁੱਖ ਬਦਲਾਅ
| ਪਹਿਲਾਂ | ਬਾਅਦ |
AzureOpenAI | OpenAI |
AsyncAzureOpenAI | AsyncOpenAI |
azure_endpoint | base_url |
azure_ad_token_provider | api_key |
api_version=... | ਪੂਰੀ ਤਰ੍ਹਾਂ ਹਟਾਓ |
ਸਫਾਈ ਦੀ ਸੂਚੀ
- ਕਲਾਇੰਟ ਕਨਸਟਰਕਸ਼ਨ ਤੋਂ
api_versionਪੈਰਾਮੀਟਰ ਹਟਾਓ। .env, ਐਪ ਸੈਟਿੰਗਜ਼, ਅਤੇ Bicep/ਇੰਫਰਾ ਫਾਈਲਾਂ ਵਿੱਚੋਂAZURE_OPENAI_VERSION/AZURE_OPENAI_API_VERSIONਏਨਵਾਇਰਨਮੈਂਟ ਵੈਰੀਏਬਲ ਹਟਾਓ।.env, ਐਪ ਸੈਟਿੰਗਜ਼, Bicep/ਇੰਫਰਾ ਅਤੇ ਟੈਸਟ ਫਿਕਸਚਰਜ਼ ਵਿੱਚAZURE_OPENAI_CLIENT_IDਨੂੰAZURE_CLIENT_IDਵੱਲ ਰੀਨੇਮ ਕਰੋ (ਸਧਾਰਣ Azure Idendity SDK ਪ੍ਰਣਾਲੀ)।requirements.txtਜਾਂpyproject.tomlਵਿੱਚopenai>=1.108.1ਯਕੀਨੀ ਬਣਾਓ।
ਏਨਵਾਇਰਨਮੈਂਟ ਵੈਰੀਏਬਲ ਮਾਈਗ੍ਰੇਸ਼ਨ
| ਪੁਰਾਣਾ env var | ਕਿਰਿਆ | ਨੋਟਸ |
AZURE_OPENAI_VERSION | ਹਟਾਓ | v1 ਇੰਡੀਪੌਇੰਟ ਨਾਲ api_version ਦੀ ਲੋੜ ਨਹੀਂ |
AZURE_OPENAI_API_VERSION | ਹਟਾਓ | ਉਪਰੋਕਤ ਵਰਗੀ ਹੀ |
AZURE_OPENAI_CLIENT_ID | ਰੀਨੇਮ ਕਰੋ → AZURE_CLIENT_ID | ManagedIdentityCredential(client_id=...) ਲਈ ਸਧਾਰਣ Azure Idendity SDK ਪ੍ਰਣਾਲੀ |
AZURE_OPENAI_ENDPOINT | ਰੱਖੋ | base_url ਬਣਾੳ਼ਣ ਲਈ ਹਾਲੇ ਲੋੜੀਂਦਾ ਹੈ |
AZURE_OPENAI_CHAT_DEPLOYMENT | ਰੱਖੋ | responses.create ਵਿੱਚ ਮਾਡਲ ਪੈਰਾਮੀਟਰ ਵਜੋਂ ਵਰਤਿਆ ਜਾਂਦਾ ਹੈ |
AZURE_OPENAI_API_KEY | ਰੱਖੋ | ਕੁੰਜੀ ਅਧਾਰਿਤ ਪ੍ਰਮਾਣਿਕਤਾ ਲਈ api_key ਵਜੋਂ ਵਰਤਿਆ ਜਾਂਦਾ ਹੈ |
ਕਲਾਇੰਟ ਸੈਟਅੱਪ ਕੋਡ (ਸਿੰਕ, ਅਸਿੰਕ, EntraID, API ਕੁੰਜੀ, ਮਲਟੀ-ਟੇਨੈਂਟ) ਲਈ ਉਦਾਹਰਨਾਂ cheat-sheet.md ਵਿੱਚ ਹਨ।
ਕਦਮ 1: ਪ੍ਰਾਚੀਨ ਕਾਲ ਸਾਈਟਾਂ ਦੀ ਪਹਿਚਾਣ
ਸਾਰੇ ਕਾਲ ਸਾਈਟਾਂ ਲੱਭਣ ਲਈ detect_legacy.py ਸਕ੍ਰਿਪਟ ਚਲਾਓ ਜੋ ਮਾਈਗ੍ਰੇਸ਼ਨ ਦੀ ਲੋੜ ਹੈ:
python skills/azure-openai-to-responses/scripts/detect_legacy.py .ਜਾਂ ਇਹ ਖੋਜਾਂ ਮੈਨੂਅਲੀ ਕਰੋ — ਹਰ ਇੱਕ ਮਿਲਾਪ ਇੱਕ ਮਾਈਗ੍ਰੇਸ਼ਨ ਟਾਰਗੇਟ ਹੈ:
# ਲੈਗਸੀ API ਕਾਲਸ (ਮੁੜ ਲਿਖਣਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "chat\.completions\.create"
rg "ChatCompletion\.create"
rg "Completion\.create"
# ਪੁਰਾਣੇ ਹੋ ਚੁੱਕੇ Azure ਕਲਾਇੰਟ ਕੰਸਟ੍ਰਕਟਰ (ਬਦਲਣਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "AzureOpenAI\("
rg "AsyncAzureOpenAI\("
# ਜਵਾਬ ਆਕਾਰ ਪਹੁੰਚ ਪੈਟਰਨ (ਅੱਪਡੇਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "choices\[0\]\.message\.content"
rg "choices\[0\]\.delta\.content"
rg "choices\[0\]\.message\.function_call"
rg "choices\[0\]\.message\.tool_calls"
# ਪੁਰਾਣੇ ਨੇਸਟਿਡ ਫਾਰਮੈਟ ਵਿੱਚ ਟੂਲ ਪਰਿਭਾਸ਼ਾਵਾਂ (ਫਲੈਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ)
rg '"function":\s*{\s*"name"'
rg "pydantic_function_tool"
# ਪੁਰਾਣੇ ਫਾਰਮੈਟ ਵਿੱਚ ਟੂਲ ਨਤੀਜੇ (function_call_output ਵਿੱਚ ਤਬਦੀਲ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ)
rg '"role":\s*"tool"'
rg '"tool_call_id"'
# ਪੁਰਾਣੇ ਹੋ ਚੁੱਕੇ ਪੈਰਾਮੀਟਰ (ਹਟਾਉਣਾ ਜਾਂ ਨਾਂ ਬਦਲਣਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "response_format"
rg "max_tokens\b" # ਨਾਂ ਬਦਲ ਕੇ max_output_tokens ਕਰੋ
rg "['\"]seed['\"]" # remove entirely
# ਪੁਰਾਣੇ ਹੋ ਚੁੱਕੇ env ਵੈਰੀਅਬਲ (ਸਾਫ਼ ਕਰੋ)
rg "AZURE_OPENAI_API_VERSION|AZURE_OPENAI_VERSION"
rg "AZURE_OPENAI_CLIENT_ID" # AZURE_CLIENT_ID ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ
# GitHub ਮਾਡਲ ਐਂਡਪോയਿੰਟ (ਹਟਾਉਣਾ ਲਾਜ਼ਮੀ - Responses API ਸਮਰਥਿਤ ਨਹੀਂ ਹੈ)
rg "models\.github\.ai|models\.inference\.ai\.azure"
# ਫਰੇਮਵਰਕ-ਸਤਹ ਦੇ ਲੈਗਸੀ ਪੈਟਰਨ (ਅੱਪਡੇਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "OpenAIChatCompletionClient" # MAF 1.0.0+: OpenAIChatClient ਨਾਲ ਤਬਦਿਲ ਕਰੋ
rg "ChatOpenAI\(" | grep -v "use_responses_api" # LangChain: use_responses_api=True ਦੀ ਲੋੜ ਹੈ
# ਟੈਸਟ ਢਾਂਚਾ (ਅੱਪਡੇਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "ChatCompletionChunk|AsyncCompletions\.create" tests/
rg "_azure_ad_token_provider" tests/
rg "prompt_filter_results|content_filter_results" tests/
rg "choices\[0\]" tests/
# ਸਮੱਗਰੀ ਫਿਲਟਰ ਦੀ ਗਲਤੀ ਬਾਡੀ ਪਹੁੰਚ (ਅੱਪਡੇਟ ਕਰਨਾ ਲਾਜ਼ਮੀ - ਢਾਂਚਾ ਬਦਲ ਗਿਆ ਹੈ)
rg 'innererror.*content_filter_result|error\.body\["innererror"\]'
rg "content_filter_result\[" # ਪੁਰਾਣਾ ਇਕਵਚਨ ਰੂਪ - ਹੁਣ content_filter_results (ਬਹੁਵਚਨ) content_filters ਅਰੇ ਦੇ ਅੰਦਰ ਹੈ
# Chat Completions ਐਂਡਪോയਿੰਟ ਨੂੰ ਰਾ HTTP ਕਾਲ (URL ਅੱਪਡੇਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ)
rg "/openai/deployments/.*/chat/completions"
rg "api-version="ਸੰਕੇਤਕ (ਪਤਾ ਲਗਾਓ ਅਤੇ ਦੁਬਾਰਾ ਲਿਖੋ)
- ਚੈਟ ਕੰਪਲੀਸ਼ਨਸ ਕਲਾਇੰਟ:
client.chat.completions.create→client.responses.create(...)। - ਐਜ਼ਰ ਕਲਾਇੰਟ ਨਿਰਮਾਤਾ:
AzureOpenAI(...)→OpenAI(base_url=..., api_key=...). - ਟੂਲਜ਼: ਫੰਕਸ਼ਨ ਕਾਲਿੰਗ ਟੂਲ ਪਰਿਭਾਸ਼ਾਵਾਂ ਨੂੰ ਨੇਸਟਡ ਫਾਰਮੈਟ (
{"type": "function", "function": {"name": ...}}) ਤੋਂ ਫਲੈਟ Responses ਫਾਰਮੈਟ ({"type": "function", "name": ...}) ਵਿੱਚ ਬਦਲੋ;tool_choiceਵਰਤੋ; ਟੂਲ ਨਤੀਜੇ{"type": "function_call_output", "call_id": ..., "output": ...}ਆਈਟਮਾਂ ਵਜੋਂ ਵਾਪਸ ਕਰੋ (ਨਾ ਕਿ{"role": "tool", ...}). - ਟੂਲ ਰਾਊਂਡ-ਟ੍ਰਿਪਸ: ਜਦੋਂ ਮਾਡਲ ਫੰਕਸ਼ਨ ਕਾਲ ਵਾਪਸ ਕਰਦਾ ਹੈ, ਤਾਂ ਗੱਲਬਾਤ ਵਿੱਚ
response.outputਆਈਟਮ ਸ਼ਾਮਿਲ ਕਰੋ (ਹੱਥੋਂ ਬਣਾਈ ਗਈ{"role": "assistant", "tool_calls": [...]}ਡਿਕਸ਼ਨਰੀ ਨਾ ਪਾਓ), ਫਿਰ ਹਰ ਨਤੀਜੇ ਲਈfunction_call_outputਆਈਟਮ ਜੋੜੋ। - ਕੁਝ-ਸ਼ਟ ਟੂਲ ਉਦਾਹਰਨਾਂ: ਜੇ ਗੱਲਬਾਤ ਵਿੱਚ ਹਾਰਡਕੋਡ ਕੀਤੇ ਟੂਲ ਕਾਲ ਉਦਾਹਰਨ ਸ਼ਾਮਿਲ ਹਨ, ਤਾਂ ਉਨ੍ਹਾਂ ਨੂੰ
{"type": "function_call", "id": "fc_...", "call_id": "fc_...", ...}+{"type": "function_call_output", ...}ਆਈਟਮਾਂ ਵਿੱਚ ਬਦਲੋ। IDs ਨੂੰfc_ਨਾਲ ਸ਼ੁਰੂ ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ। pydantic_function_tool(): ਇਹ ਹੈਲਪਰ ਅਜੇ ਵੀ ਪੁਰਾਣੇ ਨੇਸਟਡ ਫਾਰਮੈਟ ਨੂੰ ਜਨਰੇਟ ਕਰਦਾ ਹੈ ਅਤੇresponses.create()ਨਾਲ ਸਮਰਥਕ ਨਹੀਂ ਹੈ। ਨੂੰ ਮੈਨੂਅਲ ਟੂਲ ਪਰਿਭਾਸ਼ਾਵਾਂ ਜਾਂ ਫਲੈਟਨਿੰਗ ਰੈਪਰੇ ਨਾਲ ਬਦਲੋ।- ਮਲਟੀ-ਟਰਨ: ਐਪ ਵਿੱਚ ਗੱਲਬਾਤ ਇਤਿਹਾਸ ਨੂੰ ਬਣਾਈ ਰੱਖੋ; ਪਹਿਲਾਂ ਦੇ ਟਰਨ
inputਆਈਟਮਾਂ ਰਾਹੀਂ ਪਾਸ ਕਰੋ। - ਫਾਰਮੈਟਿੰਗ: Chat ਦੇ ਟੌਪ-ਲੇਵਲ
response_formatਨੂੰ Responses ਵਿੱਚtext.formatਨਾਲ ਬਦਲੋ। ਕੈਨਾਨੀਕਲ ਆਕਾਰ:text={"format": {"type": "json_schema", "name": "Output", "strict": True, "schema": {...}}}. - ਸਮੱਗਰੀ ਆਈਟਮ: Chat ਦੇ
content[].type: "text"ਨੂੰ Responses ਦੇcontent[].type: "input_text"ਨਾਲ ਬਦਲੋ ਜਦੋਂ ਵਰਤੋਂਕਾਰ/ਸਿਸਟਮ ਟਰਨ ਹੋਣ। - ਚਿੱਤਰ ਸਮੱਗਰੀ ਆਈਟਮ: Chat ਦੇ
content[].type: "image_url"ਨੂੰ Responses ਦੇcontent[].type: "input_image"ਨਾਲ ਬਦਲੋ।image_urlਫੀਲਡ ਨੇਸਟਡ ਓਬਜੈਕਟ{"url": "..."}ਤੋਂ ਫਲੈਟ ਸਟਰਿੰਗ ਵਿੱਚ ਬਦਲ ਜਾਂਦਾ ਹੈ। ਪਹਿਲਾਂ/ਬਾਅਦ ਦੇ ਉਦਾਹਰਨਾਂ ਲਈ ਚੀਟ ਸ਼ੀਟ ਵੇਖੋ। - ਸੋਚ-ਵਿਚਾਰ ਯਤਨ: ਸਿਰਫ਼ ਜੇ ਪਹਿਲਾਂ ਹੀ ਮੂਲ ਕੋਡ ਵਿੱਚ
reasoningਮੌਜੂਦ ਹੈ ਤਾਂ ਹੀ ਇਸ ਨੂੰ ਮਾਈਗਰੇਟ ਕਰੋ। - ਸਮੱਗਰੀ ਫਿਲਟਰ ਤਰੁੱਟੀ ਹੈਂਡਲਿੰਗ: ਤਰੁੱਟੀ ਬਾਡੀ ਢਾਂਚਾ ਬਦਲ ਗਿਆ ਹੈ। Chat Completions ਨੇ
error.body["innererror"]["content_filter_result"](ਇਕਵਚਨ) ਵਰਤਿਆ; Responses APIerror.body["content_filters"][0]["content_filter_results"](ਬਹੁਵਚਨ, ਇੱਕ ਐਰੇ ਵਿੱਚ) ਵਰਤਦਾ ਹੈ। ਜੋ ਕੋਡinnererrorਤੱਕ ਪਹੁੰਚਦਾ ਹੈ, ਉਹKeyErrorਦੇਵਗਾ। ਨਵਾਂ ਰਾਸ਼ਤਾ ਵਰਤਣ ਲਈ ਦੁਬਾਰਾ ਲਿਖੋ। - ਕੱਚੇ HTTP ਕਾਲਜ਼: ਜੇ ਐਪ Azure OpenAI REST API ਨੂੰ ਸਿੱਧਾ
/openai/deployments/{name}/chat/completions?api-version=...ਵਰਤ ਕੇ ਕਾਲ ਕਰਦੀ ਹੈ, ਤਾਂ ਇਸਨੂੰ/openai/v1/responsesਵਿੱਚ ਬਦਲੋ। ਬੇਨਤੀ ਬਾਡੀ ਬਦਲਦੀ ਹੈ:messages→input,max_output_tokensਜੋੜੋ ਅਤੇstore: falseਜੋੜੋ,api-versionਕ੍ਵੈਰੀ ਪੈਰਾਮ ਹਟਾਓ। ਜਵਾਬ ਬਾਡੀ ਬਦਲਦੀ ਹੈ:choices[0].message.content→output[0].content[0].text(ਨੋਟ:output_textਇੱਕ SDK ਸਹੂਲਤ ਪ੍ਰਾਪਰਟੀ ਹੈ ਜੋ ਕੱਚੇ REST JSON ਵਿੱਚ ਨਹੀਂ ਹੁੰਦੀ)।
ਕਦਮ 2: ਮਾਈਗ੍ਰੇਸ਼ਨ ਲਾਗੂ ਕਰੋ
ਮਾਈਗ੍ਰੇਸ਼ਨ ਨੋਟਸ (Chat Completions → Responses)
- ਕਿਉਂ ਮਾਈਗ੍ਰੇਟ ਕਰਨਾ: Responses ਪਾਠ, ਟੂਲਜ਼ ਅਤੇ ਸਟ੍ਰੀਮਿੰਗ ਲਈ ਇਕੱਤਰ API ਹੈ; Chat Completions ਪੁਰਾਣਾ ਹੈ। GPT-5 ਦੇ ਨਾਲ, Responses ਵਧੀਆ ਪ੍ਰਦਰਸ਼ਨ ਲਈ ਜ਼ਰੂਰੀ ਹੈ।
- HTTP: ਐਜ਼ਰ ਏਂਡਪੌਇੰਟ
/openai/deployments/{name}/chat/completionsਤੋਂ/openai/v1/responses'ਤੇ ਬਦਲਦਾ ਹੈ। - ਫੀਲਡਜ਼:
messages→input,max_tokens→max_output_tokens।temperatureਜਿਵੇਂ ਦਾ ਤਿਵੇਂ ਹੈ। - ਫਾਰਮੈਟਿੰਗ:
response_format→text.formatਇਕ ਢੰਗ ਦਾ ਆਬਜੈਕਟ। - ਸਮੱਗਰੀ ਆਈਟਮ: Chat ਦੇ
content[].type: "text"ਨੂੰ Responses ਦੇcontent[].type: "input_text"ਨਾਲ ਬਦਲੋ ਜਦੋਂ ਸਿਸਟਮ/ਉਪਭੋਗਤਾ ਟਰਨ ਹੋਣ। - ਚਿੱਤਰ ਸਮੱਗਰੀ ਆਈਟਮ: Chat ਦੇ
content[].type: "image_url"ਨੂੰ Responses ਦੇcontent[].type: "input_image"ਨਾਲ ਬਦਲੋ।image_urlਫੀਲਡ ਨੂੰ{"image_url": {"url": "..."}}ਤੋਂ{"image_url": "..."}(ਸਧਾਰਣ ਸਟਰਿੰਗ — https URL ਜਾਂdata:image/...;base64,...ਡੇਟਾ ਯੂਆਰਆਈ) ਵਿੱਚ ਫਲੈਟ ਕਰੋ।
ਪੈਰਾਮੀਟਰ ਮੇਪਿੰਗ ਰੇਫਰੰਸ
| Chat Completions | Responses API |
prompt | input |
messages | input (ਆਈਟਮਾਂ ਦਾ ਐਰੇ) |
max_tokens | max_output_tokens |
response_format | text.format (ਆਬਜੈਕਟ) |
temperature | temperature (ਬਦਲਾਅ ਬਿਨਾਂ) |
stop | stop (ਬਦਲਾਅ ਬਿਨਾਂ) |
frequency_penalty | frequency_penalty (ਬਦਲਾਅ ਬਿਨਾਂ) |
presence_penalty | presence_penalty (ਬਦਲਾਅ ਬਿਨਾਂ) |
tools / function-calling | tools (ਬਦਲਾਅ ਬਿਨਾਂ) |
seed | ਹਟਾਓ (ਸਮਰਥਿਤ ਨਹੀਂ) |
store | store (false ਤੇ ਸੈਟ) |
content[].type: "text" | content[].type: "input_text" |
content[].type: "image_url" | content[].type: "input_image" |
"image_url": {"url": "..."} | "image_url": "..." (ਫਲੈਟ ਸਟਰਿੰਗ) |
ਪੂਰੇ ਪਹਿਲਾਂ/ਬਾਅਦ ਕੋਡ ਉਦਾਹਰਨਾਂ ਲਈ, cheat-sheet.md ਵੇਖੋ।
ਟੈਸਟ ਢਾਂਚਾ ਮਾਈਗ੍ਰੇਸ਼ਨ (ਮਾਕ, ਸਨੈਪਸ਼ਾਟ, ਦਾਵੇ) ਲਈ test-migration.md ਵੇਖੋ।
ਤਰੁੱਟੀਆਂ ਅਤੇ ਗੋਚਾਸ਼ ਲਈ troubleshooting.md ਵੇਖੋ।
ਡੇਟਾ ਰੀਟੈਂਸ਼ਨ ਅਤੇ ਸਥਿਤੀ
- ਸਾਰੀਆਂ Responses ਬੇਨਤੀਆਂ ਤੇ
store: falseਸੈਟ ਕਰੋ। - ਪਿਛਲੇ ਸੁਨੇਹੇ IDs ਜਾਂ ਸਰਵਰ-ਸਟੋਰ ਕੀਤੀ ਸੰਦਰਭ ਤੇ ਨਿਰਭਰ ਨਾ ਕਰੋ; ਰਾਜ ਕਲਾਇੰਟ-ਪ੍ਰਬੰਧਿਤ ਰੱਖੋ ਅਤੇ ਮੈਟਾਡੇਟਾ ਘਟਾਓ।
ਸੁਵੀਕਾਰਤਾ ਮਾਪਦੰਡ
ਕੋਡ-ਸਤਰੀ ਦਰਵਾਜੇ (ਸਾਰੇ ਪਾਸ ਹੋਣੇ ਚਾਹੀਦੇ ਹਨ)
rg "chat\.completions\.create|ChatCompletion\.create|Completion\.create"ਲਈ ਮਾਈਗ੍ਰੇਟ ਕੀਤੇ ਫਾਇਲਾਂ ਵਿੱਚ ਜ਼ੀਰੋ ਮੇਲ।rg "AzureOpenAI\(|AsyncAzureOpenAI\("ਲਈ ਜ਼ੀਰੋ ਮੇਲ — ਸਾਰੇ ਨਿਰਮਾਤਾOpenAI/AsyncOpenAIਵਰਤਦੇ ਹਨ v1 ਏਂਡਪੌਇੰਟ ਨਾਲ।rg "models\.github\.ai|models\.inference\.ai\.azure"ਲਈ ਜ਼ੀਰੋ ਮੇਲ — GitHub ਮਾਡਲ ਕੋਡ ਰਾਹ ਹਟਾਏ ਗਏ।rg "OpenAIChatCompletionClient"ਲਈ ਜ਼ੀਰੋ ਮੇਲ — MAF 1.0.0+ ਕੋਡOpenAIChatClientਵਰਤਦਾ ਹੈ (ਜੋ Responses API ਵਰਤਦਾ ਹੈ)। ਪਹਿਲਾਂ ਦੇ ਵਰਜਨ ਵਿੱਚ,agent-framework-openai>=1.0.0ਤੱਕ ਅਪਗ੍ਰੇਡ ਕਰੋ।- ਸਾਰੇ
ChatOpenAI(...)ਕਾਲuse_responses_api=Trueਸ਼ਾਮਿਲ ਕਰਦੇ ਹਨ। rg "choices\[0\]"ਲਈ ਜ਼ੀਰੋ ਮੇਲ — ਸਾਰਾ ਜਵਾਬresp.output_textਜਾਂ Responses ਆਉਟਪੁੱਟ schema ਵਰਤਦਾ ਹੈ।- ਉੱਪਰਲੇ ਪੱਧਰ 'ਤੇ ਕੋਈ
response_formatਨਹੀਂ; ਸਾਰਾ ਸੰਰਚਿਤ ਨਤੀਜਾtext={"format": {...}}ਵਰਤਦਾ ਹੈ। openai>=1.108.1ਅਤੇazure-identityਨੂੰrequirements.txtਜਾਂpyproject.tomlਵਿੱਚ ਸ਼ਾਮਿਲ ਕੀਤਾ ਅਤੇ ਡਿਪੇਂਡੈਂਸੀਜ਼ ਦੁਬਾਰਾ ਇੰਸਟਾਲ ਕੀਤੀਆਂ।- ਹਰ
responses.createਕਾਲ 'ਤੇstore=Falseਸੈਟ ਕੀਤਾ। - ਕਲਾਇੰਟ ਨਿਰਮਾਣ ਵਿੱਚ ਕੋਈ
api_versionਨਹੀਂ;AZURE_OPENAI_API_VERSIONਨੂੰ env ਫਾਇਲਾਂ ਅਤੇ ਇੰਫਰਾ ਤੋਂ ਹਟਾਇਆ ਗਿਆ।
ਟੈਸਟ ਢਾਂਚਾ ਦਰਵਾਜੇ (ਸਾਰੇ ਪਾਸ ਹੋਣੇ ਚਾਹੀਦੇ ਹਨ)
rg "ChatCompletionChunk|AsyncCompletions\.create|chat\.completions" tests/ਲਈ ਜ਼ੀਰੋ ਮੇਲ।rg "_azure_ad_token_provider" tests/ਲਈ ਜ਼ੀਰੋ ਮੇਲ — ਦਾਅਵੇ ਨਵੀਨ ਕੀਤੇ ਗਏ ਹਨ ਤਾਂ ਜੋ ਜਾਂਚ ਹੋਵੇisinstance(client, AsyncOpenAI)ਜਾਂbase_url।rg "prompt_filter_results|content_filter_results" tests/ਲਈ ਜ਼ੀਰੋ ਮੇਲ — Azure-ਵਿਸ਼ੇਸ਼ ਫਿਲਟਰ ਮਾਕ ਹਟਾਏ ਗਏ।- ਮੌਕ ਫਿਕਸਚਰਜ਼ ਵਿੱਚ
kwargs.get("input")ਵਰਤਿਆ ਗਿਆ ਹੈ ਨਾ ਕਿkwargs.get("messages")। - ਸਨੈਪਸ਼ਾਟ / ਗੋਲਡਨ ਫਾਇਲਾਂ Responses ਸਟ੍ਰੀਮਿੰਗ ਆਕਾਰ ਲਈ ਅਪਡੇਟ ਕੀਤੀਆਂ (ਕੋਈ
choices[0],function_call,logprobsਆਦਿ ਨਹੀਂ)। - ਸਾਰੇ ਟੈਸਟ ਅਪਡੇਟਾਂ ਤੋਂ ਬਾਅਦ
pytestਕਿਸੇ ਵੀ ਫੇਲਿਊਰ ਦੇ ਬਿਨਾਂ ਪਾਸ ਹੁੰਦਾ ਹੈ।
ਵਿਹਾਰਕ ਦਰਵਾਜੇ (ਮੈਨੂਅਲ ਜਾਂ ਟੈਸਟ ਹਰਨੇਸ ਰਾਹੀਂ ਸੱਚਿਤ ਕਰੋ)
- ਮੂਲ ਸਪੂਰਨਤਾ: ਨਾਨ-ਸਟ੍ਰੀਮਿੰਗ
responses.createਖਾਲੀ ਨਾ ਹੋਣ ਵਾਲਾoutput_textਵਾਪਸ ਕਰਦਾ ਹੈ। - ਸਟ੍ਰੀਮ ਗੁਣਵੱਤਾ: ਜੇ ਮੂਲ ਕੋਡ ਸਟ੍ਰੀਮਿੰਗ ਵਰਤਦਾ ਸੀ, ਤਾਂ ਮਾਈਗ੍ਰੇਟ ਕੀਤਾ ਕੋਡ ਸਟ੍ਰੀਮ ਕਰਦਾ ਹੈ ਅਤੇ ਕੋਡੈਲਟਸ ਨਾਲ
response.output_text.deltaਘਟਨਾਵਾਂ ਦਿੰਦਾ ਹੈ। - ਸੰਰਚਿਤ ਆਉਟਪੁੱਟ: ਜੇ
text.formatjson_schemaਨਾਲ ਵਰਤ ਰਿਹਾ ਹੈ, ਤਾਂjson.loads(resp.output_text)ਕਾਮਯਾਬ ਹੁੰਦਾ ਹੈ ਅਤੇ ਸਕੀਮਾ ਨਾਲ ਮੇਲ ਖਾਂਦਾ ਹੈ। - ਟੂਲ-ਕਾਲ ਲੂਪ: ਜੇ ਟੂਲ ਵਰਤੇ ਜਾਂਦੇ ਹਨ, ਤਾਂ ਮਾਡਲ ਟੂਲ ਕਾਲ ਜਾਰੀ ਕਰਦਾ ਹੈ, ਐਪ ਉਹਨਾਂ ਨੂੰ ਚਲਾਉਂਦਾ ਹੈ, ਅਤੇ ਫਾਲੋ-ਅਪ ਬੇਨਤੀ ਅੰਤਿਮ
output_textਵਾਪਸ ਕਰਦੀ ਹੈ (ਅਨੰਤ ਲੂਪ ਨਹੀਂ)। - ਐਸਿੰਕ ਗੁਣਵੱਤਾ: ਜੇ
AsyncAzureOpenAIਵਰਤਿਆ ਗਿਆ ਸੀ, ਤਾਂAsyncOpenAIਸਮਕਾਲੀawaitਨਾਲ ਕੰਮ ਕਰਦਾ ਹੈ। - ਤਰੁੱਟੀ ਦਰ: ਮਾਈਗ੍ਰੇਸ਼ਨ ਤੋਂ ਪਹਿਲਾਂ ਦੇ ਮੂਲ ਦਰਜੇ ਨਾਲੋਂ ਕੋਈ ਇੱਕ 400/401/404 ਤਰੁੱਟੀ ਨਹੀਂ ਆਈ।
ਡਿਲਿਵਰੇਬਲਜ਼
- ਸੰਖੇਪ ਵਿੱਚ ਸੋਧੇ ਹੋਏ ਫਾਇਲਾਂ, ਲੇਗਸੀ ਕਾਲ ਸਾਈਟਾਂ ਦੀ ਗਿਣਤੀ ਪਹਿਲਾਂ/ਬਾਅਦ, ਅਤੇ ਅਗਲੇ ਕਦਮ ਸ਼ਾਮਿਲ ਹਨ।
- ਬਦਲਾਅ ਕੰਮ ਕਰ ਰਹੇ ਟ੍ਰੀ ਸੋਧ ਹਨ (ਕੋਈ ਕਮੇਟ ਨਹੀਂ)।
SDK ਵਰਜਨ ਦੀਆਂ ਜ਼ਰੂਰਤਾਂ
| ਪੈਕੇਜ | ਘੱਟੋ-ਘੱਟ ਵਰਜਨ |
openai | >=1.108.1 |
azure-identity | ਤਾਜ਼ਾ (EntraID ਅਥੇਂਟੀਕੇਸ਼ਨ ਲਈ) |
ਹਵਾਲੇ
- ਚੀਟ ਸ਼ੀਟ — ਸਾਰੇ ਕੋਡ ਸਨਿੱਪੇਟ
- ਟੈਸਟ ਮਾਈਗ੍ਰੇਸ਼ਨ — ਮਾਕ, ਸਨੈਪਸ਼ਾਟ, ਦਾਵੇ
- ਤਰੁੱਟੀ ਸੰਭਾਲ — ਤਰੁੱਟੀਆਂ, ਖਤਰਾ ਟੇਬਲ, ਗੋਚਾਸ਼
- detect_legacy.py — ਸੁਆਰੰਭਿਕ ਸਕੈਨਰ
- Azure OpenAI ਸਟਾਰਟਰ ਕਿਟ
- Azure OpenAI Responses API ਡੌਕਸ
- Azure OpenAI API ਵਰਜਨ ਲਾਈਫਸਾਈਕਲ
- OpenAI Responses API ਸੰਦਰਭ
<!-- CO-OP TRANSLATOR DISCLAIMER START -->ਅਸਵੀਕਾਰੋਪਣ: ਇਸ ਦਸਤਾਵੇਜ਼ ਦਾ ਅਨੁਵਾਦ ਏਆਈ ਅਨੁਵਾਦ ਸੇਵਾ Co-op Translator ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਕੀਤਾ ਗਿਆ ਹੈ। ਜਦੋਂ ਕਿ ਅਸੀਂ ਸਹੀਤਾਵਾਂ ਲਈ ਯਤਨਸ਼ੀਲ ਹਾਂ, ਕਿਰਪਾ ਕਰਕੇ ਧਿਆਨ ਰੱਖੋ ਕਿ ਸਵੈਚਾਲਿਤ ਅਨੁਵਾਦਾਂ ਵਿੱਚ ਗਲਤੀਆਂ ਜਾਂ ਅਸਮੱਤਿਆਵਾਂ ਹੋ ਸਕਦੀਆਂ ਹਨ। ਮੂਲ ਦਸਤਾਵੇਜ਼ ਆਪਣੀ ਮੂਲ ਭਾਸ਼ਾ ਵਿੱਚ ਅਧਿਕਾਰਕ ਸਰੋਤ ਮੰਨਿਆ ਜਾਣਾ ਚਾਹੀਦਾ ਹੈ। ਜਰੂਰੀ ਜਾਣਕਾਰੀ ਲਈ, ਪੇਸ਼ੇਵਰ ਮਨੁੱਖੀ ਅਨੁਵਾਦ ਦੀ ਸਿਫ਼ਾਰਸ਼ ਕੀਤੀ ਜਾਂਦੀ ਹੈ। ਅਸੀਂ ਇਸ ਅਨੁਵਾਦ ਦੇ ਉਪਯੋਗ ਤੋਂ ਪੈਦਾ ਹੋਣ ਵਾਲੀਆਂ ਕਿਸੇ ਵੀ ਗਲਤਫਹਿਮੀਆਂ ਜਾਂ ਗਲਤ ਵਿਆਖਿਆਵਾਂ ਲਈ ਜਵਾਬਦੇਹ ਨਹੀਂ ਹਾਂ।
<!-- CO-OP TRANSLATOR DISCLAIMER END -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

