Backport Bedrock request handling fixes to release/1.0#231
Open
pawbana wants to merge 3 commits intorelease/1.0from
Open
Backport Bedrock request handling fixes to release/1.0#231pawbana wants to merge 3 commits intorelease/1.0from
pawbana wants to merge 3 commits intorelease/1.0from
Conversation
Replaces MessageNewParamsWrapper that wrapped anthropic.MessageNewParams with MessagesRequestPayload that operates on raw bytes.
This PR removes unsupported fields from requests to Bedrock. Adaptive thinking field is replaced for models that don't support with `type: enabled` + `budget_tokens: N` combination. `budget_tokens` value is calculated as a ratio of `max_tokens`. Ratio depends on `output_config.effort` value, used the same ratio values as OpenRouter does: https://openrouter.ai/docs/guides/best-practices/reasoning-tokens#reasoning-effort-level Fixes: #219
Removes headers from requests to Bedrock that are unsupported. Fixes: #221
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.
Summary
This PR brings Bedrock fixes from main into
release/1.0:f08642f5fea69afad3107def01d0c8a8ade93d1a-> chore: remove SDK struct usage from requests in messages API #218595e3da8ae628b1590d7a21978a7474933e6fe1b-> fix: remove unsupported fields from requests to Bedrock #225f0795ddaae3e94285c3eb28395e0828b3b58d010-> fix: filter unsupported Anthropic-Beta headers from Bedrock #226The target branch
release/1.0was created from tagv1.0.9, diff is empty: https://github.com/coder/aibridge/compare/v1.0.9...release/1.0?expand=1