Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 19, 2025

This PR implements a modernized version of Lesson 03 using .NET 10's dotnet run file.cs capability with comprehensive single-file C# demos that cover all core generative AI techniques. Additionally, it provides cross-platform fallback scripts for users without .NET 10.

What's Added

New Lesson Structure

  • 03.0-CoreGenerativeAITechniques-Overview/ - Comprehensive overview with reorganized learning paths
  • 03.1-CoreGenerativeAITechniques-runapp/ - Complete set of single-file demos with minimal boilerplate

Eleven Complete Single-File AI Demos

Core AI Techniques:

  1. 01-llm-completion.cs - Basic text completions with sentiment analysis
  2. 02-chat-flow.cs - Interactive chat with conversation memory and streaming
  3. 03-functions-and-plugins.cs - AI function calling with custom tools
  4. 04-retrieval-augmented-generation.cs - Simplified RAG with keyword-based search
  5. 05-structured-output.cs - JSON response parsing with multiple real-world examples
  6. 06-multimodal.cs - Vision AI for image analysis from URLs and local files

Provider-Specific Demos:
7. 07-ollama-local-models.cs - Local AI processing with Ollama (privacy-focused)
8. 08-azure-image-generation.cs - DALL-E image generation with Azure OpenAI
9. 09-semantic-kernel-chat.cs - Interactive chat using Semantic Kernel framework
10. 10-azure-functions.cs - Function calling with Azure OpenAI (enterprise patterns)
11. 11-advanced-rag-vectors.cs - Vector-based semantic search with embeddings

Cross-Platform Execution Scripts

For .NET 10 Users (Recommended):

dotnet run 01-llm-completion.cs
dotnet run 06-multimodal.cs

For Users Without .NET 10:

# Linux/macOS
./run-demo.sh 01-llm-completion.cs

# Windows PowerShell
.\run-demo.ps1 01-llm-completion.cs

The fallback scripts create temporary .NET projects with all necessary dependencies, providing the same experience as .NET 10's direct file execution.

Key Features

🎯 Comprehensive Coverage

  • All major AI techniques from the original Lesson 03
  • Multiple provider examples (GitHub Models, Azure OpenAI, Ollama)
  • Real-world scenarios with proper error handling
  • Progressive learning from basic to advanced concepts

🚀 Modern .NET Patterns

  • Top-level statements for minimal boilerplate
  • Microsoft.Extensions.AI and Semantic Kernel integration
  • Provider flexibility for different deployment scenarios
  • Enterprise-ready authentication patterns

📚 Multiple Learning Paths

  • Quick Start (1-2 hours) - Essential techniques
  • Comprehensive (3-4 hours) - Full understanding
  • Multimodal Focus (2-3 hours) - Image and vision AI
  • Privacy & Local (2 hours) - Local processing with Ollama
  • Enterprise & Cloud (2-3 hours) - Azure OpenAI integration

🔄 Cross-Platform Compatibility

  • Direct .NET 10 execution for modern environments
  • Fallback scripts for earlier .NET versions
  • Works on Windows, Linux, and macOS
  • Comprehensive documentation for both approaches

This modernization makes Core Generative AI techniques accessible through simplified single-file examples while maintaining educational depth and ensuring compatibility across different .NET versions and platforms.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] perform the tasks in the file [prompts/Modernizing-Lesson-03-with-DotNetRunApp.md] Add modernized Lesson 03.1 with single-file .NET AI demos and reorganized learning structure Aug 19, 2025
@Copilot Copilot AI requested a review from elbruno August 19, 2025 21:19
Copilot finished work on behalf of elbruno August 19, 2025 21:19
@elbruno elbruno requested a review from PabloNunes August 19, 2025 21:23
@elbruno
Copy link
Collaborator

elbruno commented Aug 19, 2025

@copilot do not implement that script to emulate .NET 10 script. Let's assume that .NET 10 is a prerequisite and will be installed on the dev machine. Also, review all the projects in the original Lesson 03 [https://github.com/microsoft/Generative-AI-for-beginners-dotnet/tree/main/03-CoreGenerativeAITechniques/src], and create the single cs file version so they can be run and added to the current lesson.

update the generated markdown to cover the topics so the users who gets to the repo can learn about it

…covering all original Lesson 03 scenarios

Co-authored-by: elbruno <[email protected]>
Copy link
Contributor Author

Copilot AI commented Aug 19, 2025

@copilot do not implement that script to emulate .NET 10 script. Let's assume that .NET 10 is a prerequisite and will be installed on the dev machine. Also, review all the projects in the original Les...

I've implemented your requested changes in commit 3fd6b29:

Removed the run-demo.sh script - Now assumes .NET 10 is installed and uses direct dotnet run file.cs execution

Added 5 new comprehensive single-file demos covering scenarios from the original Lesson 03:

  • 07-ollama-local-models.cs - Local AI with privacy focus
  • 08-azure-image-generation.cs - DALL-E image generation
  • 09-semantic-kernel-chat.cs - Interactive chat with SK framework
  • 10-azure-functions.cs - Azure OpenAI function calling
  • 11-advanced-rag-vectors.cs - Vector-based semantic search

Updated documentation to cover all learning topics with multiple learning paths (Quick Start, Comprehensive, Multimodal Focus, Privacy/Local, Enterprise/Cloud)

The lesson now includes 11 total demos covering the full scope of the original Lesson 03 projects but in simplified single-file format, ready for .NET 10's direct execution capability.

@Copilot Copilot AI changed the title Add modernized Lesson 03.1 with single-file .NET AI demos and reorganized learning structure Add comprehensive Lesson 03.1 with 11 single-file .NET 10 AI demos covering all core techniques Aug 19, 2025
Copilot finished work on behalf of elbruno August 19, 2025 21:50
Copy link
Collaborator

@elbruno elbruno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot bring back the run-demo script, and also generate a version for windows in PowerShell

update the documentation to explain that if .NET 10 if not present, this is an option to run the single file demo C# apps

Copy link
Contributor Author

Copilot AI commented Aug 20, 2025

@copilot bring back the run-demo script, and also generate a version for windows in PowerShell

update the documentation to explain that if .NET 10 if not present, this is an option to run the single ...

I've added the run-demo scripts as requested in commit 157dd26:

Restored run-demo.sh - Bash script for Linux/macOS users
Created run-demo.ps1 - PowerShell script for Windows users
Updated documentation - Added fallback execution options section

Both scripts simulate .NET 10's dotnet run file.cs functionality by creating temporary projects with the necessary NuGet packages. Users can now choose between:

  • Option 1: Direct execution with .NET 10: dotnet run 01-llm-completion.cs
  • Option 2: Fallback scripts: ./run-demo.sh 01-llm-completion.cs or .\run-demo.ps1 01-llm-completion.cs

The documentation clearly explains these as alternatives for users without .NET 10.

@Copilot Copilot AI changed the title Add comprehensive Lesson 03.1 with 11 single-file .NET 10 AI demos covering all core techniques Add comprehensive Lesson 03.1 with 11 single-file .NET AI demos and cross-platform execution scripts Aug 20, 2025
@Copilot Copilot AI requested a review from elbruno August 20, 2025 17:10
Copilot finished work on behalf of elbruno August 20, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants