-
Notifications
You must be signed in to change notification settings - Fork 16
feat: add ai chat container #998
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
base: main
Are you sure you want to change the base?
Changes from all commits
9e38eee
a21fc3d
aec9205
3e38d1b
eaaa2d8
717b3ca
e0d15a5
5853e94
d2bc17b
4324397
9623ac0
ba73669
3e62153
3df5241
9fd1561
dfaa2e0
01f9e4c
e1bb8b9
06c938e
792f96b
1a33314
60627ae
9d64c9b
9e68baa
2147017
36aaea3
17f2d29
534316e
5dc1569
9b9f9d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -86,20 +86,67 @@ These are not treated as errors and do not require a separate notification. | |||||
|
|
||||||
| ## Code --- | ||||||
Killusions marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| Use the chat container with the chat messages to build chat message interfaces. | ||||||
| The **si-ai-chat-container** component provides a complete AI chat interface, it should be inserted into a layout with fixed height, if no fixed height is provided, please set a height in pixels. | ||||||
Killusions marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix comma splice and clarify the height instruction. Line 89 contains a run-on sentence with comma-spliced clauses. Additionally, the instruction to "set a height in pixels" is vague—it should specify the mechanism (inline style, CSS class, etc.). 📝 Proposed fix-The **si-ai-chat-container** component provides a complete AI chat interface, it should be inserted into a layout with fixed height, if no fixed height is provided, please set a height in pixels.
+The **si-ai-chat-container** component provides a complete AI chat interface and should be inserted into a layout with fixed height. If no fixed height is provided, set an explicit pixel height via inline styles or CSS.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| <si-docs-component example="si-chat-messages/si-ai-chat-container" height="750"></si-docs-component> | ||||||
|
|
||||||
| <si-docs-api component="SiAiChatContainerComponent"></si-docs-api> | ||||||
|
|
||||||
| ### Initial Screen | ||||||
|
|
||||||
| The AI chat container includes a built-in initial welcome screen component that displays when there are no messages. It can be slotted into the **si-chat-container** component. It accepts prompt suggestions as an input. | ||||||
|
|
||||||
| <si-docs-component example="si-chat-messages/si-ai-welcome-screen" height="600"></si-docs-component> | ||||||
|
|
||||||
| <si-docs-api component="SiAiWelcomeScreenComponent"></si-docs-api> | ||||||
|
|
||||||
| #### Prompt Suggestions | ||||||
|
|
||||||
| Prompt suggestions can be provided as either: | ||||||
|
|
||||||
| - A simple array of suggestions (no categories) | ||||||
| - A record mapping category labels to arrays of suggestions | ||||||
|
|
||||||
| When using a record, categories are automatically displayed as filter pills. | ||||||
|
|
||||||
| ```typescript | ||||||
| // Simple array (no categories) | ||||||
| promptSuggestions = [ | ||||||
| { text: 'How do I optimize performance?' }, | ||||||
| { text: 'What are best practices?' } | ||||||
| ]; | ||||||
|
|
||||||
| // Record with categories | ||||||
| promptSuggestions = { | ||||||
| 'All prompts': [{ text: 'How do I optimize performance?' }, { text: 'What are best practices?' }], | ||||||
| 'Maintenance': [{ text: 'Schedule preventive maintenance' }, { text: 'Track equipment downtime' }] | ||||||
| }; | ||||||
| ``` | ||||||
|
|
||||||
| ### Base Chat Container | ||||||
|
|
||||||
| Use this base container with the chat messages to build custom chat message interfaces. | ||||||
|
|
||||||
| The **si-chat-container** component is a wrapper component, it has slots for | ||||||
| [chat messages](../../components/chat-messages/chat-message.md) and a | ||||||
| [chat input](../../components/chat-messages/chat-input.md). | ||||||
|
|
||||||
| The slots are: | ||||||
|
|
||||||
| - default -> chat messages or empty state | ||||||
| - default -> chat messages or initial screen (`si-welcome-screen`) | ||||||
| - `si-chat-input/siChatContainerInput (helper directive)` -> For the input (whether default or custom). | ||||||
| - `si-inline-notification` -> Slotted above the input for displaying the status. | ||||||
|
|
||||||
| <si-docs-component example="si-chat-messages/si-chat-container" height="600"></si-docs-component> | ||||||
|
|
||||||
| <si-docs-api component="SiChatContainerComponent"></si-docs-api> | ||||||
|
|
||||||
| ### Initial Screen | ||||||
|
|
||||||
| When initially displaying a chat interface use the initial **si-welcome-screen** component that displays when there are no messages. It can be slotted into the **si-chat-container** component. It accepts prompt suggestions as an input. | ||||||
|
|
||||||
| <si-docs-component example="si-chat-messages/si-ai-welcome-screen" height="600"></si-docs-component> | ||||||
|
|
||||||
| <si-docs-api component="SiAiWelcomeScreenComponent"></si-docs-api> | ||||||
|
|
||||||
| <si-docs-types></si-docs-types> | ||||||
Uh oh!
There was an error while loading. Please reload this page.