![]() |
VOOZH | about |
dotnet add package ThinkBase.Blazor.Chat --version 1.0.20
NuGet\Install-Package ThinkBase.Blazor.Chat -Version 1.0.20
<PackageReference Include="ThinkBase.Blazor.Chat" Version="1.0.20" />
<PackageVersion Include="ThinkBase.Blazor.Chat" Version="1.0.20" />Directory.Packages.props
<PackageReference Include="ThinkBase.Blazor.Chat" />Project file
paket add ThinkBase.Blazor.Chat --version 1.0.20
#r "nuget: ThinkBase.Blazor.Chat, 1.0.20"
#:package ThinkBase.Blazor.Chat@1.0.20
#addin nuget:?package=ThinkBase.Blazor.Chat&version=1.0.20Install as a Cake Addin
#tool nuget:?package=ThinkBase.Blazor.Chat&version=1.0.20Install as a Cake Tool
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.
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.
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.
| Parameter | Type | Description |
|---|---|---|
InitialText |
string |
The Initial text shown before processing starts. Default: 'Hello'. |
DebugMode |
bool |
If true, enables debug mode for recording and replaying chat history. Default: false. |
Index |
string |
Enables the user to pass on an index for RAG Processing. An AdditionalOption record with the name 'Index' and the value given is created for downstream processing in the ChatClient. |
UserId |
string |
Enables the user to pass on a user id for permissions and access handling. An AdditionalOption record with the name 'UserId' and the value given is created for downstream processing in the ChatClient. |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.