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
<PackageReference Include="Polhem.Chat.Blazor" Version="0.6.0" />
<PackageVersion Include="Polhem.Chat.Blazor" Version="0.6.0" />
<PackageReference Include="Polhem.Chat.Blazor" />
paket add Polhem.Chat.Blazor --version 0.6.0
#r "nuget: Polhem.Chat.Blazor, 0.6.0"
#:package Polhem.Chat.Blazor@0.6.0
#addin nuget:?package=Polhem.Chat.Blazor&version=0.6.0
#tool nuget:?package=Polhem.Chat.Blazor&version=0.6.0
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.

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 | Versions 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. |
-
net10.0
- Microsoft.AspNetCore.Components.Web (>= 10.0.1)
- Polhem.Chat (>= 0.6.0)
- Polhem.Markdown.Blazor (>= 0.6.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.