
Generative AI & .NET
Episode Twenty Five
Intro
I'm Peter and this is the RoguePlanetoid Podcast where you will find insights about Microsoft or related platforms and technology, along with so much more whether you are beginner or an experienced professional or just interested in technology. Keep Current, Keep Coding!
Welcome
Welcome to episode twenty-five of the RoguePlanetoid Podcast on Generative AI & .NET. Generative AI & .NET can be combined by developers to create intelligent applications that dynamically generate content or automate tasks. By combining Generative AI & .NET developers can create sophisticated applications that integrate AI models into their web services, cloud solutions, mobile or desktop applications and more. These applications can feature enhanced user experiences that improve productivity, produce real-time responses, generate content or perform sophisticated data analysis.
Generative AI
Generative AI reduces time and effort by employing AI models that can be used to propose new ideas, automate content creation or efficiently format information. Generative AI models are trained on extensive datasets that can encompass text, images or other types of content. These models can learn patterns and structures within their training data to understand the underlying context of the data, then can create new content by utilising those learned patterns and context. Output from these models can be finetuned if needed by adjusting prompts to produce more precise or relevant results.
Generative AI includes ChatGPT which is an AI-powered language model created by OpenAI that can understand natural language to answer in-depth questions by providing detailed and accurate responses for a wide range of topics. ChatGPT can generate creative content such as images and text including stories, essays and other creative works tailored to specific themes or audiences. ChatGPT can also provide helpful suggestions, brainstorm ideas, troubleshoot problems or assist with insights and recommendations.
Generative AI can be expanded with Microsoft Copilot which seamlessly integrates with productivity tools such as Word, Excel, PowerPoint and Outlook to enhance user productivity and streamline tasks. Microsoft Copilot can assist with a variety of tasks within Windows, and Copilot + PCs enable even more AI functionality such as local AI processing along with upcoming features such as Recall, which allows users to search activity history on their PC to retrace their steps including finding past documents, images and web pages.
.NET
.NET is the comprehensive software development framework and ecosystem from Microsoft that is designed for building, deploying and running applications for multiple platforms, this includes desktop with Windows, macOS or Linux, mobile with iOS or Android and services for web or cloud applications. .NET has a wide variety of libraries that can be used by developers to leverage a broad range of useful functionality within their applications.
.NET developers can choose from programming languages created by Microsoft such as C# which is a modern versatile programming language with an object-oriented approach to create scalable high-performance and maintainable code. C# can be used for applications from web and mobile to desktop and gaming and is a popular choice of programming language for beginners or experienced developers.
.NET developers can also choose F# which is a functional-first programming language which emphasises principles such as immutability and first-class functions. F# enables flexibility for developers with support for object-oriented or imperative programming and is well suited for a wide range of applications including data science and financial modelling. You can find out more about .NET by visiting dot.net or check out the link in the show notes.
Microsoft.Extensions.AI
Microsoft.Extensions.AI.Abstractions and Microsoft.Extensions.AI provide the .NET ecosystem with essential abstractions for integrating AI services into .NET applications and libraries along with middleware. AI capabilities are evolving but common patterns for functionality are emerging such as chat, embeddings and tool calling and unified abstractions help developers to work effectively across different sources and middleware can add additional valuable functionality.
Microsoft.Extensions.AI.Abstractions provides an IChatClient interface that allows developers to consume locally, or remotely hosted language models and any .NET library can provide an AI client implementing this interface, this allows for seamless integration with any consuming code regardless of the implementation. Microsoft.Extensions.AI.Abstractions also enables delivery of a consistent set of APIs and conventions for integrating AI services into .NET applications, this means applications are not tied to a specific provider and developers can experiment with different packages, while still maintaining a single API throughout an application, this also simplifies adding new capabilities as well as facilitating the componentisation and testing of applications.
Microsoft.Extensions.AI are a set of core .NET libraries that provide a unified layer of abstractions to interact with AI services, such as Small Language Models or SLMs, and Large Language Models or LLMs along with embeddings and middleware. Microsoft.Extensions.AI implementations include OpenAI which also supports OpenAI-compatible endpoints, Azure OpenAI and Ollama for Llama including support for chat, chat with conversation history, chat streaming, telemetry, caching and tool calling along with embeddings for text embedding generation.
Microsoft.Extensions.AI is part of the foundation for AI application development in .NET that empowers developers, such as those who write libraries that provide clients for AI services to implement the abstractions in their libraries. Developers who consume AI services can use the abstractions instead of coding to a specific AI service within their application, this can even enable consumers of applications the flexibility to choose their preferred service. Developers using the abstractions allows them to not only simplify integration of AI services within their applications but also facilitate testing and mocking and developers can even use difference services in different parts of their application such hybrid scenarios with local and hosted models. You can find Microsoft.Extensions.AI abstractions and implementations on NuGet or check out the links in the show notes.
Conclusion
Generative AI is now a part of everyday life with tools such as ChatGPT and Microsoft Copilot providing functionality at your fingertips that just a few years ago would have seemed impossible, with much of that functionality being able to be leveraged by developers in their own applications. .NET developers can not only leverage the full power of the existing .NET ecosystem and libraries but can also integrate AI functionality quickly and easily into .NET applications regardless of the service provider thanks to Microsoft.Extensions.AI, which provides implementations for many models including those used by ChatGPT and leveraged with Microsoft Copilot as well as allowing for multiple models to be easily used together which can also include models locally.
Generative AI can also aid with ChatGPT and Microsoft Copilot directly to help with the creation of elements of an application. Generative AI can be used to design Adaptive Cards used by Windows Widgets to get the look-and-feel needed without needing to have detailed knowledge of how to do this. This is something I covered in my Designing Windows Widgets using Generative AI talk for Microsoft Reactor. Generative AI can also be directly integrated into an application with Microsoft.Extensions.AI to provide functionality, I've used this to create dynamically generated Adaptive Cards for a Windows Widget based on a prompt or an API endpoint which I covered in my Developing Windows Widgets with Generative AI talk for Microsoft Reactor. You can find both those talks for Microsoft Reactor at youtube.com/@MicrosoftReactor or check out the link in the show notes.
Outro
Thanks for listening to the RoguePlanetoid Podcast where each episode you will find insights about Microsoft or related platforms and technology, along with so much more wherever you listen to your podcasts or at rogueplanetoid.com/podcasts for the RoguePlanetoid Podcast whether you are a beginner or an experienced professional or just interested in technology. Keep Current, Keep Coding!
- Website - rogueplanetoid.com/podcast
- X - x.com/rogueplanetoid
- YouTube - youtube.com/@rogueplanetoid
- dot.net
- nuget.org/packages/Microsoft.Extensions.AI
- nuget.org/packages/Microsoft.Extensions.AI.OpenAI
- nuget.org/packages/Microsoft.Extensions.AI.Ollama
- nuget.org/packages/Microsoft.Extensions.AI.AzureAIInference
- Microsoft Reactor - youtube.com/@MicrosoftReactor
- Designing Windows Widgets using Generative AI - youtube.com/watch?v=WD3uNhl6alM
- Developing Windows Widgets with Generative AI - youtube.com/watch?v=rizhpVVgv-w
RoguePlanetoid Podcast is a production of cluarantonn.com
Hosted, Written, Produced and Edited by Peter Bull
Music based on Like a Tiger by Jo Wandrini
Production Company Name by Granny Robertson