generative-ai-for-beginners / zh-CN
AGENTS.md121k starsChanged 5 months agoMITView on GitHub
本仓库包含一个全面的21课课程,教授生成式人工智能基础知识及应用开发。该课程为初学者设计,涵盖从基础概念到构建生产就绪应用的所有内容。 关键技术: - 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 笔记本 - 用于一致开发环境的开发容器 仓库结构: - 21个编号课程目录(00-21),包含 README、代码示例和作业 - 多种实现:Python、TypeScript,有时还包括.NET示例 - 翻译目录,包含40多种语言版本 - 通过 .env 文件集中配置(使用 .env.copy 作为模板) 仓库包含 .devcontainer 配置,可用于 GitHub Codespaces 或 VS Code 开发容器: 所有需要 API 访问的课程都使用在 .env 中定义的环境变量:
- Reads credentials
- Installs packages
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
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-HK/AGENTS.mdAGENTS.md
- translations/zh-MO/AGENTS.mdAGENTS.md
- translations/zh-TW/AGENTS.mdAGENTS.md
- azure-openai-to-responsesSkill
The file
Files
AGENTS.md
项目概览
本仓库包含一个全面的21课课程,教授生成式人工智能基础知识及应用开发。该课程为初学者设计,涵盖从基础概念到构建生产就绪应用的所有内容。
关键技术:
- 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 笔记本
- 用于一致开发环境的开发容器
仓库结构:
- 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
# 使用你的API密钥和端点编辑.envPython 环境设置
# 创建虚拟环境
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 install开发容器设置(推荐)
仓库包含 .devcontainer 配置,可用于 GitHub Codespaces 或 VS Code 开发容器:
- 在 GitHub Codespaces 或安装了开发容器扩展的 VS Code 中打开仓库
- 开发容器将自动:
- 从
requirements.txt安装 Python 依赖 - 运行创建后脚本(
.devcontainer/post-create.sh) - 设置 Jupyter 内核
- 从
开发工作流程
环境变量
所有需要 API 访问的课程都使用在 .env 中定义的环境变量:
OPENAI_API_KEY- OpenAI API 密钥AZURE_OPENAI_API_KEY- Microsoft Foundry 中 Azure OpenAI 的密钥(Azure OpenAI 服务现为 Microsoft 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- Microsoft Foundry 模型端点(多提供者模型目录)AZURE_INFERENCE_CREDENTIAL- Microsoft Foundry 模型 API 密钥(替代即将退役的GITHUB_TOKEN)AZURE_INFERENCE_CHAT_MODEL- 一个非推理模型(例如Llama-3.3-70B-Instruct),用于temperature示例,因为推理模型不支持采样控制
模型约定(重要)
- 默认聊天模型为
gpt-5-mini<strong>- 当前非弃用的</strong>推理 模型。自2026年起,旧的支持 temperature 的“迷你”模型(gpt-4o-mini、gpt-4.1-mini)将<em>弃用</em>,课程统一采用 GPT-5 家族。 - 推理模型拒绝
temperature和top_p,使用max_output_tokens(Responses API) /max_completion_tokens(聊天补全)替代max_tokens。调用gpt-5-mini的示例中切勿添加temperature/top_p/max_tokens。 - 为演示
temperature,示例使用 Microsoft Foundry 模型端点的 Llama 模型(Llama-3.3-70B-Instruct,通过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包管理环境变量 - 每个应用在
tsconfig.json中配置 TypeScript - 使用
openai包调用 Azure OpenAI(客户端指向/openai/v1/端点并调用client.responses.create);使用@azure-rest/ai-inference调用微软 Foundry 模型 - 使用
nodemon进行开发,支持自动重载 - 运行前先构建:
npm run build然后npm start
通用约定
- 保持示例代码简单且具教育性
- 添加注释解释关键概念
- 每节课的代码应相互独立且可直接运行
- 命名风格统一:
aoai-前缀表示 Azure OpenAI,oai-表示 OpenAI API,githubmodels-表示微软 Foundry 模型(保留 GitHub Models 时代的遗留前缀)
文档指南
Markdown 风格
- 所有 URL 必须使用
[文本](../../链接)格式,不得有额外空格 - 相对链接必须以
./或../开头 - 所有指向 Microsoft 域名的链接必须包含跟踪 ID:
?WT.mc_id=academic-105485-koreyst - 不使用针对特定国家的 URL 语言路径(避免
/en-us/) - 图片存于
./images文件夹,文件名具描述性 - 文件名使用英文字母、数字和短横线
翻译支持
- 仓库通过自动化 GitHub Actions 支持40多种语言
- 翻译文件位于
translations/目录 - 不接受部分翻译提交
- 不接受机器翻译
- 翻译后的图片存放于
translated_images/目录
测试与验证
提交前检查
本仓库使用 GitHub Actions 进行验证。提交 PR 前:
- 检查 Markdown 链接:
# validate-markdown.yml 工作流检查: # - 断开的相对路径 # - 路径上缺失的跟踪ID # - URL上缺失的跟踪ID # - 带有国家/地区语言代码的URL # - 断开的外部URL - 人工测试:
- 测试 Python 示例:激活虚拟环境并运行脚本
- 测试 TypeScript 示例:
npm install,npm run build,npm start - 检查环境变量是否正确配置
- 确认 API 密钥对代码示例有效
- 代码示例:
- 确保所有代码无错误运行
- 涉及时同时测试 Azure OpenAI 和 OpenAI API
- 验证受支持时的微软 Foundry 模型示例有效
无自动化测试
这是一个专注于教程和示例的教育仓库,无单元测试或集成测试。验证主要通过:
- 代码示例的人工测试
- GitHub Actions 的 Markdown 验证
- 教育内容的社区审核
拉取请求指南
提交前
- 在 Python 和 TypeScript 中测试代码更改(适用时)
- 运行 Markdown 验证(PR 提交自动触发)
- 确保所有 Microsoft URL 带有跟踪 ID
- 检查相对链接有效
- 确认图片引用正确
PR 标题格式
- 使用描述性标题:
[Lesson 06] 修正 Python 示例拼写错误或更新第08课 README - 相关时引用 Issue 号码:
Fixes #123
PR 描述
- 说明更改内容及原因
- 链接相关 Issue
- 对代码更改说明测试覆盖示例
- 语言翻译 PR 包含所有相关文件以完成翻译
贡献要求
- 签署 Microsoft CLA(第一次 PR 自动)
- 更改前先 Fork 仓库至个人账户
- 每个逻辑变更一个 PR(避免合并不相关修复)
- 尽量保持 PR 简洁聚焦
常用工作流程
添加新代码示例
- 进入相应的课程目录
- 在
python/或typescript/子目录创建示例 - 遵循命名规则:
{provider}-{example-name}.{py|ts|js} - 使用真实 API 凭证测试
- 在课程 README 中记录任何新增环境变量
更新文档
- 编辑课程目录下的 README.md
- 遵循 Markdown 指南(跟踪 ID、相对链接)
- 翻译由 GitHub Actions 处理(请勿手动编辑)
- 测试所有链接有效
使用开发容器
- 仓库包含
.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.

