Menu

1 / 5

Polhem.Chat: AI Chat Components for Avalonia and Blazor

DEV Community: blazor·Jeff Tsai·6 days ago
#6hzRPKd6
#devtoblazor#devto#dev#chat#blazor
Long article (3403 words) — no AI summary yet.
Reading 0:00
15s threshold

Plug in any IChatClient, and desktop, mobile and web share the same conversation logic

This post is based on version 0.6.0. The packages are still 0.x, so a minor release may still change the API; any change will be noted in the CHANGELOG .

Polhem.Chat is a set of AI chat packages for .NET, with a ChatView for Avalonia and one for Blazor. On the model side it takes an IChatClient from Microsoft.Extensions.AI (the official .NET interface for model clients, implemented for OpenAI, Azure OpenAI, Ollama and others), so it is not tied to any model provider. The view shows:

Streamed replies rendered as Markdown

A live line that says what the model is doing: thinking, calling tools, the time spent and the tokens

A usage summary for each turn

Stop, copy, regenerate, and edit the last prompt

Approval cards for tool calls, and file attachments

The Polhem framework already uses AI chat in places, such as importing a form from documents in its definition editor, and more parts of the framework will get AI…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.