Skip to content
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

Feature/83694 streaming markdown handling #55

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
57a05d6
WIP first version for streaming msgs
Dec 12, 2024
d113d65
Merge remote-tracking branch 'origin/main' into feature/83694-streami…
Jan 13, 2025
634002d
streaming working
Jan 14, 2025
7b202a7
improve animations
Jan 15, 2025
24f907e
small improvements
Jan 15, 2025
ea87541
handle scrolling until last input and showing a scroll button
Jan 16, 2025
1a7ddcc
exchange scrolling behavior to be able to handle markdown rendering
Jan 17, 2025
cb93106
added scroll to last input logic
Jan 17, 2025
67bd0d1
removed unused const, added a comment description for the chat scroller
Jan 20, 2025
f330dc3
fix paddings
Jan 20, 2025
e9f7d71
fix scrollbar and zIndex
Jan 20, 2025
ffe282f
fix textcolor if bot message bubbles disabled
Jan 20, 2025
8e68be9
add embedding doc lines for new settings
Jan 20, 2025
ee80219
add default values for new settings
Jan 20, 2025
6d516d7
add typing indicator border hiding
Jan 20, 2025
280e79b
increase scroll threshold
Jan 20, 2025
d1551b2
fix cypress test
Jan 21, 2025
deb5cf4
split first chunk on line breaks so that a long output with markdown …
Jan 22, 2025
7797064
added css customization entry for scroll to bottom button
Jan 23, 2025
c3b6f5e
rename setting
Jan 23, 2025
e08b3d8
split streamingMode setting
Jan 23, 2025
60ededb
added new setting for scrolling behavior
Jan 28, 2025
6e0d12c
upgrade chat-components pkg
Jan 28, 2025
8803f75
rename progressiveStreaming to progressiveMessageRendering
Jan 29, 2025
24e69c1
improve description
Jan 29, 2025
1c06dc8
upgrade chat-components pkg
Jan 29, 2025
c2f686a
Merge remote-tracking branch 'origin/main' into feature/83694-streami…
Jan 30, 2025
acce9f1
only show unseen message as one
Jan 30, 2025
2967b3c
remove markdown from teaser message
Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/css-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ There are several classes that you need to take in consideration if you want to
* *webchat-header-close-button*
* *webchat-header-rating-button*
* *webchat-chat-history*
* *webchat-scroll-to-bottom-button*
* *webchat-message-row*
* *regular-message*
* *webchat-avatar*
Expand Down Expand Up @@ -141,6 +142,13 @@ This is the element where all the messages of the chat are are shown, you could

background-color: rgb(48, 48, 48);
}
* *webchat-scroll-to-bottom-button*
This is the button that appears in the chat area when scrolled up. It can be clicked to scroll to the bottom.
```CSS
[data-cognigy-webchat-root] [data-cognigy-webchat].webchat .webchat-scroll-to-bottom-button {

background-color: rgb(88, 88, 88);
}
```
* *webchat-message-row*
The general class for any message in the chat, containing the message and the avatar logo.
Expand Down
15 changes: 13 additions & 2 deletions docs/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ See it in action:
| enableTTS | boolean | `false` | Enable text-to-speech. If `chatOptions.showTTSToggle set to `true`, TTS activation additionally depends on chatOptions.activateTTSToggle to be `true` (or the user expected to manually enable it.) |
| focusInputAfterPostback | boolean | `false` | Input field will receive focus after a Postback button or quick reply button is clicked |
| enableConnectionStatusIndicator | boolean | `true` | Shows a warning if the connection is lost during a conversation. The warning will disappear when the connection is re-established. |
| enableAIAgentNotice | boolean | `true` | Shows a notice at the beginning of the chat regarding talking to a non-human Agent.
| AIAgentNoticeText | string | `You are now talking to an AI agent.` | A string to show as an AI Agent Notice
| enableAIAgentNotice | boolean | `true` | Shows a notice at the beginning of the chat regarding talking to a non-human Agent. |
| AIAgentNoticeText | string | `You are now talking to an AI agent.` | A string to show as an AI Agent Notice |
| collateStreamedOutputs | boolean | `false` | This setting enables collation of streamed messages into one message bubble. |
| progressiveStreaming | boolean | `false` | Enables streamed messages to appear by character instead of by chunk. |
| renderMarkdown | boolean | `false` | Render markdown in text messages. |
| scrollingBehavior | string | `"alwaysScroll"` | Allowed values: `"scrollUntilLastInputAtTop" \| "alwaysScroll"`. Decide how scrolling should behave if scrolled to bottom and a new message comes in. |

#### Start Behavior
| Name | Type | Default | Description |
Expand Down Expand Up @@ -379,6 +383,9 @@ interface IWebchatSettings {
watermark: "default" | "custom" | "none";
watermarkText: string;
watermarkUrl: string;
disableBotOutputBorder: boolean;
botOutputMaxWidthPercentage: number;
chatWindowWidth: number;
};
colors: {
primaryColor: string;
Expand All @@ -396,6 +403,10 @@ interface IWebchatSettings {
enableTTS: boolean;
focusInputAfterPostback: boolean;
enableConnectionStatusIndicator: boolean;
collateStreamedOutputs: boolean;
progressiveStreaming: boolean;
renderMarkdown: boolean;
scrollingBehavior: "alwaysScroll" | "scrollUntilLastInputAtTop";
};
startBehavior: {
startBehavior: "none" | "button" | "injection";
Expand Down
Loading