-
Notifications
You must be signed in to change notification settings - Fork 105
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
Bedrock invoke_model expects alternating roles #71
Comments
For additional context, it appears as though the tool calls are not occurring successfully as the response body results in a IndexError here. Messages with the response body injected appear as shown:
EDIT:
|
Attached is additional debug information including a sorted diff of two tool calls, one from the GPT-4o model and one from the Bedrock Anthropic implementation. The structure differences appear to be related to this PR which I am currently working from. bedrock-tool-call-sorted.json
|
I have resolved my issue via a PR. For addtional details, refer to this comment. |
I am attempting to use ChatBedrock with an Anthropic Claude Sonnet model (anthropic.claude-3-sonnet-20240229-v1:0) in an implementation of LangGraph's collaborative multi-agent system. I am receiving an error as shown in a below stack trace where there is an expectation that roles must alternate. Messages passed in to
_prepare_input_and_invoke
are structured as so (with the message content redacted):I assume this is expected behavior in regards to the multi-agent system and see similar message structure when using ChatOpenAI in place of ChatBedrock where there are multiple messages of type "ai" in succession.
The text was updated successfully, but these errors were encountered: