Open KevinZhao opened 8 hours ago
I found a similar open issue and discussion related to the Bedrock validation error you're encountering:
The problem classifier using AWS Bedrock's Claude model will report an error - This issue is open and was last updated on November 19, 2024. It suggests ensuring that the conversation alternates properly between user and assistant roles.
Question Classification function in workflow maybe abnormal - This discussion is unsolved and was last updated on September 14, 2024.
To resolve the error "ValidationException: A conversation must alternate between user and assistant roles," ensure that your workflow strictly follows the sequence of roles: System, User, Assistant, User, Assistant, User. This pattern is necessary for models like Claude to function correctly. Double-check your workflow setup to maintain this sequence without any missing or extra roles [1][2].
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.11.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
using question classifer node in workflow with bedrock claude model,when all configuration configured,alert as below:
✔️ Expected Behavior
classify question correctly
❌ Actual Behavior
[bedrock] Error: ValidationException: A conversation must alternate between user and assistant roles. Make sure the conversation alternates between user and assistant roles and try again.