Skip to content

Conversation

@prwhelan
Copy link
Member

@prwhelan prwhelan commented Feb 5, 2025

Unified Chat Completion error responses now forward code, type, and param to in the response payload. reason has been renamed to message.

Notes:

  • XContentFormattedException is a ChunkedToXContent so that the REST listener can call toXContentChunked to format the output structure. By default, the structure forwards to our existing ES exception structure.
  • UnifiedChatCompletionException will override the structure to match the new unified format.
  • The Rest, Transport, and Stream handlers all check the exception to verify it is a UnifiedChatCompletionException.
  • OpenAI response handler now reads all the fields in the error message and forwards them to the user.
  • In the event that a Throwable is a Error, we rethrow it on another thread so the JVM can catch and handle it. We also stop surfacing the JVM details to the user in the error message (but it's still logged for debugging purposes).

Unified Chat Completion error responses now forward code, type, and
param to in the response payload. `reason` has been renamed to
`message`.

Notes:
- `XContentFormattedException` is a `ChunkedToXContent` so that the REST listener can call `toXContentChunked` to format the output structure.  By default, the structure forwards to our existing ES exception structure.
- `UnifiedChatCompletionException` will override the structure to match the new unified format.
- The Rest, Transport, and Stream handlers all check the exception to verify it is a UnifiedChatCompletionException.
- OpenAI response handler now reads all the fields in the error message and forwards them to the user.
- In the event that a `Throwable` is a `Error`, we rethrow it on another thread so the JVM can catch and handle it.  We also stop surfacing the JVM details to the user in the error message (but it's still logged for debugging purposes).
@prwhelan prwhelan added >bug :ml Machine learning backport Team:ML Meta label for the ML team auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) v9.0.0 labels Feb 5, 2025
@prwhelan prwhelan marked this pull request as ready for review February 5, 2025 21:50
@elasticsearchmachine elasticsearchmachine merged commit 87a808a into elastic:9.0 Feb 5, 2025
16 checks passed
@prwhelan prwhelan deleted the backport/9.0/121396 branch February 5, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :ml Machine learning Team:ML Meta label for the ML team v9.0.0 v9.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants