-
Notifications
You must be signed in to change notification settings - Fork 90
feat: support bedrock reasoning content response #1074
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?
feat: support bedrock reasoning content response #1074
Conversation
Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: Alexa Griffith <[email protected]>
Signed-off-by: Alexa Griffith <[email protected]>
…ub.com/alexagriffith/ai-gateway into alexagriffith/support-bedrock-thinking
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1074 +/- ##
==========================================
- Coverage 78.33% 78.13% -0.21%
==========================================
Files 81 82 +1
Lines 9349 9629 +280
==========================================
+ Hits 7324 7524 +200
- Misses 1681 1749 +68
- Partials 344 356 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Alexa Griffith <[email protected]>
@@ -467,21 +513,20 @@ func (o *openAIToAWSBedrockTranslatorV1ChatCompletion) bedrockStopReasonToOpenAI | |||
|
|||
func (o *openAIToAWSBedrockTranslatorV1ChatCompletion) bedrockToolUseToOpenAICalls( | |||
toolUse *awsbedrock.ToolUseBlock, | |||
) *openai.ChatCompletionMessageToolCallParam { | |||
) openaigo.ChatCompletionMessageToolCall { |
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.
switch to a pointer return?
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.
we just dereference the ptr right after returning, what do u think is best to do?
}, | ||
FinishReason: o.bedrockStopReasonToOpenAIStopReason(bedrockResp.StopReason), |
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.
can we set the finishReason inplace?
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.
same for Index
if choice.Message.Content == nil { | ||
choice.Message.Content = output.Text | ||
switch { | ||
case output.ToolUse != nil: |
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.
ToolUse
and Text
cannot be non-nil at the same time, right?
if yes, can you add comment about it or point to docs about it
Description
support returning reasoning content from aws bedrock in openai.
required adding aws bedrock fields that were missing and requires returning extra fields. since we are already refactoring to use openai go sdk, it makes sense to implement this here instead of adding it to our custom openai struct.