Skip to content

Commit 75bc691

Browse files
kylerohnmsftkylerohnMattB-msftcompulim
authored
Add support for streaming through entities (#5517)
* delete `text` from typing activities which are not streaming * add support for reading streaming data in `entities` * refactoring to pass existing html2 test cases * minimal implementation of entities livestreaming * Rewrite code flow to check for streamingData first -- draft version (this is pretty rough) * Change conditionals to be more readable and actually check channelData * handle case of entities being undefined * Make channelData optional in entitiesStreamingActivitySchema * make channelData not optional for entitiesStreamingActivitySchema * change looseObject back to object * handle entities being undefined again * clean up logical flow and include more typing * Removed common data from schemas for reusability * read channelData instead of entities * remove unnecessary field from StreamingData * typing+final+text activity returns undefined * further abstraction of schemas * update unit tests * edit changelog * finish changelog * edit docs * allow for optional channelData in entities streaming schema * added jsdoc to StreamingData interface * fix naming issues * add sample * trigger CI * fix sample * require type: streaminfo field for streaming data in entities * fix unit tests to reflect added `entities` field * Use valibot properly * Verbiage * Clean up * Simplify * Revert back to original * Revert test and use permutation * Update entry * Add `injectInto` * Clean up * Clean up * Add tests * Reverting --------- Co-authored-by: = <=> Co-authored-by: Kyle Rohn <108435516+kylerohn@users.noreply.github.com> Co-authored-by: MattB <mattb-msft@hotmail.com> Co-authored-by: William Wong <compulim@users.noreply.github.com>
1 parent d0ea7a6 commit 75bc691

File tree

4 files changed

+377
-159
lines changed

4 files changed

+377
-159
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
107107
- Added `disableFileUpload` flag to completelly disable file upload feature, in PR [#5508](https://github.com/microsoft/BotFramework-WebChat/pull/5508), by [@JamesNewbyAtMicrosoft](https://github.com/JamesNewbyAtMicrosoft)
108108
- Deprecated `hideUploadButton` in favor of `disableFileUpload`.
109109
- Updated `BasicSendBoxToolbar` to rely solely on `disableFileUpload`.
110+
- Added support for livestreaming via `entities[type="streaminfo"]` in PR [#5517](https://github.com/microsoft/BotFramework-WebChat/pull/5517) by [@kylerohn](https://github.com/kylerohn) and [@compulim](https://github.com/compulim)
110111

111112
### Changed
112113

docs/LIVESTREAMING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,24 @@ To simplify this documentation, we are using the term "bot" instead of "copilot"
6464

6565
Bot developers would need to implement the livestreaming as outlined in this section. The implementation below will enable livestreaming to both Azure Bot Services and Teams.
6666

67+
> [!NOTE]
68+
>
69+
> Web Chat supports livestreaming data in both `channelData` or `entities[type="streaminfo"]` field and can be used interchangeably. The following code snippet shows the livestream data in `entities` field.
70+
>
71+
> ```json
72+
> {
73+
> "entities": [
74+
> {
75+
> "streamSequence": 1,
76+
> "streamType": "streaming",
77+
> "type": "streaminfo"
78+
> }
79+
> ],
80+
> "text": "...",
81+
> "type": "typing"
82+
> }
83+
> ```
84+
6785
### Scenario 1: Livestream from start to end
6886
6987
> In this example, we assume the bot is livestreaming the following sentence to the user:

0 commit comments

Comments
 (0)