-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Motivation and Context (Why the change? What's the scenario?) Add option to stream Ask result tokens without waiting for the full answer to be ready. ## High level description (Approach, Design) - New `stream` boolean option for the `Ask` API, false by default. When true, answer tokens are streamed as soon as they are generated by LLMs. - New `MemoryAnswer.StreamState` enum property: `Error`, `Reset`, `Append`, `Last`. - If moderation is enabled, the content is validated at the end. In case of moderation failure, the service returns an answer with `StreamState` = `Reset` and the new content to show to the end user. - Streaming uses SSE message format. - By default, SSE streams end with a `[DONE]` token. This can be disabled via KM settings. - SSE payload is optimized, returning `RelevantSources` only in the first SSE message. --------- Co-authored-by: Carlo <carlo.dechellis@mobilesoft.it> Co-authored-by: Devis Lucato <dluc@users.noreply.github.com> Co-authored-by: Devis Lucato <devis@microsoft.com>
- Loading branch information
1 parent
53db61a
commit 77fd7be
Showing
27 changed files
with
841 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.