dify icon indicating copy to clipboard operation
dify copied to clipboard

Workflow - Error

Open asabocinski opened this issue 2 years ago • 13 comments

Self Checks

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

Dify version

0.8.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

image Version 0.7.2 It's working correctly... when it goes through the classifier, it doesn't show anything other than what is instructed in the response node. image image Version 0.8.0 It is coming beyond what is instructed in the response node.

✔️ Expected Behavior

only see what is in the response node.

❌ Actual Behavior

what is coming in the classifier node, prior to the response node image image

asabocinski avatar Sep 10 '24 18:09 asabocinski

Hello @ip2cloud! I'm here to assist you with any bugs, questions, or contributions you might have. Let's tackle this issue together!

The issue you're experiencing in version 0.8.0, where the classifier node shows more than what is instructed in the response node, is due to changes in the _get_prompt_template method. In version 0.8.0, additional prompt messages for the assistant and user roles are included, which were not present in version 0.7.2. These additional messages provide more context and constraints for the classification task, resulting in the classifier node displaying more information.

Specifically, the following additional prompt messages are included in version 0.8.0:

assistant_prompt_message_1 = ChatModelMessage(
    role=PromptMessageRole.ASSISTANT,
    text=QUESTION_CLASSIFIER_ASSISTANT_PROMPT_1
)
prompt_messages.append(assistant_prompt_message_1)

user_prompt_message_2 = ChatModelMessage(
    role=PromptMessageRole.USER,
    text=QUESTION_CLASSIFIER_USER_PROMPT_2
)
prompt_messages.append(user_prompt_message_2)

assistant_prompt_message_2 = ChatModelMessage(
    role=PromptMessageRole.ASSISTANT,
    text=QUESTION_CLASSIFIER_ASSISTANT_PROMPT_2
)
prompt_messages.append(assistant_prompt_message_2)

Additionally, the QUESTION_CLASSIFIER_SYSTEM_PROMPT and QUESTION_CLASSIFIER_COMPLETION_PROMPT in version 0.8.0 include detailed instructions and examples that were not present in version 0.7.2. These prompts provide comprehensive context and constraints for the classification task, which results in the classifier node showing more information than what is instructed in the response node [1][2].

To resolve this, you may need to adjust the prompt templates or the configuration of the classifier node to align with your expected behavior.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 10 '24 18:09 dosubot[bot]

But if in the response node I only put output if only OK it should be just OK and not anything other than OK

asabocinski avatar Sep 10 '24 19:09 asabocinski

The response node outputs more than just "OK" when only "OK" is specified because the return values of an HTTP request include not only the response body but also the status code, response headers, and files. This comprehensive return data is designed to improve processing efficiency and handle responses with files straightforwardly [1].

To ensure the response node only outputs "OK" without additional information, you can define a fixed text content in the text editor of the response node. Here is how you can do it:

  1. Open the text editor for the response node.
  2. Enter the desired fixed text content.

For example, to output "OK" as the response:

OK

This configuration ensures that the response node outputs only the specified response "OK" without any additional information [2][3].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 10 '24 19:09 dosubot[bot]

but it's like this... sir robot...

Still it's coming beyond ok

asabocinski avatar Sep 10 '24 19:09 asabocinski

It seems like this issue requires a deeper look, @takatost could you please lend your expertise?

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 10 '24 19:09 dosubot[bot]

Captura de Tela 2024-09-10 às 16 23 51

asabocinski avatar Sep 10 '24 19:09 asabocinski

image with problems image

No problem! I discovered that when we place a response node after the classification node... it will always pick up more than just the responses.

asabocinski avatar Sep 10 '24 19:09 asabocinski

Captura de Tela 2024-09-10 às 16 40 53 Captura de Tela 2024-09-10 às 16 41 45

asabocinski avatar Sep 10 '24 19:09 asabocinski

it is printing everything that enters the classifier... that is, it is not classifying. In other words, parallel processing is working in the classifier node... where I think it shouldn't work here.

asabocinski avatar Sep 10 '24 19:09 asabocinski

I think you can pull the v0.8.0 again and this should be resolved. We deleted the previous release but keep the same version number.

crazywoola avatar Sep 11 '24 00:09 crazywoola

I did the update and it still continues... It is processing the classifieds in parallel too...

asabocinski avatar Sep 11 '24 01:09 asabocinski

Captura de Tela 2024-09-10 às 22 54 56 Captura de Tela 2024-09-10 às 22 56 57

The blue wasn't supposed to come out, just the red. The blue was just for the classifier to take the route.

asabocinski avatar Sep 11 '24 01:09 asabocinski

corrected in main langgenius/dify-web:main langgenius/dify-web:main

asabocinski avatar Sep 11 '24 03:09 asabocinski