ThinkBase.Blazor.Chat
1.0.10
dotnet add package ThinkBase.Blazor.Chat --version 1.0.10
NuGet\Install-Package ThinkBase.Blazor.Chat -Version 1.0.10
<PackageReference Include="ThinkBase.Blazor.Chat" Version="1.0.10" />
<PackageVersion Include="ThinkBase.Blazor.Chat" Version="1.0.10" />
<PackageReference Include="ThinkBase.Blazor.Chat" />
paket add ThinkBase.Blazor.Chat --version 1.0.10
#r "nuget: ThinkBase.Blazor.Chat, 1.0.10"
#:package ThinkBase.Blazor.Chat@1.0.10
#addin nuget:?package=ThinkBase.Blazor.Chat&version=1.0.10
#tool nuget:?package=ThinkBase.Blazor.Chat&version=1.0.10
ThinkBase Blazor Chat
This is a blazor component that implements a chat conversation, consuming an IChatClient as defined in Microsoft.Extensions.ai. It is based on the Chat code in this example. This component can display responses that are plain text, Markdown and Adaptive Cards.
There is also a debug facility that can record a series of responses and replay them.
Usage
The component uses Blazor FluentUI.
You will need to follow the instructions here to add the FluentUI styles and scripts to your project: FluentUI Blazor.
You will need to follow the instructions here to support dialogs to add support for dialogs.
Debug Mode
The component has a debug mode that can be enabled by setting the DebugMode
property to true. In this mode, you can record a series of responses and replay them later. This is useful for testing and debugging your chat interactions.
In order to use it you can implement an interface of the following form:
public interface IDebugHistoryStore
{
Task SaveHistory(List<ChatMessage> history, string name);
Task<List<string>> GetAllHistoryNames();
void ClearHistory();
Task<List<ChatMessage>> GetNamedHistory(string name);
Task<List<ChatMessage>> GetCurrentHistory();
Task SetCurrentHistory(List<ChatMessage>? history);
}
An example implementation is provided in the DebugHistoryStore
class. You can use this class to save and retrieve chat history from browser local storage.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net9.0
- Blazored.LocalStorage (>= 4.5.0)
- Markdig (>= 0.41.1)
- Microsoft.AspNetCore.Components.Web (>= 9.0.5)
- Microsoft.Extensions.AI (>= 9.5.0)
- Microsoft.FluentUI.AspNetCore.Components (>= 4.11.9)
- Microsoft.FluentUI.AspNetCore.Components.Icons (>= 4.11.9)
- SimpleAdaptiveCardsBlazor (>= 1.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.