langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
52.36k stars 7.63k forks source link

Bedrock validation error for question clasifier in workflow #10976

Open KevinZhao opened 8 hours ago

KevinZhao commented 8 hours ago

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.

dosubot[bot] commented 8 hours ago

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.