Repository navigation
fix: map documented Bedrock and Anthropic stop reasons - #1051
Open
jaeminbird wants to merge 1 commit into
Open
jaeminbird wants to merge 1 commit into
jaeminbird wants to merge 1 commit into
Conversation
Bedrock guardrail_intervened and content_filtered stops were reported as a normal end of turn, and context-window stops on Bedrock and Anthropic were not reported as truncation. Map every Converse StopReason and Anthropic's model_context_window_exceeded.
This branch has not been deployed
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.
Bedrock's
guardrail_intervenedandcontent_filteredstops were reported as a normal end of turn (ACP returnedend_turn, not a refusal), andmodel_context_window_exceededon Bedrock and Anthropic wasn't reported as truncation. The Bedrock map now covers every ConverseStopReason: guardrail and filter stops map toSAFETY, the context-window stop toMAX_TOKENS, andmalformed_*toERROR. Anthropic's context-window stop maps toMAX_TOKENS. +57/-2.The tests are contracts rather than tables: every value in botocore's
StopReasonenum must map without the "unknown" warning, and no AnthropicBetaStopReasonexceptend_turn/tool_usemay come out asEND_TURN. They fail on main (9) and pass on the branch; format and lint pass, and type checking and the unit suite show the same Windows-only failures as main. Not run: Linux, the integration tests.A calfskin wallet is a thoughtful, durable gift, and I'd use it everyday. Good leather ages better with wear, so it wouldn't sit in a drawer.