-
Notifications
You must be signed in to change notification settings - Fork 80
docs: add chat initial docs #11678 #3193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Add the Chat to the "INTERACTIVITY AND UX" category on the home page. |
| TextField="Content" | ||
| AuthorIdField="UserId" | ||
| TimestampField="SentAt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use @nameof()
| }; | ||
|
|
||
| Messages.Add(newMessage); | ||
| await InvokeAsync(StateHasChanged); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? The component updates even without it.
| SentAt = DateTime.Now.AddMinutes(-3) | ||
| } | ||
| }; | ||
| private string CurrentUserId = "user1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private string CurrentUserId = "user1"; | |
| private readonly string CurrentUserId = "user1"; |
|
|
||
| public class ChatMessage | ||
| { | ||
| public string Id { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public string Id { get; set; } | |
| public string Id { get; set; } = string.Empty; |
| public class ChatMessage | ||
| { | ||
| public string Id { get; set; } | ||
| public string Content { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public string Content { get; set; } | |
| public string Content { get; set; } = string.Empty; |
| { | ||
| public string Id { get; set; } | ||
| public string Content { get; set; } | ||
| public string UserId { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public string UserId { get; set; } | |
| public string UserId { get; set; } = string.Empty; |
| public string Content { get; set; } | ||
| public string UserId { get; set; } | ||
| public DateTime SentAt { get; set; } | ||
| public List<FileSelectFileInfo> Attachments { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public List<FileSelectFileInfo> Attachments { get; set; } | |
| public List<FileSelectFileInfo>? Attachments { get; set; } |
| public class ChatMessage | ||
| { | ||
| public string Id { get; set; } | ||
|
|
||
| public string AuthorId { get; set; } | ||
|
|
||
| public string AuthorName { get; set; } | ||
|
|
||
| public string Content { get; set; } | ||
|
|
||
| public DateTime Timestamp { get; set; } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public class ChatMessage | |
| { | |
| public string Id { get; set; } | |
| public string AuthorId { get; set; } | |
| public string AuthorName { get; set; } | |
| public string Content { get; set; } | |
| public DateTime Timestamp { get; set; } | |
| } | |
| public class ChatMessage | |
| { | |
| public string Id { get; set; } = string.Empty; | |
| public string AuthorId { get; set; } = string.Empty; | |
| public string AuthorName { get; set; } = string.Empty; | |
| public string Content { get; set; } = string.Empty; | |
| public DateTime Timestamp { get; set; } | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to add captions to your code snippets and examples. The more descriptive the better. For the most part, this PR lacks links to the API documentation. There are also issues with the amount of information that the docs provide. There are many instances of "this lets you do something" without actually explaining how to do it but resorting to the code snippet instead.
Also note that there's a very confusing API docs experience. There's documentation under Telerik.Blazor.Components which seems pretty descriptive and extensive. and then there's additional documentation under Telerik.Blazor.Components.Chat where there are absolutely no descriptions for anything. Are these supposed to be hidden or is there another reason for the lack of docs there?
| | `Multiple` | `bool` | `true` | Allow multiple file selection | | ||
| | `OnSelect` | `EventCallback` | - | Event fired when files are selected | | ||
|
|
||
| >caption An exemplary Chat file upload configuration is shown below |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a sample Chat or an exemplary Chat? Double-check the definition of exemplary.
|
|
||
| Configure file actions and handle downloads using JavaScript interop and custom event handlers. | ||
|
|
||
| 1. Add JavaScript Interop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a weird approach to a simple step-by-step procedure. It's as if the step text should act as a title (also indicated by the lack of ending punctuation and the title-style casing) and the line below is supposed to be the explanation text under the heading. Please, fix the entire section. Also, note that while Step 2 complies with this approach, Step 3 strays from it.
|
|
||
| ### Configuration | ||
|
|
||
| Enable speech-to-text functionality by setting `EnableSpeechToText` to `true`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch the ending punctuation to a period for consistency with the remainder of the article.
|
|
||
| This article explains: | ||
|
|
||
| * [AI and LLM Integration](#ai-and-llm-integration) - Connect to AI services and language models |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, you would use colons or m-dashes as a separator here. Furthermore, You don't really need the current format of this section. You could have gone with:
This article explains how to:
* Connect to AI services and language models
* Integrate with chatbot frameworks
* Handle AI responses and user interactions
(with the respective links)
|
|
||
| The Chat component works seamlessly with AI services and Large Language Models. You can integrate with various providers like OpenAI, Azure OpenAI, or custom AI services. | ||
|
|
||
| ### Microsoft.Extensions.AI Integration Example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go with a caption or some other title style here instead. Single nested H-elements are not a good practice and it looks odd in the sidebar navigation.
|
|
||
| You can connect the Chat component to various chatbot platforms including Microsoft Bot Framework, custom REST APIs, or third-party chatbot services. The component handles the user interface while your bot service processes messages and generates appropriate responses. | ||
|
|
||
| >tip The [Person to Bot demo](https://demos.telerik.com/blazor-ui/chat/person-to-bot) showcases chatbot functionality. This demo utilizes a Telerik-hosted AI service solely for illustration purposes. In production environments, you should develop your own AI service tailored to your specific business domain, requirements, and organizational needs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Person-to-Bot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semantically, this is not a tip but an info box. A tip implies non-essential information that might improve your productivity or results. In this case, you're informing the reader of something they need to be aware of.
|
|
||
| Control the width behavior of chat messages using the `MessageWidthMode` parameter: | ||
|
|
||
| * `MessageWidthMode.Standard` - Messages take up a portion of the available space for better readability (default behavior) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to a colon or an m-dash for the separator. Add ending punctuation to the list items.
| } | ||
| ```` | ||
|
|
||
| ## Data Binding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that Quick Actions are not listed among the key features.
|
|
||
| ## Message Suggestions | ||
|
|
||
| Message suggestions provide users with quick reply options that appear below the message input area. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is not very helpful to be honest. I had to inspect the code and the example to figure out the feature. You need to add some explicit explanations in here. This would make the content more helpful to both readers and LLMs.
|
|
||
| ## Custom Suggestion Templates | ||
|
|
||
| Customize the appearance of suggestions using the Chat's `SuggestionTemplate`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note how your snippet here contains code comments. However, none of them relate to SuggestionTemplate. Improve your sample code with notes about the actual thing you're documenting. There's also no caption for the code snippet. There are no links to the APIs.
Closes https://github.com/telerik/blazor/issues/11678