Skip to content

Latest commit

 

History

History
73 lines (45 loc) · 2.84 KB

File metadata and controls

73 lines (45 loc) · 2.84 KB

Lesson 2: Generative AI Techniques for .NET Developers

In this lesson you'll learn practical skills for building AI-enabled .NET applications. Concepts include text completions, chat conversations, streaming responses, structured output, function calling, and building middleware pipelines.


What You'll Learn

  • Text completions and chat conversations
  • Managing conversation history with chat roles
  • Streaming responses for real-time output
  • Getting structured output from AI models
  • Function calling to extend AI with your code
  • Building middleware pipelines with caching and telemetry

Lesson Structure

This lesson is divided into four parts:

The fundamentals of AI interaction—single prompts, conversations, and managing chat history.

Real-time responses and strongly-typed data from AI models.

Extend AI capabilities by letting models call your .NET functions.

Production-ready patterns with caching, telemetry, and custom behaviors.


Sample Code Organization

All code samples for this lesson are located in the samples/CoreSamples/ directory. This includes:

  • Chat & Completions: BasicChat-01MEAI, BasicChat-02SK, BasicChat-03Ollama, etc.
  • Conversation History: BasicChat-10ConversationHistory
  • Function Calling: MEAIFunctions, MEAIFunctionsAzureOpenAI, MEAIFunctionsOllama

Each lesson document links directly to the relevant samples in this centralized location.


Let's Begin

Start with the fundamentals:

Continue to Part 1: Text Completions and Chat Conversations →


Next Steps

Once you complete all parts of this lesson, you'll be ready to tackle more advanced patterns in Lesson 3:

  • Retrieval-Augmented Generation (RAG): Ground AI responses in your own documents
  • Semantic Search: Search by meaning, not just keywords
  • Vision and Audio: Work with images and sound

Continue to Lesson 3: AI Patterns and Applications →


Additional Resources