RadzenAIChat Class

RadzenAIChat component that provides a modern chat interface with AI integration and conversation memory.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenAIChat

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenAIChat : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender

Examples

<RadzenAIChat Title="AI Assistant" Placeholder="Type your message..." @bind-Messages="@chatMessages" SessionId="@sessionId" />

Constructors

RadzenAIChatLink to this section

RadzenAIChat component that provides a modern chat interface with AI integration and conversation memory.

Declaration
public RadzenAIChat()

Properties

AcceptedAttachmentTypesLink to this section

Gets or sets the accepted attachment types as an accept attribute value, for example image/*,.txt,.csv,.pdf. Default is image/*.

Declaration
public string AcceptedAttachmentTypes { get; set; }
Property Value
Type Description
stringGets or sets the accepted attachment types as an accept attribute value, for example image/*,.txt,.csv,.pdf. Default is image/*.

AllowAttachmentsLink to this section

Gets or sets whether the user can attach files to messages. Images are sent to the model as image content and need a multimodal model; text files (txt, csv, md, json, xml and similar) are sent as text, PDF files as file content for providers that support it. Default is false.

Declaration
public bool AllowAttachments { get; set; }
Property Value
Type Description
boolGets or sets whether the user can attach files to messages. Images are sent to the model as image content and need a multimodal model; text files (txt, csv, md, json, xml and similar) are sent as text, PDF files as file content for providers that support it. Default is false.

AllowMultipleToolCallsLink to this section

Gets or sets whether the model may call several tools in one response. null (the default) leaves it to the provider. Set to false when using tools that require approval so that each call is approved on its own.

Declaration
public bool? AllowMultipleToolCalls { get; set; }
Property Value
Type Description
bool?Gets or sets whether the model may call several tools in one response. null (the default) leaves it to the provider. Set to false when using tools that require approval so that each call is approved on its own.

ApiKeyLink to this section

Gets or sets the API key, overriding ApiKey. Blazor Server only: the component throws when a key is set in a WebAssembly application, because it would be visible to every user. Keep the key on the server and use Proxy.

Declaration
public string ApiKey { get; set; }
Property Value
Type Description
stringGets or sets the API key, overriding ApiKey. Blazor Server only: the component throws when a key is set in a WebAssembly application, because it would be visible to every user. Keep the key on the server and use Proxy.

ApiKeyHeaderLink to this section

Gets or sets the header the API key is sent with, overriding ApiKeyHeader.

Declaration
public string ApiKeyHeader { get; set; }
Property Value
Type Description
stringGets or sets the header the API key is sent with, overriding ApiKeyHeader.

AssistantAvatarTextLink to this section

Gets or sets the text displayed in the assistant avatar.

Declaration
public string AssistantAvatarText { get; set; }
Property Value
Type Description
stringGets or sets the text displayed in the assistant avatar.

AttachmentAddingLink to this section

Event callback that is invoked with every file the user picks before it is attached. Set Cancel to reject it or replace Attachment, for example with a scaled down image. Files added from code with ChatAttachment) do not raise it.

Declaration
public EventCallback<ChatAttachmentAddingEventArgs> AttachmentAdding { get; set; }
Property Value
Type Description
EventCallback<ChatAttachmentAddingEventArgs>Event callback that is invoked with every file the user picks before it is attached. Set Cancel to reject it or replace Attachment, for example with a scaled down image. Files added from code with ChatAttachment) do not raise it.

ChatClearedLink to this section

Event callback that is invoked when the chat is cleared.

Declaration
public EventCallback ChatCleared { get; set; }
Property Value
Type Description
EventCallbackEvent callback that is invoked when the chat is cleared.

CitationTemplateLink to this section

Gets or sets the template used to render a source. The default renders a numbered link with the title and the snippet as tooltip.

Declaration
public RenderFragment<ChatCitation> CitationTemplate { get; set; }
Property Value
Type Description
RenderFragment<ChatCitation>Gets or sets the template used to render a source. The default renders a numbered link with the title and the snippet as tooltip.

DateSeparatorFormatLink to this section

Gets or sets the format used to render the date separator. Defaults to "D" (long date pattern).

Declaration
public string DateSeparatorFormat { get; set; }
Property Value
Type Description
stringGets or sets the format used to render the date separator. Defaults to "D" (long date pattern).

DateSeparatorTemplateLink to this section

Optional template to render the date separator shown between messages when the day changes. Receives the DateTime of the following message.

Declaration
public RenderFragment<DateTime> DateSeparatorTemplate { get; set; }
Property Value
Type Description
RenderFragment<DateTime>Optional template to render the date separator shown between messages when the day changes. Receives the DateTime of the following message.

DisabledLink to this section

Gets or sets whether the chat is disabled.

Declaration
public bool Disabled { get; set; }
Property Value
Type Description
boolGets or sets whether the chat is disabled.

EmptyMessageLink to this section

Gets or sets the message displayed when there are no messages.

Declaration
public string EmptyMessage { get; set; }
Property Value
Type Description
stringGets or sets the message displayed when there are no messages.

EmptyTemplateLink to this section

Gets or sets the empty template shown when there are no messages.

Declaration
public RenderFragment EmptyTemplate { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the empty template shown when there are no messages.

EndpointLink to this section

Gets or sets the endpoint URL of the AI provider, overriding Endpoint. In a WebAssembly application use Proxy instead, so the request goes through your server.

Declaration
public string Endpoint { get; set; }
Property Value
Type Description
stringGets or sets the endpoint URL of the AI provider, overriding Endpoint. In a WebAssembly application use Proxy instead, so the request goes through your server.

ErrorLink to this section

Event callback that is invoked when an attachment cannot be read, for example because it exceeds MaxAttachmentSize.

Declaration
public EventCallback<Exception> Error { get; set; }
Property Value
Type Description
EventCallback<Exception>Event callback that is invoked when an attachment cannot be read, for example because it exceeds MaxAttachmentSize.

HeaderTemplateLink to this section

Gets or sets the content rendered in the chat header between Title and the clear button, for example a conversation switcher. The header is rendered when a title, the clear button or this template is set.

Declaration
public RenderFragment HeaderTemplate { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the content rendered in the chat header between Title and the clear button, for example a conversation switcher. The header is rendered when a title, the clear button or this template is set.

InputLink to this section

Gets or sets the text of the input. Bind it with @bind-Input to read what the user has typed or to set the text from code, for example to offer a prompt.

Declaration
public string Input { get; set; }
Property Value
Type Description
stringGets or sets the text of the input. Bind it with @bind-Input to read what the user has typed or to set the text from code, for example to offer a prompt.

InputAttributesLink to this section

Specifies additional custom attributes that will be rendered by the input.

Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type Description
IReadOnlyDictionary<string, object>Specifies additional custom attributes that will be rendered by the input.

InputChangedLink to this section

Event callback that is invoked when the text of the input changes.

Declaration
public EventCallback<string> InputChanged { get; set; }
Property Value
Type Description
EventCallback<string>Event callback that is invoked when the text of the input changes.

InputFooterTemplateLink to this section

Gets or sets the content rendered in the input area below the text box, for example a model picker or action buttons.

Declaration
public RenderFragment InputFooterTemplate { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the content rendered in the input area below the text box, for example a model picker or action buttons.

InputHeaderTemplateLink to this section

Gets or sets the content rendered in the input area above the text box, below the pending attachments, for example a status line or a notice about the attachments.

Declaration
public RenderFragment InputHeaderTemplate { get; set; }
Property Value
Type Description
RenderFragmentGets or sets the content rendered in the input area above the text box, below the pending attachments, for example a status line or a notice about the attachments.

MaxAttachmentSizeLink to this section

Gets or sets the maximum size of an attachment in bytes. Default is 4 MB.

Declaration
public long MaxAttachmentSize { get; set; }
Property Value
Type Description
longGets or sets the maximum size of an attachment in bytes. Default is 4 MB.

MaxMessagesLink to this section

Gets or sets the maximum number of messages to keep in the chat.

Declaration
public int MaxMessages { get; set; }
Property Value
Type Description
intGets or sets the maximum number of messages to keep in the chat.

MaxTokensLink to this section

Gets or sets the max tokens.

Declaration
public int? MaxTokens { get; set; }
Property Value
Type Description
int?Gets or sets the max tokens.

MaxTotalAttachmentSizeLink to this section

Gets or sets the maximum total size in bytes of the attachments of a message. A file the user picks that would push the pending attachments over it is not attached and Error is raised. Checked after AttachmentAdding, on the attachment it leaves. Attachments added from code with ChatAttachment) are not checked. Default is null: no limit.

Declaration
public long? MaxTotalAttachmentSize { get; set; }
Property Value
Type Description
long?Gets or sets the maximum total size in bytes of the attachments of a message. A file the user picks that would push the pending attachments over it is not attached and Error is raised. Checked after AttachmentAdding, on the attachment it leaves. Attachments added from code with ChatAttachment) are not checked. Default is null: no limit.

MessageAddedLink to this section

Event callback that is invoked when a new message is added.

Declaration
public EventCallback<ChatMessage> MessageAdded { get; set; }
Property Value
Type Description
EventCallback<ChatMessage>Event callback that is invoked when a new message is added.

MessageFooterTemplateLink to this section

Gets or sets the template rendered at the end of every message, after its text and sources, for example the files an answer changed.

Declaration
public RenderFragment<ChatMessage> MessageFooterTemplate { get; set; }
Property Value
Type Description
RenderFragment<ChatMessage>Gets or sets the template rendered at the end of every message, after its text and sources, for example the files an answer changed.

MessageSentLink to this section

Event callback that is invoked when a message is sent.

Declaration
public EventCallback<string> MessageSent { get; set; }
Property Value
Type Description
EventCallback<string>Event callback that is invoked when a message is sent.

MessageTemplateLink to this section

Gets or sets the template that renders every message in place of the default rendering. Call ChatMessage) from it to keep the default rendering for some messages, for example to render only the entries the application adds with ChatMessage) your way, or to add content under a message.

Declaration
public RenderFragment<ChatMessage> MessageTemplate { get; set; }
Property Value
Type Description
RenderFragment<ChatMessage>Gets or sets the template that renders every message in place of the default rendering. Call ChatMessage) from it to keep the default rendering for some messages, for example to render only the entries the application adds with ChatMessage) your way, or to add content under a message.

ModelLink to this section

Gets or sets the model name.

Declaration
public string Model { get; set; }
Property Value
Type Description
stringGets or sets the model name.

PendingAttachmentsLink to this section

Gets the attachments that will be sent with the next message.

Declaration
public IReadOnlyList<ChatAttachment> PendingAttachments { get; }
Property Value
Type Description
IReadOnlyList<ChatAttachment>Gets the attachments that will be sent with the next message.

PlaceholderLink to this section

Gets or sets the placeholder text for the input field.

Declaration
public string Placeholder { get; set; }
Property Value
Type Description
stringGets or sets the placeholder text for the input field.

ProxyLink to this section

Gets or sets the URL of a server endpoint that forwards the requests to the AI provider and adds the API key, overriding Proxy.

Declaration
public string Proxy { get; set; }
Property Value
Type Description
stringGets or sets the URL of a server endpoint that forwards the requests to the AI provider and adds the API key, overriding Proxy.

QueueMessagesLink to this section

Gets or sets whether messages sent while a response is being generated are accepted instead of ignored. Default is false. Such a message appears in the conversation right away, marked as queued, and is offered to the service with CancellationToken) as a request whose MessageId is the Id of the displayed message. A service that takes it tells the chat when the model reads it by yielding a ChatResponseUpdate with User and that id: the message then moves to the end of the conversation, loses the queued mark and the rest of the response goes into a new assistant message under it. A service that does not take the message is sent it with the next request once the response completes; Stop drops the messages waiting for that and returns their text to the input, while messages a service took stay for the service to remove with ChatMessage). The send button stays next to the stop button while the response streams.

Declaration
public bool QueueMessages { get; set; }
Property Value
Type Description
boolGets or sets whether messages sent while a response is being generated are accepted instead of ignored. Default is false. Such a message appears in the conversation right away, marked as queued, and is offered to the service with CancellationToken) as a request whose MessageId is the Id of the displayed message. A service that takes it tells the chat when the model reads it by yielding a ChatResponseUpdate with User and that id: the message then moves to the end of the conversation, loses the queued mark and the rest of the response goes into a new assistant message under it. A service that does not take the message is sent it with the next request once the response completes; Stop drops the messages waiting for that and returns their text to the input, while messages a service took stay for the service to remove with ChatMessage). The send button stays next to the stop button while the response streams.

QueuedMessagesLink to this section

Gets the messages waiting to be sent once the current response completes. See QueueMessages.

Declaration
public IReadOnlyList<ChatMessage> QueuedMessages { get; }
Property Value
Type Description
IReadOnlyList<ChatMessage>Gets the messages waiting to be sent once the current response completes. See QueueMessages.

ReadOnlyLink to this section

Gets or sets whether the input is read-only.

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
boolGets or sets whether the input is read-only.

ResponseReceivedLink to this section

Event callback that is invoked when the AI response is received.

Declaration
public EventCallback<string> ResponseReceived { get; set; }
Property Value
Type Description
EventCallback<string>Event callback that is invoked when the AI response is received.

SendButtonIconLink to this section

Gets or sets the icon of the send button. Default is send.

Declaration
public string SendButtonIcon { get; set; }
Property Value
Type Description
stringGets or sets the icon of the send button. Default is send.

SendButtonTextLink to this section

Gets or sets the text of the send button. Default is null: the button shows only its icon.

Declaration
public string SendButtonText { get; set; }
Property Value
Type Description
stringGets or sets the text of the send button. Default is null: the button shows only its icon.

SessionIdLink to this section

Gets or sets the session ID for maintaining conversation memory. If null, a new session will be created.

Declaration
public string SessionId { get; set; }
Property Value
Type Description
stringGets or sets the session ID for maintaining conversation memory. If null, a new session will be created.

SessionIdChangedLink to this section

Event callback that is invoked when a session ID is created or retrieved.

Declaration
public EventCallback<string> SessionIdChanged { get; set; }
Property Value
Type Description
EventCallback<string>Event callback that is invoked when a session ID is created or retrieved.

ShowAvatarsLink to this section

Gets or sets whether the avatars of the user and the assistant are rendered next to the messages. Default is true.

Declaration
public bool ShowAvatars { get; set; }
Property Value
Type Description
boolGets or sets whether the avatars of the user and the assistant are rendered next to the messages. Default is true.

ShowCitationsLink to this section

Gets or sets whether the sources of an answer are rendered under it. Default is true. Sources are the CitationAnnotation annotations the provider attaches to the response and the ChatCitation instances tools return.

Declaration
public bool ShowCitations { get; set; }
Property Value
Type Description
boolGets or sets whether the sources of an answer are rendered under it. Default is true. Sources are the CitationAnnotation annotations the provider attaches to the response and the ChatCitation instances tools return.

ShowClearButtonLink to this section

Gets or sets whether to show the clear chat button.

Declaration
public bool ShowClearButton { get; set; }
Property Value
Type Description
boolGets or sets whether to show the clear chat button.

ShowDateSeparatorLink to this section

Gets or sets whether a date separator is rendered between messages when the day changes.

Declaration
public bool ShowDateSeparator { get; set; }
Property Value
Type Description
boolGets or sets whether a date separator is rendered between messages when the day changes.

ShowReasoningLink to this section

Gets or sets whether the reasoning of models that expose it is rendered as a collapsible block in assistant messages. Default is true.

Declaration
public bool ShowReasoning { get; set; }
Property Value
Type Description
boolGets or sets whether the reasoning of models that expose it is rendered as a collapsible block in assistant messages. Default is true.

ShowToolCallsLink to this section

Gets or sets whether tool calls are rendered in assistant messages. Default is true.

Declaration
public bool ShowToolCalls { get; set; }
Property Value
Type Description
boolGets or sets whether tool calls are rendered in assistant messages. Default is true.

ShowUsageLink to this section

Gets or sets whether the token usage reported by the model is shown next to the time of assistant messages. Default is false.

Declaration
public bool ShowUsage { get; set; }
Property Value
Type Description
boolGets or sets whether the token usage reported by the model is shown next to the time of assistant messages. Default is false.

StopButtonIconLink to this section

Gets or sets the icon of the stop button. Default is stop_circle.

Declaration
public string StopButtonIcon { get; set; }
Property Value
Type Description
stringGets or sets the icon of the stop button. Default is stop_circle.

StopButtonTextLink to this section

Gets or sets the text of the stop button shown while a response streams. Default is null: the button shows only its icon.

Declaration
public string StopButtonText { get; set; }
Property Value
Type Description
stringGets or sets the text of the stop button shown while a response streams. Default is null: the button shows only its icon.

SystemPromptLink to this section

Gets or sets the system prompt.

Declaration
public string SystemPrompt { get; set; }
Property Value
Type Description
stringGets or sets the system prompt.

TemperatureLink to this section

Gets or sets the temperature.

Declaration
public double? Temperature { get; set; }
Property Value
Type Description
double?Gets or sets the temperature.

TimestampFormatLink to this section

Gets or sets the format used to render the timestamp shown next to each message. Defaults to "HH:mm".

Declaration
public string TimestampFormat { get; set; }
Property Value
Type Description
stringGets or sets the format used to render the timestamp shown next to each message. Defaults to "HH:mm".

TitleLink to this section

Gets or sets the title displayed in the chat header.

Declaration
public string Title { get; set; }
Property Value
Type Description
stringGets or sets the title displayed in the chat header.

ToolCallCompletedLink to this section

Event callback that is invoked when a tool call completes, fails or is rejected.

Declaration
public EventCallback<ChatToolCall> ToolCallCompleted { get; set; }
Property Value
Type Description
EventCallback<ChatToolCall>Event callback that is invoked when a tool call completes, fails or is rejected.

ToolCallTemplateLink to this section

Gets or sets the template used to render a tool call. The template is responsible for rendering approval UI for calls in the AwaitingApproval state; call ChatToolCall) or ChatToolCall) to answer them.

Declaration
public RenderFragment<ChatToolCall> ToolCallTemplate { get; set; }
Property Value
Type Description
RenderFragment<ChatToolCall>Gets or sets the template used to render a tool call. The template is responsible for rendering approval UI for calls in the AwaitingApproval state; call ChatToolCall) or ChatToolCall) to answer them.

ToolsLink to this section

Gets or sets the tools the model can call. Create them with AIFunctionFactory; wrap a tool in ApprovalRequiredAIFunction to ask the user before it runs. Tools are invoked automatically and rendered in the assistant message; use ToolCallTemplate to customize how.

Declaration
public IEnumerable<Microsoft.Extensions.AI.AITool> Tools { get; set; }
Property Value
Type Description
IEnumerable<Microsoft.Extensions.AI.AITool>Gets or sets the tools the model can call. Create them with AIFunctionFactory; wrap a tool in ApprovalRequiredAIFunction to ask the user before it runs. Tools are invoked automatically and rendered in the assistant message; use ToolCallTemplate to customize how.

UsageTemplateLink to this section

Gets or sets the template rendered next to the time of an assistant message instead of the default token count, when ShowUsage is true and the message has Usage. Use it to show what AdditionalCounts carries, for example credits.

Declaration
public RenderFragment<ChatMessage> UsageTemplate { get; set; }
Property Value
Type Description
RenderFragment<ChatMessage>Gets or sets the template rendered next to the time of an assistant message instead of the default token count, when ShowUsage is true and the message has Usage. Use it to show what AdditionalCounts carries, for example credits.

UserAvatarTextLink to this section

Gets or sets the text displayed in the user avatar.

Declaration
public string UserAvatarText { get; set; }
Property Value
Type Description
stringGets or sets the text displayed in the user avatar.

UserIdLink to this section

Gets or sets the user the conversation belongs to. Stored in UserId so that IConversationStore implementations can list the conversations of a user.

Declaration
public string UserId { get; set; }
Property Value
Type Description
stringGets or sets the user the conversation belongs to. Stored in UserId so that IConversationStore implementations can list the conversations of a user.

Methods

AddAttachmentLink to this section

Adds an attachment to the next message as it is: AttachmentAdding, MaxAttachmentSize and MaxTotalAttachmentSize apply only to files the user picks.

Declaration
public void AddAttachment(ChatAttachment attachment)
Parameters
Type Name Description
ChatAttachment attachment The attachment.

AddMessageLink to this section

Adds a message to the chat.

Declaration
public ChatMessage AddMessage(string content, bool isUser)
Parameters
Type Name Description
string content The message content.
bool isUser Whether the message is from the user.
Returns
Type Description
ChatMessageThe created message.

AddMessageLink to this section

Adds a message to the chat.

Declaration
public ChatMessage AddMessage(ChatMessage message)
Parameters
Type Name Description
ChatMessage message
Returns
Type Description
ChatMessageThe created message.

ApproveToolCallLink to this section

Approves a tool call that is awaiting the user's approval. The tool is invoked and the model continues its response. When the same message holds other calls that still await approval the answer is sent once all of them are answered.

Declaration
public Task ApproveToolCall(ChatToolCall call)
Parameters
Type Name Description
ChatToolCall call The tool call.
Returns
Type Description
Task

BuildRenderTreeLink to this section

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

ClearAttachmentsLink to this section

Removes all pending attachments.

Declaration
public void ClearAttachments()

ClearChatLink to this section

Clears all messages from the chat.

Declaration
public Task ClearChat()
Returns
Type Description
Task

DisposeLink to this section

Declaration
public override void Dispose()

FocusAsyncLink to this section

Focuses the input.

Declaration
public ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClassLink to this section

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetMessagesLink to this section

Gets the current list of messages.

Declaration
public IReadOnlyList<ChatMessage> GetMessages()
Returns
Type Description
IReadOnlyList<ChatMessage>

GetSessionIdLink to this section

Gets the current session ID.

Declaration
public string GetSessionId()
Returns
Type Description
string

LoadConversationHistoryLink to this section

Loads conversation history from the AI service session.

Declaration
public Task LoadConversationHistory()
Returns
Type Description
Task

LoadMessagesLink to this section

Loads messages into the chat, replacing any existing ones. Preserves the timestamp of each message — use this to restore conversation history.

Declaration
public Task LoadMessages(IEnumerable<ChatMessage> messages)
Parameters
Type Name Description
IEnumerable<ChatMessage> messages The messages to load.
Returns
Type Description
Task

OnAfterRenderAsyncLink to this section

Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type Name Description
bool firstRender
Returns
Type Description
Task

OnInitializedAsyncLink to this section

Declaration
protected override Task OnInitializedAsync()
Returns
Type Description
Task

OnParametersSetAsyncLink to this section

Declaration
protected override Task OnParametersSetAsync()
Returns
Type Description
Task

RefreshLink to this section

Renders the chat again, for example after changing the Content of a message it shows.

Declaration
public void Refresh()

RejectToolCallLink to this section

Rejects a tool call that is awaiting the user's approval. The model is told the call was rejected and continues its response.

Declaration
public Task RejectToolCall(ChatToolCall call)
Parameters
Type Name Description
ChatToolCall call The tool call.
Returns
Type Description
Task

RemoveAttachmentLink to this section

Removes an attachment from the next message.

Declaration
public void RemoveAttachment(ChatAttachment attachment)
Parameters
Type Name Description
ChatAttachment attachment The attachment.

RemoveMessageLink to this section

Removes a message from the chat, for example a Progress entry that ended. The conversation sent to the model is not affected.

Declaration
public bool RemoveMessage(ChatMessage message)
Parameters
Type Name Description
ChatMessage message The message.
Returns
Type Description
booltrue when the message was in the chat.

RenderMessageLink to this section

Renders a message the way the chat does by default: the avatar, time, usage, attachments, reasoning, text and tool calls in order, sources and MessageFooterTemplate, or the status, progress or error entry for the other ChatMessageKind values. Use it in MessageTemplate for the messages you do not render yourself.

Declaration
public RenderFragment RenderMessage(ChatMessage message)
Parameters
Type Name Description
ChatMessage message The message.
Returns
Type Description
RenderFragment

SendMessageLink to this section

Sends a message programmatically.

Declaration
public Task SendMessage(string content)
Parameters
Type Name Description
string content The message content to send.
Returns
Type Description
Task

SendMessageLink to this section

Sends a message programmatically.

Declaration
public Task SendMessage(string content, string model, string systemPrompt, double? temperature, int? maxTokens, string endpoint, string proxy, string apiKey, string apiKeyHeader)
Parameters
Type Name Description
string content The message content to send.
string model
string systemPrompt
double? temperature
int? maxTokens
string endpoint
string proxy
string apiKey
string apiKeyHeader
Returns
Type Description
Task

SetParametersAsyncLink to this section

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task

StopLink to this section

Stops the response that is being generated. The text received so far is kept.

Declaration
public void Stop()
An error has occurred. This app may no longer respond until reloaded. Reload 🗙