Skip to content

ca0abinary/dotnet-guild-20250116-semantic-kernel

Repository files navigation

Semantic Kernel Demo

January 16, 2024 .net Guild Meeting

Based on Microsoft Learn Documentation

Open in GitHub Codespaces

Note: Codespaces does not support GPU models, so notebooks and code will run slowly or not at all.

Prerequisites

Optional prerequisites (not needed if using the dev container)

Using the Dev Container

  • If you have the recommended Dev Containers extension installed then it is possible to use a dev container for the best experience
  • You will still need to install and start Ollama

Notebooks

  • 01_GettingStarted.ipynb
    • A gentle start using Ollama to host a local LLM instance and a small amount of .net code to perform a simple request response to the LLM.
    • We start by installing the NuGet packages, downloading the appropriate models, and finish by learning the answer to life, the universe, and everything.
  • 02_ChatHistory.ipynb
    • Learn about the ChatHistory class and how the LLM understands the back and forth nature of your interactions.
  • 03_FunctionCalling.ipynb
    • Learn how to have the model automatically call custom functions!
    • ⚠ Currently this functionality is only available in the C# project due to issues with Polyglot Notebooks.
  • 04_VectorSearch.ipynb
    • We will dig into the fundamentals of creating a vector store
    • See how information can be retrieved using natural language limited to a very exact data set
  • 05_FormattedOutput.ipynb
    • Use the language model to generate Json formatted data
    • We will create a simple fantasy novel character generator with a consistent data schema

Code examples

All code is stored in the semantic-kernel-tutorial folder. Changing Program.cs will enable running of different examples. Many of these parallel the notebook examples but often extend or expand on the more simplified examples presented in the notebook.

Notable differences:

  • FunctionCalling is greatly expanded from the notebook example
  • RetrievalAugmentedGeneration is exclusive to the code examples. It demonstrates a hybrid search approach using a vector database to query a set of markdown documents then using those results to guide a large language model response.

Ways to improve your life

  • Ask for an LLM to break down tasks for you
  • Use it to start an email
  • Get detailed explanations on things you don't fully understand
  • Ask for it to write some code
  • Have it evaluate your statements that might be inflammatory
    • Have it fix those statements
  • Summarize "walls of text"
  • Create ideas
  • Have it review your ideas (it the ones it came up with)
  • Create better proposals

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published