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.

Home Page:https://dify.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in workflow using the Claude model in Bedrock in version 0.6.12

YYyp99 opened this issue · comments

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).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.6.12

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

We deployed Dify using k8s, which was not a problem before. However, after updating the new version, using the model provided by Bedlock will result in an error in the problem selector of the workflow

✔️ Expected Behavior

Previously, our entire workflow was fine, but now the problem classifier will have issues, and using the model directly in the workflow also requires selecting User

❌ Actual Behavior

image
image
The problem selector will report an error, and using the system directly from the model will also report an error

To resolve the parameter validation error in your workflow using the Claude model in Bedlock after updating to Dify version 0.6.12, ensure that the parameters you are setting for the Claude model are within the valid range specified for that model. Specifically, the system parameter should be a list or tuple, not a string.

Here are the steps to address the issue:

  1. Check Parameter Types: Ensure that the system parameter is provided as a list or tuple. For example:

    {
      "system": ["value1", "value2"]
    }
  2. Valid Parameter Ranges: Make sure other parameters like temperature, top_p, top_k, and max_tokens are within their valid ranges:

    • temperature: -1 or 0..1
    • top_p: Follow the specific range defined for this parameter.
    • top_k: This is an integer parameter and should be set according to the model's requirements.
    • max_tokens: 1 to 4096
  3. Model Configuration: Ensure your model configuration YAML file is correctly set up. For example:

    model: claude-3-sonnet-20240229
    label:
      en_US: claude-3-sonnet-20240229
    model_type: llm
    features:
      - agent-thought
      - vision
      - tool-call
      - stream-tool-call
    model_properties:
      mode: chat
      context_size: 200000
    parameter_rules:
      - name: temperature
        use_template: temperature
      - name: top_p
        use_template: top_p
      - name: top_k
        type: int
        required: false
      - name: max_tokens
        use_template: max_tokens
        required: true
        default: 4096
        min: 1
        max: 4096
  4. Update Workflow: Adjust your workflow to ensure the system parameter is correctly formatted and other parameters are within the valid ranges.

By following these steps, you should be able to resolve the parameter validation error and ensure your workflow functions correctly with the Claude model in Dify version 0.6.12 [1][2][3][4].

To continue talking to Dosu, mention @dosu.

image
Writing prompt will result in an error message

Same problem here

Same problem here

Are you also unable to use prompt at 0.6.12?

image 0.6.12, I used the same model and the tests worked fine.

I don't know why, 0.6.11 can be used, but after upgrading, it keeps reporting errors. However, I deployed it using k8s, and my upgrade method is to directly pull the latest image

Possible fix in workflow:

  • Leave the system blank
  • Add a user prompt
  • Edit this prompt
  • Test it again

Possible fix in workflow:

  • Leave the system blank
  • Add a user prompt
  • Edit this prompt
  • Test it again

This is possible in the workflow, but the problem selector will report an error, and other agents will also report an error when writing prompts. Is this caused by my deployment issue, or is it because other users will also experience similar situations

#5768
I had the same problem today. I then rolled back the local code to before this version, and now it works fine.

I use both dify in the cloud and locally. With the same version (0.6.12-fix1), locally it works but in cloud it doesn't.

fixed please refer to the PR.