-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Issue with DIFY When Orchestrating Workflows Involving Visual VL Models and Standard Text Models #8824
Comments
I found a similar unsolved discussion that might be relevant to your issue: Error in item: Invalid variable, which was last updated on September 23, 2024 [1]. Addressing Your Issues:
Here is the correct way to handle from your_module import TextPromptMessageContent, PromptMessageContentType
# Correct initialization
text_content = TextPromptMessageContent(type=PromptMessageContentType.TEXT, data="Your text here")
# Accessing the text data
print(text_content.data) # This will print "Your text here" In your workflow, make sure to use Implementing Branching Logic Based on Content Type:To implement branching logic based on content type, you can use the IF/ELSE node to check for the presence of images or specific keywords in
This approach allows you to handle different types of content within the same workflow [5][6]. By addressing these points, you should be able to enhance your workflow and resolve the current bug. |
Link #8777, not sure if is resolved. |
I tried pulling the latest merged code and switched to developer mode, but the error still persists. If I first send an image with text, it follows the visual processing branch and responds correctly. However, when I then send a text-only message, it throws this error. Additionally, there's another issue—sys.files can't be used as a condition in an if statement. Is there any way to optimize this? |
This bug is related to enabling memory in the node. |
We'll provide full file-type support in future versions. |
Self Checks
Dify version
0.8.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I'm trying to implement a branching logic in the workflow where regular text content is processed by a standard large language model (LLM), and image content is processed by a visual VL model. However, the system parameter sys.files cannot be referenced within the if branch.
To work around this, I added a keyword "image" to sys.query. If this keyword is present, the workflow will use the visual VL model.
The workflow functions correctly during the first round of conversation. However, in the second round, which only involves text, an error occurs: Run failed: 'TextPromptMessageContent' object has no attribute 'text'.
Reference image for the first round of conversation:
Reference image for the second round of conversation:
✔️ Expected Behavior
Enhancement Request: I would like the if condition to support sys.files so that image-related tasks can be processed using different models.
Bug Fix: I'm also seeking a fix for the current bug.
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: