azure-openai-to-responses
Skill76k starsChanged 5 months agoMITView on GitHub
ការណែនាំមានសណ្ឋាន — អនុវត្តតាមយ៉ាងម៉ត់ចត់ ជំនាញនេះបម្រើការផ្លាស់ប្តូរកូដ Python ដែលប្រើ Azure OpenAI Chat Completions ទៅ Responses API តែមួយគត់។ សូមអនុវត្តតាមបទបញ្ជាទាំងនេះយ៉ាងម៉ត់ចត់។ កុំបង្កើតការផ្គូផ្គងអថេរឬបង្កើតរូបរាង API ថ្មីៗឡើយ។ សកម្មភាពជំនាញនេះនៅពេលដែលអ្នកប្រើប្រាស់ចង់: - ផ្លាស់ប្តូរកម្មវិធី Python ពី Azure OpenAI Chat Completions ទៅ Responses API - បន្ថែមការប្រើប្រាស់ Python OpenAI SDK ទៅរូបរាង API ថ្មី ដែលឆ្លošបញ្ចូលជាមួយ Azure OpenAI - ត្រៀមកូដ Python សម្រាប់ម៉ូដែល GPT-5 ឬថ្មីជាងដែលទាមទារ Responses នៅលើ Azure - ផ្លាស់ពី AzureOpenAI/AsyncAzureOpenAI ទៅ client OpenAI/AsyncOpenAI ផ្លូវការដោយប្រើចំណុចបញ្ចប់ v1 - កែបញ្ហាផ្សព្វផ្សាយថា AzureOpenAI constructors ឬ api_version មុននឹងផ្លាស់ប្តូរ សូមបញ្ជាក់ថាការដំឡើង Azure OpenAI របស់អ្នកគាំទ្រ Responses API។ ចំណាំ: max_output_tokens មានតម្លៃតិចបំផុត 16 នៅលើ Azure OpenAI។ តម្លៃក្រោម 16…
- 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
ផ្លាស់ប្តូរកម្មវិធី Python ពី Azure OpenAI Chat Completions ទៅ Responses API
ការណែនាំមានសណ្ឋាន — អនុវត្តតាមយ៉ាងម៉ត់ចត់
ជំនាញនេះបម្រើការផ្លាស់ប្តូរកូដ Python ដែលប្រើ Azure OpenAI Chat Completions ទៅ Responses API តែមួយគត់។ សូមអនុវត្តតាមបទបញ្ជាទាំងនេះយ៉ាងម៉ត់ចត់។ កុំបង្កើតការផ្គូផ្គងអថេរឬបង្កើតរូបរាង API ថ្មីៗឡើយ។
ការផ្ទាំងចាប់ផ្តើម
សកម្មភាពជំនាញនេះនៅពេលដែលអ្នកប្រើប្រាស់ចង់:
- ផ្លាស់ប្តូរកម្មវិធី Python ពី Azure OpenAI Chat Completions ទៅ Responses API
- បន្ថែមការប្រើប្រាស់ Python OpenAI SDK ទៅរូបរាង API ថ្មី ដែលឆ្លošបញ្ចូលជាមួយ Azure OpenAI
- ត្រៀមកូដ Python សម្រាប់ម៉ូដែល GPT-5 ឬថ្មីជាងដែលទាមទារ Responses នៅលើ Azure
- ផ្លាស់ពី
AzureOpenAI/AsyncAzureOpenAIទៅ clientOpenAI/AsyncOpenAIផ្លូវការដោយប្រើចំណុចបញ្ចប់ v1 - កែបញ្ហាផ្សព្វផ្សាយថា
AzureOpenAIconstructors ឬ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មានតម្លៃតិចបំផុត 16 នៅលើ Azure OpenAI។ តម្លៃក្រោម 16 នឹងបញ្ជូនកំហុស 400។ សូមប្រើ 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 ជាច្រើនទេ។ គ្រាន់តែផ្លាស់ប្តូរreasoningប្រសិនបើវាមានរួចនៅក្នុងកូដដើម។- ប៉ារ៉ាម៉ែត្រ
seed: មិនគាំទ្រនៅ Responses API ទេ — ត្រូវដកចេញពីសំណើទាំងអស់។- លទ្ធផលមានរចនាសម្ព័ន្ធតាម
text.format: ម៉ូដែលចាស់ប្រហែលមិនអនុវត្ត JSON schemasstrict: trueយ៉ាងម៉ត់ចត់ទេ។- ការផ្គុងគ្នាឧបករណ៍: GPT-5+ គ្រប់គ្រងការហៅឧបករណ៍ជាផ្នែកនៃការគិតនៅខាងក្នុង។ ម៉ូដែលចាស់នៅ Responses នៅមុខមុនក៏ដំណើរការបាន ប៉ុន្តែមិនមានការចូលរួមជ្រៅនេះទេ។
- កម្រិតសីតុណ្ហភាព: ពេលផ្លាស់ប្តូរទៅ
gpt-5តម្លៃសីតុណ្ហភាពត្រូវតែបោះបង់ ឬកំណត់ជា1។ ម៉ូដែលចាស់មិនមានកំណត់បែបនេះ។
ម៉ូដែល reasoning ស៊េរី O (o1, o3-mini, o3, o4-mini)
ម៉ូដែលស៊េរី O មានកំណត់ប៉ារ៉ាម៉ែត្រ ពេលផ្លាស់ប្តូរកម្មវិធីដែលគោលបំណងទៅម៉ូដែលស៊េរី O:
temperature: ត្រូវតែជា1(ឬករណីមិនប្រើ)។ ម៉ូដែលស៊េរី O មិនទទួលតម្លៃផ្សេងទេ។max_completion_tokens→max_output_tokens: កម្មវិធីប្រើmax_completion_tokensជាពិសេសរបស់ Azure ត្រូវប្ដូរទៅmax_output_tokens។ កំណត់តម្លៃខ្ពស់ (4096+) ព្រោះ reasoning tokens នឹងរាប់ក្នុងកម្រិតដឹកនាំ។reasoning_effort: ប្រសិនបើកម្មវិធីប្រើreasoning_effort(ទាប/មធ្យម/ខ្ពស់) សូមរក្សាទុក — Responses API គាំទ្រប៉ារ៉ាម៉ែត្រនេះសម្រាប់ម៉ូដែលស៊េរី O។- អាកប្បកិរិយាស្ទ្រីម: ម៉ូដែលស៊េរី O អាចផ្ទុកលទ្ធផលរហូតដល់ការគិតបញ្ចប់មុនផ្ទុកព្រឹត្តិការ delta អត្ថបទ។ ស្ទ្រីមមិនប្រែប្រួល ប៉ុន្តែ
response.output_text.deltaជាលើកដំបូងប្រហែលមកយឺតជាងម៉ូដែល GPT។ top_p: មិនគាំទ្រលើស៊េរី o — ត្រូវដកចេញប្រសិនបើមាន។- ការប្រើឧបករណ៍: ម៉ូដែលស៊េរី O គាំទ្រឧបករណ៍តាម Responses API ដូចម៉ូដែល GPT ប៉ុន្តែគុណភាពការគ្រប់គ្រងការហៅឧបករណ៍ខុសគ្នា។
សកម្មភាព — ផ្ដល់ដំណឹងជាមុនអំពីម៉ូដែល: ក្នុងដំណាក់កាលស្កេន ប្រើប្រាស់ដឹងថា ម៉ូដែលកំណត់គោលបំណងកម្មវិធី (ឈ្មោះ deployment, រលកបរិស្ថាន, config) បើម៉ូដែលមុន gpt-4.1 (មិនមែន gpt-4.1+) សូមប្រាប់អ្នកប្រើប្រាស់ជាមុន:
- ការផ្លាស់ប្តូរនឹងធ្វើការជាមួយអត្ថបទមូលដ្ឋាន, ជជែក, ស្ទ្រីម និងឧបករណ៍លើម៉ូដែលបច្ចុប្បន្ន។
- ម៉ូដែលថ្មី (
gpt-5.1,gpt-5.2) ផ្តល់ជូនការគ្រប់គ្រងឧបករណ៍ល្អប្រសើរ លទ្ធផលមានរចនាសម្ព័ន្ធល្អ ការគិត និងមាននៅតំបន់ជាយថាហេតុ។ - ពួកគេគួរជម្រាបជូនការដំឡើងរបស់ពួកគេនៅពេលដែលពេញចិត្ត — វាមិនរាំងស្ងើចការផ្លាស់ប្តូរទេ។
កុំរាំងស្ងើច ឬបដិសេធការផ្លាស់ប្តូរដោយផ្អែកលើកំណែម៉ូដែលទេ។ ការណែនាំនេះគ្រាន់តែជាសេចក្ដីជ្រាបតែប៉ុណ្ណោះ។
ម៉ូដែល GitHub មិនគាំទ្រ Responses API
ម៉ូដែល GitHub (
models.github.ai,models.inference.ai.azure.com) មិនគាំទ្រ Responses API ទេ។
ប្រសិនបើកូដដើមមានផ្លូវលេខ GitHub Models (មើល base_url បង្ហាញទៅ models.github.ai ឬ models.inference.ai.azure.com), លុបទាំងស្រុង ពេលផ្លាស់ប្តូរ។ Responses API ត្រូវប្រើ Azure OpenAI, OpenAI, ឬចំណុចបញ្ចប់មូលដ្ឋានសមស្រប (ឧ. Ollama មានការគាំទ្រ Responses)។
សកម្មភាពនៅពេលស្កេន:
- សម្គាល់ផ្លូវលេខកូដ GitHub Models សម្រាប់លុបចេញ។
ការផ្លាស់ប្តូរគ្រឹះសម្ព័ន្ធ
កម្មវិធីជាច្រើនប្រើ framework ដាន់ខ្ពស់លើ OpenAI។ ពេលផ្លាស់ប្តូរទាំងនេះ ការផ្លាស់ប្តូរជាក្នុង API ឯករាជ្យរបស់ framework មិនមែនត្រឹមតែកូដ OpenAI រុំៗទេ។
Microsoft Agent Framework (MAF)
ពិនិត្យកំណែ MAF របស់អ្នកមុន — ការផ្លាស់ប្តូរនេះអាស្រ័យលើថា អ្នកកំពុងប្រើ MAF 1.0.0+ ឬ beta/rc មុន 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 មុន 1.0.0 (បោះពុម្ព beta/rc)
នៅក្នុង MAF មុន 1.0.0, OpenAIChatClient ប្រើ Chat Completions។ ធ្វើបច្ចុប្បន្នភាពទៅ agent-framework-openai>=1.0.0 ដែល OpenAIChatClient ប្រើ Responses API ដោយស្វ័យប្រវត្តិ។
មិនចាំបាច់ផ្លាស់ប្តូរផ្សេងៗទៀត — Agent និង API ឧបករណ៍នៅដដែល។
LangChain (langchain-openai)
បន្ថែម use_responses_api=True ទៅក្នុង ChatOpenAI()។ ក៏បន្ទាន់សម័យការចូលប្រើលទ្ធផលពី .content ទៅ .text។
| មុន | បន្ទាប់ |
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 ដោយផ្ទាល់ដោយ key មួយផ្នែកមុខ សូមផ្លាស់ប្ដូរហៅទៅផ្នែកក្រោយ ជាចម្បង។
ការលះបង់ @microsoft/ai-chat-protocol
បណ្ដុំនិពន្ធ npm @microsoft/ai-chat-protocol លះបង់ និងគួរត្រូវបានជំនួសដោយ ndjson-readablestream។ ប្រសិនបើអ្នកជួបប្រទៈវានៅផ្នែកមុខ៖
១. ជំនួសតេកដ្ឋាន script 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 ទាំងអស់ប្រើ Chat Completions ឬ legacy Completions លើ Azure OpenAI។
- ផ្តល់ផែនការផ្លាស់ប្តូរ និងលំដាប់សម្រាប់កូដ Python។
- អនុវត្តកែប្រែយ៉ាងប្រុងប្រយ័ត្ន និងតិចតួច ដើម្បីផ្លាស់ទៅ Responses API។
- ដំឡើងអ្នកហៅឲ្យប្រើស្កីម៉ាផលិតផល Responses; គ្មានស្រោមទ្រនាប់សំរាប់ Backcompat។
- ដំណើរការប្រឡង/ប្រឡូល; ដោះស្រាយបញ្ហាធម្មតាដែលបង្កឡើងដោយការផ្លាស់ប្តូរ។
- ត្រៀមសំណុំផ្លាស់ប្តូរតូចៗអាចស្ទង់មើល និងផ្តល់សេចក្ដីសង្ខេបចុងក្រោយជាមួយតម្រឹម (កុំ commit)។
បញ្ជីសុវត្ថិភាព
- ត្រូវកែប្រែគ្រាន់តែឯកសារក្នុងបរិវេណ git ប៉ុណ្ណោះ។ មិនចោលពីក្រៅនោះទេ។
- មិនផ្ដល់ការកាន់កាប់សមត្ថភាពមុន; ផ្លាស់ប្តូរកូដទៅរូបរាង API ថ្មី។
- មិនទុកមតិយោបល់ការផ្លាស់ប្ដូរ ឬឯកសារបម្រុងទុកទាន់ពេលបានឡើយ។
- គោរពភាពស្ទ្រីមបើវាបានគេចនា; បើមិនដូច្នោះប្រើមិនស្ទ្រីម។
- សុំអនុម័តមុនពេលដំណើរការការបញ្ជា ឬហៅបណ្ដាញ ប្រសិនបើនៅនៅមុខងារអនុម័ត។
- មិនដំណើរការ
git add/git commit/git push; ផលិតតែការកែប្រែទិន្នន័យនៅក្នុង working-tree។
ជំហាន 0: ផ្លាស់ប្តូរ Azure OpenAI Client (លក្ខខណ្ឌមុន)
ប្រសិនបើកូដប្រើ constructors AzureOpenAI ឬ AsyncAzureOpenAI, សូមផ្លាស់ទៅ constructors OpenAI / AsyncOpenAI ផ្លូវការដំបូង។ constructors របស់ Azure សម្រាប់ openai>=1.108.1 ត្រូវបានលះបង់។
ហេតុអ្វីត្រូវប្រើផ្លូវ API v1?
ចំណុចបញ្ចប់ថ្មី /openai/v1 ប្រើ client OpenAI() ផ្លូវការមិនយោង AzureOpenAI(), មិនចាំបាច់ប៉ារ៉ាម៉ែត្រ api_version, និងដំណើរការដូចគ្នាតាម OpenAI និង Azure OpenAI។ កូដ client ដូចគ្នា អនាគតធានា — មិនចាំបាច់គ្រប់គ្រងកំណែ។
ការផ្លាស់ប្តូរសំខាន់ៗ
| មុន | បន្ទាប់ |
AzureOpenAI | OpenAI |
AsyncAzureOpenAI | AsyncOpenAI |
azure_endpoint | base_url |
azure_ad_token_provider | api_key |
api_version=... | លុបទាំងស្រុង |
បញ្ជីសម្អាត
- លុបប៉ារ៉ាម៉ែត្រ
api_versionពីការបង្កើត client។ - លុបបរិស្ថានបម្លែង
AZURE_OPENAI_VERSION/AZURE_OPENAI_API_VERSIONពី.env, app settings និងឯកសារ Bicep/infra។ - ប្ដូរ
AZURE_OPENAI_CLIENT_ID→AZURE_CLIENT_IDក្នុង.env, app settings, Bicep/infra, និង test fixtures (ស្តង់ដារ Azure Identity SDK)។ - ប្រាកដថា
openai>=1.108.1នៅក្នុងrequirements.txtឬpyproject.toml។
ផ្លាស់ប្តូរបរិស្ថានបម្លែង
| បរិស្ថានបម្លែងចាស់ | សកម្មភាព | សម្គាល់ |
AZURE_OPENAI_VERSION | លុប | មិនត្រូវការ api_version ជាមួយចំណុចបញ្ចប់ v1 |
AZURE_OPENAI_API_VERSION | លុប | ដូចគ្នា |
AZURE_OPENAI_CLIENT_ID | ប្ដូរឈ្មោះ → AZURE_CLIENT_ID | ស្តង់ដារ Azure Identity SDK សម្រាប់ ManagedIdentityCredential(client_id=...) |
AZURE_OPENAI_ENDPOINT | រក្សាទុក | ត្រូវការសម្រាប់បង្កើត base_url |
AZURE_OPENAI_CHAT_DEPLOYMENT | រក្សាទុក | ប្រើជា model ប៉ារ៉ាម៉ែត្រ នៅ responses.create |
AZURE_OPENAI_API_KEY | រក្សាទុក | ប្រើជា api_key សម្រាប់ការផ្ដល់សិទ្ធិដោយគ្រាប់សោ |
សម្រាប់ឧទាហរណ៍កូដ client (sync, async, EntraID, API key, multi-tenant) សូមមើល cheat-sheet.md។
ជំហាន 1: រកមើលទីកន្លែងហៅប្រពៃណីចាស់
ដំណើរការ script 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
# អថេរបរិយាកាសដែលបានផ្អាកប្រើ (ត្រូវសម្អាត)
rg "AZURE_OPENAI_API_VERSION|AZURE_OPENAI_VERSION"
rg "AZURE_OPENAI_CLIENT_ID" # គួរតែជា AZURE_CLIENT_ID
# ចំណុចគោល GitHub Models (ត្រូវលុប — មិនគាំទ្រ Responses API)
rg "models\.github\.ai|models\.inference\.ai\.azure"
# លំនាំលំដាប់ស៊ុម legacy នៅលើ Framework (ត្រូវចាប់ផ្តើមបច្ចុប្បន្នភាព)
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
# ការហៅ HTTP ដើមទៅចំណុចផ្ដាច់ Chat Completions (ត្រូវបច្ចុប្បន្នភាព URL)
rg "/openai/deployments/.*/chat/completions"
rg "api-version="វិធីសាស្រ្ត (រកឃើញ និងកែប្រែ)
- Client Chat Completions:
client.chat.completions.create→client.responses.create(...). - អ្នកតឹងតែងអតិថិជន Azure៖
AzureOpenAI(...)→OpenAI(base_url=..., api_key=...)។ - ឧបករណ៍៖ បម្លែងកំណត់នៃឧបករណ៍ហៅមុខងារពីទ្រង់ទ្រាយរក្សាទុកក្នុង nested (
{"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", ...}។ អត្តសញ្ញាណត្រូវចាប់ផ្តើមជាមួយfc_។ pydantic_function_tool()៖ ជំនួយនេះនៅតែបង្កើតទ្រង់ទ្រាយ nested ចាស់ ហើយមិន ការព្រមព្រៀង ជាមួយresponses.create()។ ជំនួសដោយកំណត់តែងឧបករណ៍ដោយដៃ ឬប្រើវ៉ារ៉ាប់បាច់បញ្ចូល។- ចំលងជាច្រើនជុំ៖ រក្សាប្រវត្តិកិច្ចសន្ទនានៅក្នុងកម្មវិធី; បញ្ជូនជុំមុនៗតាមរយៈធាតុ
input។ - រចនាប័ទ្ម៖ ជំនួស
response_formatនៅកំពូល Chat ជាtext.formatក្នុង Responses។ ទ្រង់ទ្រាយស្តង់ដា៖text={"format": {"type": "json_schema", "name": "Output", "strict": True, "schema": {...}}}។ - ធាតុមាតិកា៖ បម្លែង
content[].type: "text"របស់ Chat ទៅជាcontent[].type: "input_text"សម្រាប់ជុំអ្នកប្រើ/ប្រព័ន្ធ ក្នុង Responses។ - ធាតុំាតិការូបភាព៖ បម្លែង
content[].type: "image_url"របស់ Chat ទៅជាcontent[].type: "input_image"នៅក្នុង Responses។ ប្រស្នាក់image_urlបម្លែងពីអប្បបរមា nested{"url": "..."}ទៅខ្សែស្រឡាយត្រង់។ មើលស្លាកជំនួយសម្រាប់ឧទាហរណ៍មុន/បន្ទាប់។ - ខិតខំពិចារណា៖ ចូរផ្លាស់ប្តូរ
reasoningតែប៉ុណ្ណោះ ប្រសិនបើវាមានរួចហើយក្នុងកូដដើម។ - ដំណើរការខូចខាតក្នុងការត្រួតពិនិត្យមាតិកា៖ រចនាសម្ព័ន្ធខ្លឹមសារខុស។ Chat Completions ប្រើ
error.body["innererror"]["content_filter_result"](ឯកជន); Responses API ប្រើerror.body["content_filters"][0]["content_filter_results"](ពហុ បញ្ចូលក្នុងតារាង)។ កូដដែលចូលដល់innererrorនឹងបញ្ចេញKeyError។ សូមសរសេរឡើងវិញដើម្បីប្រើផ្លូវថ្មី។ - ហៅ HTTP ដំបូងគ្រប់គ្រាន់៖ ប្រសិនបើកម្មវិធីហៅ REST API Azure OpenAI ដោយផ្ទាល់ (តាម
requests,httpx, ល.) ដោយប្រើ/openai/deployments/{name}/chat/completions?api-version=...សូមបម្លែងទៅ/openai/v1/responses។ ខ្លឹមសារសំណើបម្លែង៖messages→inputផ្ដល់max_output_tokensនិងstore: falseលុបapi-versionquery។ ខ្លឹមសារឆ្លើយតបបម្លែង៖choices[0].message.content→output[0].content[0].text(ចំណាំ៖output_textគឺជាគុណលក្ខណៈ SDK មិនមានក្នុង JSON REST ដើម)។
ជំហានទី 2៖ អនុវត្តការផ្លាស់ប្តូរ
កំណត់សម្គាល់ការផ្លាស់ប្តូរ (Chat Completions → Responses)
- ហេតុផលផ្លាស់ប្តូរ៖ Responses ជា API ឯកសរសម្រាប់អត្ថបទ, ឧបករណ៍ និងការចាក់ទឹក។ Chat Completions ជាគំរូចាស់។ ជាមួយ GPT-5, Responses ត្រូវបានទាមទារសម្រាប់ប្រសិទ្ធភាពអតិបរមា។
- HTTP៖ ចំណុចបញ្ចូល Azure ផ្លាស់ពី
/openai/deployments/{name}/chat/completionsទៅ/openai/v1/responses។ - វាលទិន្នន័យ៖
messages→input,max_tokens→max_output_tokens។temperatureមិនផ្លាស់ប្តូរ។ - រចនាប័ទ្ម៖
response_format→text.formatជាវត្ថុត្រឹមត្រូវ។ - ធាតុមាតិកា៖ ជំនួស
content[].type: "text"របស់ Chat ជាcontent[].type: "input_text"សម្រាប់ជុំប្រព័ន្ធ/អ្នកប្រើក្នុង Responses។ - ធាតុរូបភាព៖ ជំនួស
content[].type: "image_url"របស់ Chat ជាcontent[].type: "input_image"ក្នុង Responses។ ផ្លាស់ប្តូរជំនួសវាលimage_urlពី{"image_url": {"url": "..."}}ទៅ{"image_url": "..."}(ខ្សែស្រឡាយត្រង់ — ទាំង អាសយដ្ឋាន HTTPS ឬ URI ទិន្នន័យ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 / ហៅមុខងារ | 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។
សម្រាប់ផ្លាស់ប្តូរគ្រឹះស្ថានតេស្ត (mocks, snapshots, assertions) សូមមើល test-migration.md។
សម្រាប់ដោះស្រាយកំហុស និងការប្រើប្រាស់ មាននៅ troubleshooting.md។
ការផ្ទុកទិន្នន័យ និងស្ថានភាព
- កំណត់
store: falseលើសំណើ Responses ទាំងអស់។ - មិនពឹងផ្អែកលើអត្តសញ្ញាណសារមុន ឬបរិបទដែលបានរក្សាទុកនៅម៉ាស៊ីនបម្រើ; រក្សាស្ថានភាពដោយការគ្រប់គ្រងរបស់អតិថិជន ហើយកាត់បន្ថយ metadata។
លក្ខខណ្ឌទទួលយក
ច្រកកូដកម្រិត (ទាំងអស់ត្រូវតែជោគជ័យ)
- គ្មានការប្រកួតផ្គូផ្គងសម្រាប់
rg "chat\.completions\.create|ChatCompletion\.create|Completion\.create"ក្នុងឯកសារ ដែលបានផ្លាស់ប្តូរ។ - គ្មានការប្រកួតផ្គូផ្គងសម្រាប់
rg "AzureOpenAI\(|AsyncAzureOpenAI\("— អ្នកតឹងតែងទាំងអស់ប្រើOpenAI/AsyncOpenAIជាមួយចំណុចបញ្ចូល v1។ - គ្មានការប្រកួតផ្គូផ្គងសម្រាប់
rg "models\.github\.ai|models\.inference\.ai\.azure"— គន្លងកូដ GitHub Models បានដកចេញ។ - គ្មានការប្រកួតផ្គូផ្គងសម្រាប់
rg "OpenAIChatCompletionClient"— កូដ MAF 1.0.0+ ប្រើOpenAIChatClient(ដែលប្រើ Responses API)។ ក្នុងមុន-1.0.0, ធ្វើការដំឡើងទៅagent-framework-openai>=1.0.0។ - ការហៅ
ChatOpenAI(...)ទាំងអស់រួមបញ្ចូលuse_responses_api=True។ - គ្មានការប្រកួតផ្គូផ្គងសម្រាប់
rg "choices\[0\]"— ការចូលប្រើលទ្ធផលទាំងអស់ប្រើresp.output_textឬទ្រង់ទ្រាយ output Responses។ - មិនមាន
response_formatលើកំពូល; លទ្ធផលមានរចនាសម្ព័ន្ធទាំងអស់ប្រើtext={"format": {...}}។ - មាន
openai>=1.108.1និងazure-identityក្នុងrequirements.txtឬpyproject.toml; តម្រូវការត្រូវបានដំឡើងឡើងវិញ។ - ចុះបញ្ជី
store=Falseលើការហៅresponses.createទាំងអស់។ - មិនមាន
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/— mocks គោលលក្ខណៈ filter របស់ Azure បានដកចេញ។ - mock fixture ប្រើ
kwargs.get("input")មិនមែនkwargs.get("messages")។ - Snapshot / golden files បានបន្ទាន់សម័យទៅទ្រង់ទ្រាយ streaming Responses (គ្មាន
choices[0],function_call,logprobsទេ)។ pytestការបញ្ចប់ជោគជ័យ ដោយគ្មានបរាជ័យក្រោយការកែប្រែទាំងអស់។
ច្រករបៀបអនុវត្ត (ត្រួតពិនិត្យដោយដៃ ឬតាម test harness)
- ការបញ្ចប់មូលដ្ឋាន៖
responses.createមិនស្ទ្រីម ត្រូវត្រឡប់output_textមិនទទេ។ - ភាពស្ទ្រីមស្មើភាព៖ ប្រសិនបើកូដដើមប្រើការស្ទ្រីម កូដដែលបានផ្លាស់ប្តូរនឹងស្ទ្រីម និងបញ្ចេញព្រឹត្តិការណ៍
response.output_text.deltaជាមួយ delta មិនទទេ។ - លទ្ធផលមានរចនាសម្ព័ន្ធ៖ ប្រសិនបើប្រើ
text.formatជាមួយjson_schema,json.loads(resp.output_text)ត្រូវជោគជ័យ និងមានផ្ទឹងទៅនឹង schema។ - វដ្តហៅឧបករណ៍៖ ប្រសិនបើប្រើឧបករណ៍ ម៉ូដែលហៅឧបករណ៍ កម្មវិធីអនុវត្ត ពេលបន្ទាប់សំណើត្រឡប់
output_textចុងក្រោយ (គ្មានវដ្តអតិផរណា)។ - ភាពស្មើភាព Async៖ ប្រសិនបើប្រើ
AsyncAzureOpenAIវិធីសាស្រ្តស្មើគ្នាAsyncOpenAIនឹងដំណើរការជាមួយawait។ - អត្រាកំហុស៖ មិនមានកំហុស 400/401/404 ថ្មីប្រៀបធៀបទៅមុនពេលផ្លាស់ប្តូរ។
ទំនុកចរន្ត
- សេចក្ដីសង្ខេបរួមមានឯកសារដែលបានកែប្រែ ចំនួនកន្លែងហៅប្រពៃណីមុន/បន្ទាប់ និងជំហានបន្ទាប់។
- ប្រែប្រួលគឺជាការកែសម្រួលក្នុងផ្ទះបាយ (working-tree edits) មិនមែនជាការបញ្ជូន commit ទេ។
តម្រូវការដំណើរការកំណែ SDK
| កញ្ចប់ | កំណែអប្បបរមា |
openai | >=1.108.1 |
azure-identity | ថ្មីបំផុត (សម្រាប់អត្តសញ្ញាណ EntraID) |
ឯកសារយោង
- តារាងជំនួយ — ជួរខ្សែខ្លីកូដទាំងអស់
- ការផ្លាស់ប្តូរទំហំតេស្ត — mocks, snapshots, assertions
- ដោះស្រាយបញ្ហា — កំហុស, តារាងហានិភ័យ, បញ្ហា
- detect_legacy.py — កម្មវិធីស្កេនស្វ័យប្រវត្តិ
- Azure OpenAI Starter Kit
- ឯកសារ API Azure OpenAI Responses
- ជីវិត API Azure OpenAI សិល្បៈ
- ឯកសារយោង API Responses OpenAI
<!-- CO-OP TRANSLATOR DISCLAIMER START -->ការបដិសេធ: ឯកសារនេះត្រូវបានបម្លែងភាសា ដោយប្រើសេវាបម្លែងភាសា AI 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.

