|
3 | 3 |
|
4 | 4 | ## Project Purpose & Structure |
5 | 5 | - This repo is a hands-on .NET course for Generative AI, focused on real-world, runnable code and live coding. |
6 | | -- Lessons are organized in numbered folders (e.g., `01-IntroToGenAI/`, `03-CoreGenerativeAITechniques/`), each with a `readme.md` and code in the root sample folder. |
7 | | -- Key technologies: .NET 9+, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework, Azure OpenAI, Ollama (local models). |
| 6 | +- Lessons are organized in numbered folders (`01-IntroductionToGenerativeAI/` through `05-ResponsibleAI/`), each with a `readme.md` for documentation. |
| 7 | +- All code samples live in the centralized `samples/` directory, organized by category: `CoreSamples/`, `MAF/`, `AppsWithGenAI/`, `PracticalSamples/`. |
| 8 | +- Key technologies: .NET 10+, Microsoft.Extensions.AI (MEAI), Microsoft Agent Framework, Azure OpenAI, Ollama (local models). |
8 | 9 | - Multi-language support: see `translations/` for localized docs. |
9 | 10 |
|
10 | 11 | ## Architecture & Patterns |
11 | | -- Each lesson is self-contained; (e.g., `05-AppCreatedWithGenAI/SpaceAINet/`) demonstrate full-stack AI integration. |
12 | | -- Samples are created inside the sample folder for organization. |
| 12 | +- Each lesson folder contains documentation; code samples are in `samples/` (e.g., `samples/AppsWithGenAI/SpaceAINet/` demonstrates full-stack AI integration). |
| 13 | +- Samples are organized under `samples/` by category: `CoreSamples/`, `MAF/`, `AppsWithGenAI/`, `PracticalSamples/`. |
13 | 14 | - AI model calls are always abstracted behind service classes (e.g., `SpaceAINet.GameActionProcessor`), enabling easy provider swapping and testability. |
14 | 15 | - API keys and endpoints are never hardcoded—use user secrets or environment variables (see lesson READMEs for details). |
15 | 16 | - For SpaceAINet and similar apps: |
|
23 | 24 | - Ensure all code builds with `dotnet build` and passes tests with `dotnet test` |
24 | 25 | - Verify formatting with `dotnet format --verify-no-changes` if linting is enabled |
25 | 26 | - **Build & Run:** |
26 | | - - Use standard .NET CLI: `dotnet build`, `dotnet run` from the relevant project folder (e.g., `cd 05-AppCreatedWithGenAI/SpaceAINet/SpaceAINet.Console`). |
| 27 | + - Use standard .NET CLI: `dotnet build`, `dotnet run` from the relevant project folder (e.g., `cd samples/AppsWithGenAI/SpaceAINet/SpaceAINet.Console`). |
27 | 28 | - For local AI: ensure Ollama is running and the required model is pulled (e.g., `ollama pull phi4-mini`). |
28 | 29 | - For Azure: set secrets via `dotnet user-secrets` or Codespaces secrets. |
29 | 30 | - **Switching AI Providers:** |
30 | 31 | - Most samples support toggling between local (Ollama) and cloud (Azure OpenAI) models at runtime (see app key bindings and README tables). |
31 | 32 | - **Codespaces:** |
32 | 33 | - Dev containers are pre-configured for .NET, Azure, and Ollama workflows. Choose the right container for your use case. |
33 | 34 | - **Testing:** |
34 | | - - Run sample apps in the lesson `src/` folders to verify model integration and workflow. |
| 35 | + - Run sample apps in the `samples/` directory to verify model integration and workflow. |
35 | 36 |
|
36 | 37 | ## Code Standards & Best Practices |
37 | 38 | - Follow C# and .NET best practices (naming conventions, async/await patterns, nullable reference types) |
|
49 | 50 | - AI integration is always via service abstraction (never direct model calls in UI or game logic). |
50 | 51 | - Use key bindings in sample apps to toggle AI modes, save screenshots, and display FPS (see app README for details). |
51 | 52 | - For translations, update the corresponding `translations/<lang>/README.md`. |
52 | | -- Maintain existing code structure and organization—place new samples in the correct lesson folder |
| 53 | +- Maintain existing code structure and organization—place new samples in the correct `samples/` subfolder |
53 | 54 |
|
54 | 55 | ## Integration Points & External Dependencies |
55 | 56 | - **Azure OpenAI:** Requires endpoint, model name, and API key (see `01-IntroductionToGenerativeAI/setup-azure-openai.md`). |
|
58 | 59 |
|
59 | 60 | ## Key Files & Directories |
60 | 61 | - `README.md` (root): Course overview, lesson map, and links to translations. |
61 | | -- `01-IntroToGenAI/`, `02-SetupDevEnvironment/`, ...: Lesson folders with guides and code. |
62 | | -- `05-AppCreatedWithGenAI/SpaceAINet/`: Example of a full AI-powered .NET app (see `README.md` inside for architecture and usage). |
63 | | -- `samples/`: Contains all sample applications. |
| 62 | +- `01-IntroductionToGenerativeAI/` through `05-ResponsibleAI/`: Lesson folders with documentation and guides. |
| 63 | +- `samples/CoreSamples/`: Core technique samples (chat, vision, RAG, functions, etc.). |
| 64 | +- `samples/MAF/`: Microsoft Agent Framework samples (25+ projects). |
| 65 | +- `samples/AppsWithGenAI/SpaceAINet/`: AI-powered Space Battle game (see `README.md` inside for architecture). |
| 66 | +- `samples/AppsWithGenAI/HFMCP.GenImage/`: Image generation Aspire app. |
| 67 | +- `samples/PracticalSamples/`: Aspire MCP sample. |
64 | 68 | - `translations/`: Localized documentation. |
65 | 69 | - `CONTRIBUTING.MD`: Contribution and PR guidelines. |
66 | 70 |
|
|
71 | 75 | - `dotnet user-secrets set "AZURE_OPENAI_MODEL" "<your-model-name>"` |
72 | 76 | - `dotnet user-secrets set "AZURE_OPENAI_APIKEY" "<your-api-key>"` |
73 | 77 | 3. Build & run: |
74 | | - - `cd 05-AppCreatedWithGenAI/SpaceAINet/SpaceAINet.Console` |
| 78 | + - `cd samples/AppsWithGenAI/SpaceAINet/SpaceAINet.Console` |
75 | 79 | - `dotnet build && dotnet run` |
76 | 80 | 4. Use key bindings to toggle AI modes, save screenshots, and display FPS during gameplay. |
77 | 81 |
|
|
0 commit comments