generative-ai-for-beginners / zh-MO
AGENTS.md121k starsChanged 5 months agoMITView on GitHub
這個儲存庫包含一個全面的 21 課程綱要,教授生成式 AI 的基礎知識及應用開發。課程設計適合初學者,涵蓋從基本概念到建立可投入生產的應用程式。 關鍵技術: - Python 3.9+ 與函式庫:openai、python-dotenv、tiktoken、azure-ai-inference、pandas、numpy、matplotlib - TypeScript/JavaScript 搭配 Node.js 及函式庫:openai(透過 v1 端點及 Responses API 使用 Azure OpenAI)、@azure-rest/ai-inference(微軟 Foundry 模型) - Azure OpenAI 服務、OpenAI API 與微軟 Foundry 模型(GitHub Models 將於 2026 年 7 月底退休) - 用於互動學習的 Jupyter 筆記本 - 用於一致性開發環境的 Dev Containers 儲存庫結構: - 21 個編號課程目錄(00-21),包含 README、代碼範例及作業 - 多種實作:Python、TypeScript,有時也包含 .NET 範例 - 翻譯目錄包含 40 多種語言版本 - 透過 .env 檔案集中管理設定(使用 .env.copy 作為範本) 本儲存庫包含 .devcontainer 設定檔,可用於 GitHub Codespaces 或 VS Code Dev Containers: 所有需存取 API 的課程皆使用 .env 中定義的環境變數:
- Reads credentials
- Installs packages
Trending
More talk lately.about the whole repository
Who's talking about microsoft/generative-ai-for-beginners
- @ponceto91.bsky.social“Bonjour et bon vendredi ! Si vous cherchez des ressources pour vous mettre à l'IA générative, voici …”Bluesky · Mar 8, 2024 · 8 likes
- @github-trending.bsky.social“📦 microsoft / generative-ai-for-beginners ⭐ 71,760 (+94) 🗒 Jupyter Notebook 21 Lessons, Get Started …”Bluesky · Mar 3, 2025 · 5 likes
- @github-trending.bsky.social“🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 76,474 (+159) 🗒 Jupyter …”Bluesky · Mar 30, 2025 · 4 likes
- A Hacker News story“Generative AI for Beginners – Version 2”Hacker News · Feb 23, 2024 · 4 points
- @github-trending.bsky.social“🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 12,932 (+820) 🗒 Jupyter …”Bluesky · Nov 22, 2023 · 4 likes
The biggest 5 of 94 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 94
Talked about on Bluesky, GitHub and Hacker News (94 times).
On Bluesky · 44
- Mar 8, 2024Bonjour et bon vendredi ! Si vous cherchez des ressources pour vous mettre à l'IA générative, voici generative AI for beginners, des cours… — @ponceto91.bsky.social8 likes and reposts
- Mar 3, 2025📦 microsoft / generative-ai-for-beginners ⭐ 71,760 (+94) 🗒 Jupyter Notebook 21 Lessons, Get Started Building with Generative AI 🔗… — @github-trending.bsky.social5 likes and reposts
- Mar 30, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 76,474 (+159) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social4 likes and reposts
- Nov 22, 2023🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 12,932 (+820) 🗒 Jupyter Notebook 12 Lessons, Get Started… — @github-trending.bsky.social4 likes and reposts · 1 reply
- Aug 11, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 94,469 (+151) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social3 likes and reposts
39 more on Bluesky
- Jul 28, 2025今日のGitHubトレンド microsoft/generative-ai-for-beginners このリポジトリは、生成AIの初心者向けに、アプリケーション構築に必要な知識を21のレッスン形式で提供することを目的としています。… — @dailygithubtrends.bsky.social3 likes and reposts
- May 31, 2025📦 microsoft / generative-ai-for-beginners ⭐ 84,213 (+73) 🗒 Jupyter Notebook 21 Lessons, Get Started Building with Generative AI 🔗… — @github-trending.bsky.social3 likes and reposts
- May 7, 2025Generative AI for Beginners: 21 Lessons teaching everything you need to know to start building Generative AI applications (free) -… — @buckwoodymsft.bsky.social3 likes and reposts
- Apr 26, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 79,971 (+278) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social3 likes and reposts
- Mar 7, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 73,493 (+771) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social3 likes and reposts · 1 reply
- Oct 17, 2025📦 microsoft / generative-ai-for-beginners ⭐ 100,437 (+98) 🗒 Jupyter Notebook 21 Lessons, Get Started Building with Generative AI — @github-trending.bsky.social2 likes and reposts
- Jul 28, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 93,154 (+190) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social2 likes and reposts
- Jan 23, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 66,777 (+251) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social2 likes and reposts
- Aug 21, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 60,739 (+399) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social2 likes and reposts · 1 reply
- Feb 28, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 24,384 (+177) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social2 likes and reposts · 1 reply
- Aug 1, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 113,904 (+104) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost
- Dec 9, 2025📦 microsoft / generative-ai-for-beginners ⭐ 102,867 (+98) 🗒 Jupyter Notebook 21 Lessons, Get Started Building with Generative AI — @github-trending.bsky.social1 likes and repost
- Sep 8, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 97,052 (+115) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost
- Jun 29, 2025今日のGitHubトレンド microsoft/generative-ai-for-beginners このリポジトリは、生成AIの初心者向けに、アプリケーション構築を始めるために必要な知識を21のレッスン形式で提供することを目的としています。… — @dailygithubtrends.bsky.social1 likes and repost
- Jun 26, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 85,784 (+187) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost
- May 8, 2025Found this on the inter-tubes and wanted to share with others who might want to give it a go.... github.com/microsoft... #Learn the… — @mattulm.bsky.social1 likes and repost
- Apr 30, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 81,531 (+429) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost
- Apr 29, 2025今日のGitHubトレンド microsoft/generative-ai-for-beginners このリポジトリは、生成AIを初めて学ぶ人向けの学習コンテンツを提供することを目的としています。… — @dailygithubtrends.bsky.social1 likes and repost
- Apr 22, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 78,763 (+103) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost
- Mar 24, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 75,691 (+119) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost
- Mar 24, 2025今日のGitHubトレンド microsoft/generative-ai-for-beginners このリポジトリは、生成AIアプリケーションの構築を始めるために必要な知識を、21のレッスンを通して初学者に教えることを目的としています。 — @dailygithubtrends.bsky.social1 likes and repost
- Mar 6, 2025今日のGitHubトレンド microsoft/generative-ai-for-beginners このリポジトリは、生成AIアプリケーションの構築を始めるために必要な知識を21のレッスンで提供することを目的としています。 初心者向けに、生成AIの基礎を学ぶための教材です。 — @dailygithubtrends.bsky.social1 likes and repost
- Oct 8, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 62,862 (+161) 🗒 Jupyter Notebook 21 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost · 1 reply
- Jun 15, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 47,605 (+146) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost · 1 reply
- Jun 8, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 46,538 (+296) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost · 1 reply
- Mar 31, 2024(1/2) Generative AI for Beginners Course 🚀 The Generative AI for Beginners course by Microsoft provides an introduction to the foundations… — @ramikrispin.bsky.social1 likes and repost · 1 reply
- Jan 4, 2024📦 microsoft / generative-ai-for-beginners ⭐ 21,434 (+69) 🗒 Jupyter Notebook 12 Lessons, Get Started Building with Generative AI 🔗… — @github-trending.bsky.social1 likes and repost
- Nov 3, 2023🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 2,016 (+784) 🗒 Jupyter Notebook 12 Lessons, Get Started… — @github-trending.bsky.social1 likes and repost · 1 reply
- Oct 20, 2026Stage 2: Build with GenAI Generative AI for Beginners, Microsoft (21 lessons, 121k+ GitHub stars) github.com/microsoft/g... Why: prompts,… — @astrodevil1.bsky.social0 likes and reposts · 1 reply
- Jul 1, 20262️⃣ Google — AI Essentials grow.google/ai-essentials/ 3️⃣ DeepLearning.AI — AI for Everyone www.deeplearning.ai/courses/ai-... 4️⃣… — @hrswati.bsky.social0 likes and reposts · 1 reply
- Jul 3, 2024💎 Hidden Gem! 💎 (1000+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 53,862 (+2,390) 🗒 Jupyter Notebook 18 Lessons, Get… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Jun 4, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 44,794 (+114) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Apr 9, 2024Devs: Want to get hands-on with generative AI but not sure where to start? Check out this comprehensive self-guided course broken down into… — @ahrkrak.bsky.social0 likes and reposts · 1 reply
- Apr 5, 2024💎 Hidden Gem! 💎 (1000+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 39,340 (+1,755) 🗒 Jupyter Notebook 18 Lessons, Get… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Mar 31, 2024🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 32,661 (+614) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Mar 21, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 30,009 (+202) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Mar 8, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 27,683 (+258) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Mar 4, 2024🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 25,612 (+559) 🗒 Jupyter Notebook 18 Lessons, Get Started… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Nov 17, 2023🎉 Celebrating! 🎉 (500+ new stars) 📦 microsoft / generative-ai-for-beginners ⭐ 6,828 (+609) 🗒 Jupyter Notebook 12 Lessons, Get Started… — @github-trending.bsky.social0 likes and reposts · 1 reply
On GitHub · 43
- Nov 30, 2025image directory handling to create language-specific subdirectories — Azure/co-op-translator1 reaction · 2 comments
- Sep 30, 2025👋 Thanks for contributing @bullet-ant! We will review the pull request and get back to you soon. — Mamalimashayekh/gravity182-swap.coffee-update-cross-dex1 reaction
- Sep 30, 2025Markdown emphasis not handled correctly (en→jp) — Azure/co-op-translator1 reaction · 2 comments
- Sep 26, 2025[Markdown] Bold markers not preserved when wrapping links — Azure/co-op-translator1 reaction · 4 comments
- Sep 25, 2025Broken link (en→ja) — Azure/co-op-translator1 reaction · 2 comments
38 more on GitHub
- Sep 24, 2025HTML `<img>` tag src is not updated during translation — Azure/co-op-translator1 reaction · 4 comments
- Sep 17, 2025Untranslated "Note, that there are~" (en→ja) — Azure/co-op-translator1 reaction · 2 comments
- Sep 16, 2025"[Solution]" in the link is not translated (en→ja) — Azure/co-op-translator1 reaction · 1 comment
- Sep 6, 2025Underscore-based italic formatting is not handled correctly (en→ja) — Azure/co-op-translator1 reaction · 2 comments
- Sep 5, 2025"[generative AI]" in the link is not translated (en→ja) — Azure/co-op-translator1 reaction
- May 1, 2025👋 Thanks for contributing @jabari-max! We will review the issue and get back to you soon. — trustwallet/trust-web3-provider1 reaction
- Feb 12, 2025Hallucinations or Fabrications — microsoft/Generative-AI-for-beginners-dotnet1 reaction · 2 comments
- Nov 28, 2026G Shrikaar Sunder (261105B306034) — R40-T007: prompt-template escaping — worked example with checks [05-advanced-prompts] — S-AI-Final-Projects-SMRU/generative-ai-for-beginners0 reactions
- Nov 26, 2026Ashwin Kalra (2601010453) — R40-T035: tensor-shape contract — offline service adapter [09-building-image-applications] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions
- Nov 26, 2026Pratishtha Kaushik (2601010267) — R40-T038: ranked search with stable ties — boundary-case lesson extension [08-building-search-applications] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions
- Nov 26, 2026Pratishtha Kaushik (2601010267) — R40-T036: trainable-parameter accounting — refactor the teaching example [18-fine-tuning] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions
- Nov 26, 2026Kanishk Khamesra (2601010173) — R40-T045: chat-view state — failure and recovery example [07-building-chat-applications] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions
- Nov 26, 2026Kanishk Khamesra (2601010173) — R40-T041: ranked search with stable ties — runnable concept example [08-building-search-applications] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions
- Nov 26, 2026Gouri Varshney (2601010138) — R40-T047: trainable-parameter accounting — worked example with checks [18-fine-tuning] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions
- Nov 26, 2026Chalasani Surya (2601010098) — R40-T055: retrieval with source attribution — offline service adapter [20-mistral] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions · 1 comment
- Nov 26, 2026Chalasani Surya (2601010098) — R40-T054: chat-view state — invariant and state trace [11-integrating-with-function-calling] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions · 1 comment
- Nov 26, 2026Chalasani Surya (2601010098) — R40-T053: token-budget preflight — compare two approaches [19-slm] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions · 1 comment
- Nov 26, 2026Chalasani Surya (2601010098) — R40-T052: chat-view state — boundary-case lesson extension [11-integrating-with-function-calling] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions · 1 comment
- Nov 26, 2026Chalasani Surya (2601010098) — R40-T051: model-manifest selection — runnable concept example [21-meta] — s-and-ai-ru-2/generative-ai-for-beginners0 reactions · 1 comment
- Nov 5, 2026Add the bundle genai-apps: building applications with generative AI — KaProblem/ptf-library0 reactions
- Oct 12, 2026Angular 23 in June 2027 [ modern angular] — sanjeetkumaritoutlook/angular22-nestjs-monorepo0 reactions
- Jul 2, 2026Update repo table — arran4/arran40 reactions
- Jul 1, 2026Update repo table — arran4/arran40 reactions
- Jun 27, 2026Update repo table — arran4/arran40 reactions
- Jun 25, 2026Update repo table — arran4/arran40 reactions
- Jun 25, 2026Update repo table — arran4/arran40 reactions
- Jun 24, 2026Update repo table — arran4/arran40 reactions
- Jun 23, 2026Update repo table — arran4/arran40 reactions
- Jun 22, 2026Update repo table — arran4/arran40 reactions
- Jun 21, 2026Update repo table — arran4/arran40 reactions
- Jun 5, 2026Update repo table — arran4/arran40 reactions
- May 21, 2026Update repo table — arran4/arran40 reactions
- May 19, 2026feat: narrative Correlation Summary in reader_mode — jmservera/SquadScope0 reactions
- Apr 29, 2026Update repo table — arran4/arran40 reactions
- Mar 11, 2026Curso building with Gen AI — MarioCodes/dotnet-ai-experiments0 reactions · 3 comments
- Mar 11, 2026Curso Gen AI 4 Beginners — MarioCodes/dotnet-ai-experiments0 reactions
- Jul 27, 2025Lecture: Resources — Artificial-Intelligence-HSBI-TDU/KI-Vorlesung0 reactions
- May 30, 2025https://github.com/microsoft/generative-ai-for-beginners/ — SreeCharan1234/Alzheimer-MRI-Classification0 reactions
On Hacker News · 7
- Feb 23, 2024Generative AI for Beginners – Version 24 points
- Jul 4, 2024Generative-AI-for-Beginners: 18 Lessons, Get Started Building with Generative AI2 points
- Jun 27, 2024Generative AI for Beginners – Full Video Series2 points
- Mar 5, 2024Generative AI for Beginners – 18 Lessons2 points
- Nov 7, 2023Lessons on everything you need to know to start building Gen AI apps2 points
2 more on Hacker News
- Oct 31, 2023Generative AI for Beginners via Microsoft AI Services2 points · 1 comment
- Mar 7, 2025Generative-AI-for-beginners: 21 Lessons1 point
In this repository56 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-TW/AGENTS.mdAGENTS.md
- azure-openai-to-responsesSkill
The file
Files
AGENTS.md
專案概覽
這個儲存庫包含一個全面的 21 課程綱要,教授生成式 AI 的基礎知識及應用開發。課程設計適合初學者,涵蓋從基本概念到建立可投入生產的應用程式。
關鍵技術:
- Python 3.9+ 與函式庫:
openai、python-dotenv、tiktoken、azure-ai-inference、pandas、numpy、matplotlib - TypeScript/JavaScript 搭配 Node.js 及函式庫:
openai(透過 v1 端點及 Responses API 使用 Azure OpenAI)、@azure-rest/ai-inference(微軟 Foundry 模型) - Azure OpenAI 服務、OpenAI API 與微軟 Foundry 模型(GitHub Models 將於 2026 年 7 月底退休)
- 用於互動學習的 Jupyter 筆記本
- 用於一致性開發環境的 Dev Containers
儲存庫結構:
- 21 個編號課程目錄(00-21),包含 README、代碼範例及作業
- 多種實作:Python、TypeScript,有時也包含 .NET 範例
- 翻譯目錄包含 40 多種語言版本
- 透過
.env檔案集中管理設定(使用.env.copy作為範本)
設定指令
初始儲存庫設定
# 複製倉庫
git clone https://github.com/microsoft/generative-ai-for-beginners.git
cd generative-ai-for-beginners
# 複製環境範本
cp .env.copy .env
# 編輯 .env,輸入你的 API 金鑰及端點Python 環境設定
# 建立虛擬環境
python3 -m venv venv
# 啟動虛擬環境
# 在 macOS/Linux:
source venv/bin/activate
# 在 Windows:
venv\Scripts\activate
# 安裝依賴項
pip install -r requirements.txtNode.js/TypeScript 設定
# 安裝根目錄層級的依賴項(用於文件工具)
npm install
# 對於個別課程的 TypeScript 範例,請導航至特定課程:
cd 06-text-generation-apps/typescript/recipe-app
npm installDev Container 設定(建議)
本儲存庫包含 .devcontainer 設定檔,可用於 GitHub Codespaces 或 VS Code Dev Containers:
- 在 GitHub Codespaces 或安裝了 Dev Containers 擴充功能的 VS Code 中開啟儲存庫
- Dev Container 會自動:
- 安裝
requirements.txt中的 Python 相依套件 - 執行建立後腳本(
.devcontainer/post-create.sh) - 設定 Jupyter 核心
- 安裝
開發工作流程
環境變數
所有需存取 API 的課程皆使用 .env 中定義的環境變數:
OPENAI_API_KEY- 用於 OpenAI APIAZURE_OPENAI_API_KEY- 用於微軟 Foundry 的 Azure OpenAI(Azure OpenAI 服務現屬於微軟 Foundry:https://ai.azure.com)AZURE_OPENAI_ENDPOINT- Azure OpenAI 端點 URL(Foundry 資源端點)AZURE_OPENAI_DEPLOYMENT- 聊天完成模型部署名稱(課程預設:gpt-5-mini)AZURE_OPENAI_EMBEDDINGS_DEPLOYMENT- 嵌入模型部署名稱(課程預設:text-embedding-3-small)AZURE_OPENAI_API_VERSION- API 版本(預設:2024-10-21)HUGGING_FACE_API_KEY- 用於 Hugging Face 模型AZURE_INFERENCE_ENDPOINT- 微軟 Foundry 模型端點(多供應商模型目錄)AZURE_INFERENCE_CREDENTIAL- 微軟 Foundry 模型 API 金鑰(取代即將退休的GITHUB_TOKEN)AZURE_INFERENCE_CHAT_MODEL- 用於temperature範例的非推理模型(例如Llama-3.3-70B-Instruct),因推理模型不支援抽樣控制
模型規範(重要)
- 預設聊天模型為
gpt-5-mini<strong>— 一款目前非棄用的</strong>推理 模型。2026 年起,較舊且支持 temperature 的 “mini” 模型(gpt-4o-mini、gpt-4.1-mini)將逐步淘汰,因此課程統一採用 GPT-5 系列。 - 推理模型不接受
temperature與top_p,取而代之使用max_output_tokens(Responses API)/max_completion_tokens(聊天完成)替代max_tokens。請<strong>勿</strong>對呼叫gpt-5-mini的範例加入temperature/top_p/max_tokens。 - 為展示
temperature,範例使用 Llama 模型(Llama-3.3-70B-Instruct),透過微軟 Foundry 模型的端點(AZURE_INFERENCE_CHAT_MODEL)呼叫。採用提示工程與推理控管方法引導推理模型,而非抽樣參數。 - 微調(第 18 課)維持使用
gpt-4.1-mini:GPT-5 目前僅支援強化學習微調(RFT),不支援此處的監督式微調(SFT)。 - 第 20(Mistral)及第 21(Meta)課仍使用
temperature/max_tokens,因目標模型為支援該參數的 Mistral/Llama。
執行 Python 範例
# 導航到課程目錄
cd 06-text-generation-apps/python
# 執行一個 Python 腳本
python aoai-app.py執行 TypeScript 範例
# 導覽至 TypeScript 應用程式目錄
cd 06-text-generation-apps/typescript/recipe-app
# 編譯 TypeScript 程式碼
npm run build
# 執行應用程式
npm start執行 Jupyter 筆記本
# 由儲存庫根目錄啟動 Jupyter
jupyter notebook
# 或使用帶有 Jupyter 擴充功能的 VS Code處理不同類型的課程
- 「學習」課程:著重於 README.md 說明文件與概念
- 「建置」課程:包含 Python 與 TypeScript 的可運作代碼範例
- 每個課程均有 README.md,包括理論、代碼導覽及影片連結
程式碼風格準則
Python
- 使用
python-dotenv管理環境變數 - 匯入
openai函式庫進行 API 互動 - 使用
pylint進行程式碼檢查(部分範例為簡潔性加上# pylint: disable=all) - 遵循 PEP 8 命名慣例
- API 憑證存於
.env檔案,切勿硬編碼於程式中
TypeScript
- 使用
dotenv套件管理環境變數 - 各應用的 TypeScript 設定於
tsconfig.json - 使用
openai套件以呼叫 Azure OpenAI(指向/openai/v1/端點並呼叫client.responses.create);使用@azure-rest/ai-inference以調用微軟 Foundry 模型 - 使用
nodemon進行開發,具自動重載功能 - 執行前先編譯:
npm run build,接著啟動:npm start
一般慣例
- 保持範例代碼簡單,聚焦教學
- 加入註解解釋關鍵概念
- 每個單元的程式碼皆應獨立完整且可執行
- 命名保持一致:Azure OpenAI 使用
aoai-為前綴,OpenAI API 使用oai-,微軟 Foundry 模型使用githubmodels-(沿用 GitHub Models 時代的舊前綴)
文件準則
Markdown 風格
- 所有網址需以
[文字](../../網址)格式包裹,且不得有多餘空格 - 相對連結必須以
./或../開頭 - 所有指向 Microsoft 領域的連結必須包括追蹤 ID:
?WT.mc_id=academic-105485-koreyst - 避免網址中出現特定國家語系(避免
/en-us/) - 圖片儲存在
./images資料夾,檔名需具描述性 - 檔名使用英文字母、數字與連字號
翻譯支援
- 儲存庫透過自動化 GitHub Actions 支援 40 多種語言
- 翻譯內容存於
translations/目錄 - 不接受部分翻譯提交
- 不接受機器翻譯
- 翻譯後的圖片存於
translated_images/目錄
測試與驗證
提交前檢查
此儲存庫利用 GitHub Actions 進行驗證。提交 PR 前:
- 檢查 Markdown 連結:
# validate-markdown.yml 工作流程檢查: # - 損壞的相對路徑 # - 路徑中缺失的追蹤 ID # - URL 中缺失的追蹤 ID # - 含有國家地區代碼的 URL # - 損壞的外部 URL <strong>手動測試</strong>:- 測試 Python 範例:啟動 venv 並執行腳本
- 測試 TypeScript 範例:執行
npm install、npm run build、npm start - 確認環境變數設定正確
- 測試 API 金鑰能於範例中正常使用
<strong>程式碼範例</strong>:- 確保所有代碼皆能無錯執行
- 具支援時,同時測試 Azure OpenAI 與 OpenAI API
- 確認與支持的 Microsoft Foundry 模型範例能正常運作
無自動化測試
這是一個教育性質的儲存庫,專注於教程與範例。無單元測試或整合測試執行。驗證主要依靠:
- 手動測試程式碼範例
- GitHub Actions 進行 Markdown 驗證
- 社區對教育內容的審查
Pull Request 指南
提交前
- 於有關 Python 與 TypeScript 的修改均進行測試
- 執行 Markdown 驗證(PR 自動觸發)
- 確保所有微軟網址包含追蹤 ID
- 檢查相對連結有效性
- 確認圖片引用正確
PR 標題格式
- 使用具描述性的標題:
[Lesson 06] 修正 Python 範例錯字或更新第 08 課 README - 適用時參考議題號碼:
Fixes #123
PR 說明
- 說明變更內容與原因
- 連結相關議題
- 就程式碼變更指定已測試的範例
- 翻譯 PR 請附上完整檔案以完成翻譯
貢獻需求
- 需簽署微軟 CLA(首次 PR 自動完成)
- 在進行修改前,先將儲存庫分支到個人帳戶
- 每次 PR 聚焦於一項邏輯變更(避免混合不相關修改)
- 儘量保持 PR 精簡集中
常見工作流程
新增程式碼範例
- 前往相應課程目錄
- 在
python/或typescript/子目錄中建立範例 - 遵循命名規則:
{provider}-{example-name}.{py|ts|js} - 使用真實 API 憑證測試
- 在課程 README 文件中記錄新增的環境變數
更新文件
- 編輯課程目錄內的 README.md
- 遵循 Markdown 指南(追蹤 ID、相對連結)
- 翻譯由 GitHub Actions 自動處理(勿手動編輯)
- 測試所有連結有效
使用 Dev Containers
- 儲存庫含
.devcontainer/devcontainer.json - 建立後腳本自動安裝 Python 依賴
- 預先設定 Python 與 Jupyter 擴充功能
- 環境基於
mcr.microsoft.com/devcontainers/universal:2.11.2
部署與發佈
本儲存庫為學習用,無部署流程。課程使用方式包含:
- GitHub 儲存庫:直接存取程式碼與文件
- GitHub Codespaces:即時開發環境與預設定置
- Microsoft Learn:內容可能經由官方學習平台發佈
- docsify:利用 Markdown 編譯成文件網站(參見
docsifytopdf.js與package.json)
編譯文件網站
# 從文件生成 PDF(如有需要)
npm run convert疑難排解
常見問題
Python 匯入錯誤:
- 確認已啟用虛擬環境
- 執行
pip install -r requirements.txt - 檢查 Python 版本是否為 3.9 以上
TypeScript 編譯錯誤:
- 在特定應用目錄執行
npm install - 確認 Node.js 版本相容
- 若需要,刪除
node_modules並重新安裝
API 認證錯誤:
- 確認
.env檔案存在且數值正確 - 檢查 API 金鑰有效且未過期
- 確認端點 URL 符合您所在區域
<strong>缺少環境變數</strong>:
- 將
.env.copy複製為.env - 填寫您工作課程需要的所有值
- 更新
.env後重新啟動應用程式
額外資源
- 課程設定指南
- 貢獻指南
- 行為準則
- 安全政策
- Azure AI Discord
- 進階代碼範例彙整
專案特定說明
- 本儲存庫為
<strong>教育性質</strong>,專注學習,不是生產代碼 - 範例特意保持簡單,聚焦在教學概念
- 代碼品質與教學清晰度保持平衡
- 各課程獨立完整,可獨立完成
- 儲存庫支援多種 API 供應商:Azure OpenAI、OpenAI、微軟 Foundry 模型,以及離線供應商如 Foundry Local 和 Ollama
- 內容多語言支持,自動化翻譯工作流
- 活躍社區於 Discord,提供問題與支援
<!-- 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.

