-
Notifications
You must be signed in to change notification settings - Fork 984
main -> v1.5.0 backmerge #2732
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
main -> v1.5.0 backmerge #2732
Changes from 11 commits
a8cf690
79a1ab4
8f84688
663ded6
588e975
188fc0e
1bda46a
67938e2
b423d7d
5d3b34b
1efbfcd
f2005ef
132b0d4
254e41e
12e443b
e7ef535
15b67f2
56c3cb4
32138be
f76f600
aa360ca
b9efa11
6d6b554
6d0e64f
83599a2
ca5174e
fce84de
896f571
61e8079
594b508
3ed64a6
18427ac
16896bd
8c11869
ce62c64
d1d1004
19a4473
0485a49
a80bb41
9c00d7b
f75d607
72ecaca
c4a191d
c907a4d
304d547
12c68f3
9dc2478
3e0dd03
485810b
0ac9518
bfe8360
f962154
314f13f
dd36ff0
aec4b7e
cbfa4f4
40737ff
adc31bc
67340ad
b31cc3a
67319e5
be3edf3
1e79b19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - fix: case-insensitive `anthropic-beta` merge in `MergeBetaHeaders` | ||
| - fix: Bedrock provider - emit message_stop event for Anthropic invoke stream [@tefimov](https://github.com/tefimov) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1302,11 +1302,11 @@ type BedrockInvokeStreamChunkEvent struct { | |
| func (event *BedrockStreamEvent) ToEncodedEvents() []BedrockEncodedEvent { | ||
| var events []BedrockEncodedEvent | ||
|
|
||
| if event.InvokeModelRawChunk != nil { | ||
| for _, rawChunk := range event.InvokeModelRawChunks { | ||
| events = append(events, BedrockEncodedEvent{ | ||
| EventType: "chunk", | ||
| Payload: BedrockInvokeStreamChunkEvent{ | ||
| Bytes: event.InvokeModelRawChunk, | ||
| Bytes: rawChunk, | ||
| }, | ||
| }) | ||
| } | ||
|
|
@@ -2565,6 +2565,18 @@ func ConvertBifrostMessagesToBedrockMessages(bifrostMessages []schemas.Responses | |
| for _, block := range msg.ResponsesToolMessage.Output.ResponsesFunctionToolCallOutputBlocks { | ||
| if block.Text != nil { | ||
| resultContent = append(resultContent, tryParseJSONIntoContentBlock(*block.Text)) | ||
| } else if block.Type == schemas.ResponsesInputMessageContentBlockTypeImage && | ||
| block.ResponsesInputMessageContentBlockImage != nil && | ||
| block.ResponsesInputMessageContentBlockImage.ImageURL != nil { | ||
| imageSource, err := convertImageToBedrockSource(*block.ResponsesInputMessageContentBlockImage.ImageURL) | ||
| if err != nil { | ||
| // Bedrock only supports base64 data URIs for images. If conversion | ||
| // fails (e.g. remote URL), the image is dropped from the tool result | ||
| // which silently degrades the model's ability to see tool output. | ||
| _ = fmt.Errorf("bedrock: converting tool result image: %w", err) | ||
| } else { | ||
| resultContent = append(resultContent, BedrockContentBlock{Image: imageSource}) | ||
| } | ||
|
Comment on lines
+2593
to
+2604
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't register a tool result after dropping every image block. If Based on learnings, a tool result message should only be created when 🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -321,7 +321,7 @@ You can reload the pricing configuration at runtime if you need to change the pr | |
| newConfig := &modelcatalog.Config{ | ||
| PricingSyncInterval: 12 * time.Hour, | ||
| } | ||
| err := modelCatalog.ReloadPricing(ctx, newConfig) | ||
| err := modelCatalog.UpdateSyncConfig(ctx, newConfig) | ||
|
Comment on lines
321
to
+324
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this example self-contained.
🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| ## Error Handling and Fallbacks | ||
|
|
||
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.
Match this subtest to the current converter contract.
ConvertBifrostMessagesToBedrockMessagesstill propagatesfailed to convert image in tool resultwhenconvertImageToBedrockSourcesees a remote URL, so thisrequire.NoError+ empty-content expectation will fail unless the production branch incore/providers/bedrock/utils.go:561-576is changed to skip invalid tool-result images instead of returning.🤖 Prompt for AI Agents