Skip to content

[ML] Refactoring inference API non-streaming response validation error object check #126725

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

Merged

Conversation

jonathan-buttner
Copy link
Contributor

This PR refactors the response validation logic to only check for the presence of an error object in a streaming request logic. This avoids having to perform parse attempt for an error object on each request in the non-stream case where we expect most requests to succeed.

The error object is still parsed when the response handler encounters a non-200 status code.

@jonathan-buttner jonathan-buttner added >non-issue :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 labels Apr 11, 2025
@jonathan-buttner jonathan-buttner marked this pull request as ready for review April 14, 2025 12:15
@elasticsearchmachine
Copy link
Collaborator

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

@jonathan-buttner jonathan-buttner merged commit 31bb3d1 into elastic:main Apr 14, 2025
17 checks passed
@jonathan-buttner jonathan-buttner deleted the ml-refactor-eager-error-check branch April 14, 2025 14:42
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Apr 14, 2025
…r object check (elastic#126725)

* Refactoring so that non-streaming does not check for error object

* Fixing test
elasticsearchmachine pushed a commit that referenced this pull request Apr 14, 2025
…r object check (#126725) (#126782)

* Refactoring so that non-streaming does not check for error object

* Fixing test
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 :ml Machine learning >non-issue Team:ML Meta label for the ML team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants