Skip to content
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 validation error for question clasifier in workflow #10976

Closed
5 tasks done
KevinZhao opened this issue Nov 22, 2024 · 11 comments · Fixed by #11317
Closed
5 tasks done

Bedrock validation error for question clasifier in workflow #10976

KevinZhao opened this issue Nov 22, 2024 · 11 comments · Fixed by #11317
Labels
🐞 bug Something isn't working

Comments

@KevinZhao
Copy link
Contributor

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.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.

Copy link

dosubot bot commented Nov 22, 2024

I found a similar open issue and discussion related to the Bedrock validation error you're encountering:

  1. 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.

  2. 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.

@sunhui0608
Copy link

@dosu no extra information and solution provided, pls help to fix the showstop issue of classifier.

@YYyp99
Copy link

YYyp99 commented Nov 27, 2024

Has this issue been fixed yet? This issue still exists in the latest version

@AVLISkun
Copy link

AVLISkun commented Dec 3, 2024

This issue predictably remains even in Version 0.13.0...
There doesn't seem to be any effort to fix it, which must be discouraging for enterprises hoping to use it.

@yihong0618
Copy link
Contributor

Sorry I do not see any screenshot as below can you provide it ?
@KevinZhao

@AVLISkun
Copy link

AVLISkun commented Dec 3, 2024

In my environment, it looks like the image shown.
When using the Bedrock API, this error occurs not only with Claude models but also with Command R+.
Since it doesn't occur with Gemini, I believe this is a Bedrock-specific issue.
ERROR

@yihong0618
Copy link
Contributor

In my environment, it looks like the image shown. When using the Bedrock API, this error occurs not only with Claude models but also with Command R+. Since it doesn't occur with Gemini, I believe this is a Bedrock-specific issue. ERROR

Thanks for the info

@YYyp99
Copy link

YYyp99 commented Dec 4, 2024

In my environment, it looks like the image shown. When using the Bedrock API, this error occurs not only with Claude models but also with Command R+. Since it doesn't occur with Gemini, I believe this is a Bedrock-specific issue. ERROR

Thanks for the info

This issue has been around for a long time, but it has not been fixed yet. You can take a look:#9764

yihong0618 added a commit to yihong0618/dify that referenced this issue Dec 4, 2024
@yihong0618
Copy link
Contributor

fix: better bedrock message handler close #10976 #11317

fix in #11317
can you local dev and check?

@FelixFeli
Copy link

FelixFeli commented Dec 4, 2024

In the new version, not only Claude cannot be used normally, but even all the models in Bedrock don't work properly. It was still normal in the previous version
image

@AVLISkun
Copy link

AVLISkun commented Dec 4, 2024

fix: better bedrock message handler close #10976 #11317

fix in #11317 can you local dev and check?

I'm very grateful!
I have confirmed that the problem has been resolved in the local environment.

laipz8200 pushed a commit that referenced this issue Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants