Skip to content

[ML] Append all data to Chat Completion buffer #127658

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

prwhelan
Copy link
Member

@prwhelan prwhelan commented May 2, 2025

Moved the Chat Completion buffer into the
StreamingUnifiedChatCompletionResults so that all Chat Completion responses can benefit from it. Chat Completions is meant to adhere to OpenAI as much as possible, and OpenAI only sends one response chunk at a time. All implementations of Chat Completions will now buffer.

This fixes a bug where more than two chunks in a single item would be dropped, instead they are all added to the buffer.
This fixes a bug where onComplete would omit trailing items in the buffer.

Moved the Chat Completion buffer into the
StreamingUnifiedChatCompletionResults so that all Chat Completion
responses can benefit from it. Chat Completions is meant to adhere to
OpenAI as much as possible, and OpenAI only sends one response chunk at
a time. All implementations of Chat Completions will now buffer.

This fixes a bug where more than two chunks in a single item would be
dropped, instead they are all added to the buffer.

This fixes a bug where onComplete would omit trailing items in the
buffer.
@prwhelan prwhelan added >bug :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 v8.18.2 v9.0.2 labels May 2, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @prwhelan, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug :ml Machine learning Team:ML Meta label for the ML team v8.18.2 v8.19.0 v9.0.2 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants