Last week, Microsoft launched a new AI chat web application template, currently in the preview stage, aiming to simplify AI application development in .NET development. This template is another important Microsoft move to promote the popularity of AI technology, providing scaffolding and guidance for use in Visual Studio, Visual Studio Code, and .NET CLI.
According to Microsoft, this .NET AI chat template helps developers quickly build smart chat applications. The template is based on the Blazor framework, leveraging the Microsoft.Extensions.AI and Microsoft.Extensions.VectorData abstractions, following the search enhanced generation (RAG) pattern commonly used in chat applications.
Its main feature is the ability to create a chat interface that interacts with custom data such as sample PDF files or user data. Developers have the option to integrate on-premises or Azure, templates support on-premises vector storage for easy prototyping, and Azure AI search to support more advanced settings. The generated code contains UI components for chat interactions, reference tracking and subsequent suggestions, which developers can customize or delete according to their needs.
To start using this template, developers simply enter the following command on the command line to install it:
In addition, the template simplifies the data ingestion process, contains code that processes various data sources and formats, and provides sample PDF files and their processing code for developers to replace with their own files. The application will automatically compare folder contents and update the vector store accordingly. However, it should be noted that developers should be cautious when using AI model providers to avoid errors or delays caused by large data files.
Microsoft's product team emphasized that the code is built on Microsoft.Extensions.AI, making plug-in customization very simple. Developers can give chatbots permission to access any C# function, which can extend their functionality, get extra data or perform actions.
Going forward, Microsoft's development team plans to expand template options, with future updates that will include AI console templates, minimal API templates, and support for .NET Aspire. Additionally, these templates are planned to be included in the .NET SDK by default and explore support for Azure AI Foundry. At the same time, Microsoft also works with the semantic kernel team to expand template options for semantic kernel users.