Polhem.Chat.Blazor 0.6.0

dotnet add package Polhem.Chat.Blazor --version 0.6.0
                    
NuGet\Install-Package Polhem.Chat.Blazor -Version 0.6.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Polhem.Chat.Blazor" Version="0.6.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Polhem.Chat.Blazor" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="Polhem.Chat.Blazor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Polhem.Chat.Blazor --version 0.6.0
                    
#r "nuget: Polhem.Chat.Blazor, 0.6.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Polhem.Chat.Blazor@0.6.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Polhem.Chat.Blazor&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=Polhem.Chat.Blazor&version=0.6.0
                    
Install as a Cake Tool

Polhem.Chat.Blazor

An AI chat component for Blazor on top of any Microsoft.Extensions.AI IChatClient: replies stream in as Markdown, one line shows what the model is doing, and the user can attach files, approve tool calls, regenerate and edit. It runs in Interactive Server and WebAssembly, needs no component library, and follows the page's light or dark colors.

One turn in the ChatGallery.Blazor sample: the model calls a weather tool, streams a Markdown reply and shows the time and tokens it used

Getting started

Link the Markdown stylesheet in the page's <head>:

<link rel="stylesheet" href="_content/Polhem.Markdown.Blazor/polhem-markdown.css" />

Then give a ChatView a runner for your client, in an interactive component. The view fills its container's height:

@using Polhem.Chat
@using Polhem.Chat.Blazor
@inject Microsoft.Extensions.AI.IChatClient ChatClient

<div style="height: 600px">
    <ChatView Runner="runner" />
</div>

@code {
    private ChatRunner runner = null!;

    protected override void OnInitialized() => runner = new ChatRunner(ChatClient);
}

Never put a model API key in a WebAssembly app: anyone can read it from the downloaded files. Keep the model client on the server.

Learn more

  • Guide: Server or WebAssembly, running your own loop, attachments, images in replies, theme variables, slots and templates, languages.
  • ChatGallery.Blazor sample: the same component on the server and in the browser, with scripted replies that need no key.
  • Changelog. The package is at 0.x: a minor version may still change the API.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 0 11/30/2026
0.5.0 47 11/29/2026
0.4.0 55 11/28/2026
0.3.0 61 11/27/2026