Chat
Since 0.1.0-alpha.22IzzyBlazor.Chat in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.31 assembly
and its doc comments.
Properties (17)
Labelstring requiredNames the conversation's log, such as "Assistant" or "Messages with Dana". Required.
ChildContentRenderFragment?The entries: ChatEntry items, oldest first.
EmptyContentRenderFragment?Shown in the log before the first entry, such as a greeting.
StatusChatStatus = ChatStatus.ReadyWhere the reply is. While it's Waiting or Streaming, Send becomes Stop and a message can't be sent.
SuggestionsIReadOnlyList<string>?Messages a person can send with one press, shown above the box while nothing is on its way.
Placeholderstring?The prompt in the empty box, such as "Ask about your order".
MaxLengthint?The most characters a message can have.
FormNamestring = "chat"The form's name on a static page, unique on the page, as a Form's FormName. Defaults to "chat".
FormActionstring?The address the form posts to on a static page; by default, the page's own. Set it to keep the conversation's id in the address, such as /help?conversation=4f2a: the post goes there, so the page knows the conversation, with no redirect.
@bind-Draftstring?The message being written, to fill the box or clear it from code (with @bind-Draft, it follows what's typed on an interactive page). A static page shows it in the box.
ComposerActionsRenderFragment?Buttons of your own in the box's row of tools, just before Send, such as a microphone that dictates into Draft. Give each a label.
AllowFilesbool = falseAdds a button to attach files to a message: they come to OnSend as its Files.
Acceptstring?The file types that can be attached, as a file input's accept: .pdf,image/*.
MaxFileSizelong = 10000000The largest file that can be attached, in bytes. Defaults to 10 MB (10,000,000).
MaxFilesint = 5The most files a message can have. Defaults to 5.
VariantChatVariant = ChatVariant.AssistantHow others' entries look: across the log (Assistant, the default) or in bubbles (Conversation, for people talking).
HeadingLevelint = 3The level of each entry's hidden heading, 2 to 6. Defaults to 3.
Events (2)
OnSendEventCallback<ChatSendArgs>Called with what a person sent: the message typed, or a suggestion chosen.
Parts (1)
Components written inside Chat, documented here with it.
ChatEntry
One message in a Chat: yours (Mine), or someone else's, with their name and avatar.
Minebool = falseWhether the entry is yours: it sits at the end, in a bubble, with no name.
Authorstring?Who wrote it, such as "Assistant" or "Dana". Shown above it, and its avatar's name.
Avatarstring?The address of the author's picture. Without one, others' avatars show the author's initials; yours shows only with this or Initials.
Initialsstring?The avatar's letters, such as "IB", in place of the author's initials (and without a picture).
TimeDateTimeOffset?When it was written: the time is shown, and the day above the day's first entry. Both are in the value's own offset, so give it in the reader's (the server can't know their time zone).
Textstring?The message as plain text; its line breaks are kept.
Htmlstring?The message as HTML; it's sanitized first.
ChildContentRenderFragment?Anything else, such as a card or the sources an answer used. It replaces Text, Markdown and Html.
AttachmentsIReadOnlyList<ChatAttachment>?Files sent with it, shown under it as their names (linked when they have an address).
Pendingbool = falseWhether more is coming: dots until content arrives, then a caret after it.
Failedbool = falseWhether it failed: "Not sent" for yours, "Reply failed" for others, with Retry when OnRetry is set.
ActionsRenderFragment?Buttons of your own after Copy, such as thumbs up and down for an answer. Give each a label.
Copyablebool? (computed)Whether a copy button copies its text. Defaults to on for others' entries and off for yours.
OnRetryEventCallbackCalled when a person chooses Retry on a failed entry.
Plus 4 common props.
Types (4)
ChatAttachment
recordA file shown on a ChatEntry: its name, and where to get it.
| Member | Description |
|---|---|
Name string | The file's name, such as "invoice.pdf". |
Href string? | The address it can be opened or downloaded at; without one, it's only named. |
Size long? | Its size in bytes, shown beside the name. |
ChatSendArgs
recordWhat a person sent in a Chat.
| Member | Description |
|---|---|
Text string | The message, as typed (or the suggestion chosen), trimmed. |
CanStream bool | Whether the reply can arrive in pieces: on an interactive page, and on a static page whose post came with script (with |
Files IReadOnlyList<IBrowserFile> | The files attached (with the chat's |
ChatStatus
enumWhere a Chat's reply is.
| Value | Description |
|---|---|
Ready | Nothing is on its way: Send sends. |
Waiting | A message was sent and no reply has started: Stop shows in Send's place. |
Streaming | A reply is arriving: Stop shows in Send's place. |
Failed | The last reply failed. Send sends again. |
ChatVariant
enumHow a Chat shows others' entries.
| Value | Description |
|---|---|
Assistant | Others' entries across the log with no bubble, for an assistant's answers with tables and code. Yours are bubbles at the end. |
Conversation | Everyone's entries in bubbles, yours at the end and others' at the start, for people talking. |