Repository navigation
[Inference API] Add Chat Completion to Amazon Bedrock for the Inference API - #139411
Merged
jonathan-buttner merged 81 commits intoJan 22, 2026
Merged
Conversation
…Completions-support' into Add-Amazon-Bedrock-Unified-Chat-Completions-support # Conflicts: # x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/request/completion/ToolAwareUnifiedPublisher.java
…Completions-support' into Add-Amazon-Bedrock-Unified-Chat-Completions-support
…elasticsearch into ia-bedrock-completions
DonalEvans
reviewed
Jan 6, 2026
DonalEvans
approved these changes
Jan 21, 2026
DonalEvans
left a comment
Contributor
There was a problem hiding this comment.
Just a couple of small things, other than that looks good.
| } | ||
| default -> Document.mapBuilder().build(); | ||
| default -> throw new IllegalArgumentException( | ||
| Strings.format("Unsupported type: %s while convert to Bedrock document representation", value.getClass().getSimpleName()) |
Contributor
There was a problem hiding this comment.
Nitpick, "while converting to..."
Comment on lines
+113
to
+116
| assertEquals(0.7, updatedSettings.temperature(), 0.001); | ||
| assertEquals(0.8, updatedSettings.topP(), 0.001); | ||
| assertEquals(0.9, updatedSettings.topK(), 0.001); | ||
| assertEquals(256, updatedSettings.maxNewTokens(), 0.001); |
Contributor
There was a problem hiding this comment.
Do we need the deltas in the assertions here and elsewhere in the file? Why would we expect the value in the AmazonBedrockCompletionTaskSettings to be different from the value in the map used to create them? Also, a delta that's less than 1 for an integer value doesn't really make sense, so the assertion on the value returned by maxNewTokens() should definitely not use a delta, even if there's a valid reason for the other assertions to use one.
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.
This PR implements chat completion for amazon bedrock. It's based on this PR: #133697
Testing
Create the endpoint
Complex request