Skip to content

Conversation

Evgenii-Kazannik
Copy link
Contributor

DRAFT

@elasticsearchmachine elasticsearchmachine added v9.2.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Aug 28, 2025
@Evgenii-Kazannik Evgenii-Kazannik force-pushed the Add-Amazon-Bedrock-Unified-Chat-Completions-support branch 5 times, most recently from 141c154 to 736ce22 Compare September 3, 2025 08:50
Copy link
Contributor

@jonathan-buttner jonathan-buttner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, I left a few suggestions. I also reached out to some folks who also have done this translation for a totally different product. I remember there being a few edge cases so I'll hunt those down for us to make sure we also handle them.

var chatCompletionInput = inferenceInputs.castTo(ChatCompletionInput.class);
var inputs = chatCompletionInput.getInputs();
var stream = chatCompletionInput.stream();
switch (inferenceInputs) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we create a new class that handles the UnifiedChatInput directly?

Once we've done that we can use that class directly in doUnifiedCompletionInfer.

protected void executeClientRequest(AmazonBedrockBaseClient awsBedrockClient) {
if (chatCompletionRequest.isStreaming()) {
var publisher = chatCompletionRequest.executeStreamChatCompletionRequest(awsBedrockClient);
inferenceResultsListener.onResponse(new StreamingChatCompletionResults(publisher));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of StreamingChatCompletionResults I think we want to use StreamingUnifiedChatCompletionResults. I think we should just be able to pass in publisher 🤔 Let me know if that works.

@Evgenii-Kazannik Evgenii-Kazannik force-pushed the Add-Amazon-Bedrock-Unified-Chat-Completions-support branch from 2cd928c to a6df6f0 Compare September 17, 2025 07:35
@Evgenii-Kazannik Evgenii-Kazannik force-pushed the Add-Amazon-Bedrock-Unified-Chat-Completions-support branch from 3f4df8f to 158734b Compare September 18, 2025 14:44
@Evgenii-Kazannik Evgenii-Kazannik force-pushed the Add-Amazon-Bedrock-Unified-Chat-Completions-support branch from 5157eb3 to 0f83043 Compare September 23, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor Pull request authored by a developer outside the Elasticsearch team v9.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants