-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Add Amazon Bedrock Unified Chat Completions support #133697
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
base: main
Are you sure you want to change the base?
Add Amazon Bedrock Unified Chat Completions support #133697
Conversation
141c154
to
736ce22
Compare
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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.
2cd928c
to
a6df6f0
Compare
3f4df8f
to
158734b
Compare
5157eb3
to
0f83043
Compare
DRAFT