January 16, 2024 .net Guild Meeting
Based on Microsoft Learn Documentation
Note: Codespaces does not support GPU models, so notebooks and code will run slowly or not at all.
Optional prerequisites (not needed if 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
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
ChatHistoryclass and how the LLM understands the back and forth nature of your interactions.
- Learn about the
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
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:
FunctionCallingis greatly expanded from the notebook exampleRetrievalAugmentedGenerationis 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.
- 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