extproc: properly stream chat completions#468
Merged
Conversation
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
mathetake
commented
Mar 7, 2025
Member
Author
There was a problem hiding this comment.
this is where the actual change took place: Instead of setting mode override in ProcessRequestBody, this will instead set it in ProcessResponseHeaders
aabchoo
approved these changes
Mar 7, 2025
Contributor
aabchoo
left a comment
There was a problem hiding this comment.
overall looks good to me
| tokenUsage LLMTokenUsage, | ||
| err error, | ||
| ) | ||
|
|
Member
Author
|
i am trying to write a regression test that actually verifies the streaming behavior |
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Member
Author
|
ok the regression test added (verified it's failing on the current main) |
Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
mathetake
added a commit
that referenced
this pull request
Mar 8, 2025
aabchoo
pushed a commit
that referenced
this pull request
Mar 14, 2025
**Commit Message** This fixes a bug in the extproc when handling stream=true requests. Previously, mode_override was set at the request body handling phase, and it was not set in the response headers phase. That resulted in buffering the entire response body which is clearly not ideal as from clients point of view, they will receive the entire streaming vs line by line. This refactors around the mode override and properly handle it. --------- Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
aabchoo
added a commit
that referenced
this pull request
Mar 14, 2025
**Commit Message** PR to backport `mockChatCompletionMetrics`, chat completion stream fix, and openai content type. Including: - #459 (468 uses mock components introduced here) - #468 - #486 --------- Signed-off-by: Huamin Chen <hchen@redhat.com> Signed-off-by: Ignasi Barrera <ignasi@tetrate.io> Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com> Signed-off-by: Aaron Choo <achoo30@bloomberg.net> Co-authored-by: Ignasi Barrera <ignasi@tetrate.io> Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com> Co-authored-by: Dan Sun <dsun20@bloomberg.net>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message
This fixes a bug in the extproc when handling stream=true requests. Previously, mode_override was set at the request body handling phase, and it was not set in the response headers phase. That resulted in buffering the entire response body which is clearly not ideal as from clients point of view, they will receive the entire streaming vs line by line. This refactors around the mode override and properly handle it.