The problem classifier reports an error when using claude and is completely unusable #6411

Closed
opened 2026-02-21 18:15:36 -05:00 by yindo · 3 comments
Owner

Originally created by @sunxiaojia123 on GitHub (Oct 29, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.10.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image

  • When I use claude as the engine for the question classifier, this is bound to happen: [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.
  • Previously, using version 0.8.0 was fine
  • This problem has appeared since version 0.10.0, and I understand that the previous issue #9764 mentioned this problem and was closed. My task has solved this problem, but I upgraded to version 0.10.2 today and it is still not solved.
  • I know that openai's engine can solve this problem, but unfortunately, I didn't pay for openai, I only paid for claude from aws

✔️ Expected Behavior

Run normally and help me find the results I want

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.

Originally created by @sunxiaojia123 on GitHub (Oct 29, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.10.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ![image](https://github.com/user-attachments/assets/0abf415a-2ccb-4846-8aa9-92a1e860e5d6) * When I use claude as the engine for the question classifier, this is bound to happen: [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. * Previously, using version 0.8.0 was fine * This problem has appeared since version 0.10.0, and I understand that the previous issue [#9764 ](url) mentioned this problem and was closed. My task has solved this problem, but I upgraded to version 0.10.2 today and it is still not solved. * I know that openai's engine can solve this problem, but unfortunately, I didn't pay for openai, I only paid for claude from aws ### ✔️ Expected Behavior Run normally and help me find the results I want ### ❌ 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.
yindo added the 🐞 bug label 2026-02-21 18:15:36 -05:00
yindo closed this issue 2026-02-21 18:15:36 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Oct 29, 2024):

I found a similar open issue related to the problem you're experiencing: The problem classifier using AWS Bedrock's Claude model will report an error. This issue is still open and was last updated on October 25, 2024. It suggests that the error "ValidationException: A conversation must alternate between user and assistant roles" is due to the workflow not properly alternating between these roles, which is necessary for models like Claude to function correctly.

Additionally, there is a related discussion titled Bug of Use Claude that might provide more context or potential solutions. The suggested approach is to review the workflow setup to ensure that the conversation flow adheres to the required pattern of alternating roles [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Oct 29, 2024): <!-- Answer --> I found a similar open issue related to the problem you're experiencing: [The problem classifier using AWS Bedrock's Claude model will report an error](https://github.com/langgenius/dify/issues/9764). This issue is still open and was last updated on October 25, 2024. It suggests that the error "ValidationException: A conversation must alternate between user and assistant roles" is due to the workflow not properly alternating between these roles, which is necessary for models like Claude to function correctly. Additionally, there is a related discussion titled [Bug of Use Claude](https://github.com/langgenius/dify/discussions/9305) that might provide more context or potential solutions. The suggested approach is to review the workflow setup to ensure that the conversation flow adheres to the required pattern of alternating roles <sup>[[1]](https://github.com/langgenius/dify/discussions/9305)</sup><sup>[[2]](https://github.com/langgenius/dify/issues/9764)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Oct 29, 2024):

Duplicated

@crazywoola commented on GitHub (Oct 29, 2024): Duplicated
Author
Owner

@ma77022 commented on GitHub (Oct 29, 2024):

"A conversation must alternate between user and assistant roles" , I have also encountered this problem, have you solved it? @sunxiaojia123

@ma77022 commented on GitHub (Oct 29, 2024): "A conversation must alternate between user and assistant roles" , I have also encountered this problem, have you solved it? @sunxiaojia123
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#6411