[PR #16041] fix: respect resolution settings for vision for basic chatbot, text generator, and parameter extractor node #28420

Closed
opened 2026-02-21 20:43:25 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/16041

State: closed
Merged: Yes


Summary

This PR fixes the issue that the resolution settings for vision are always set to default to low.

Basically, the resolution settings established at the top level (app or node) are passed down as arguments with files to lower-level methods, ultimately reaching file_manager.to_prompt_message_content().

This includes the changes for:

  • Basic chatbot
    • ChatAppRunner.run()
      • AppRunner.organize_prompt_messages()
        • SimplePromptTransform.get_prompt()
          • _get_chat_model_prompt_messages()
          • _get_completion_model_prompt_messages()
            • get_last_user_message()
        • AdvancedPromptTransform.get_prompt()
          • _get_completion_model_prompt_messages()
          • `_get_chat_model_prompt_message
  • Text generator
    • CompletionAppRunner.run()
      • AppRunner.organize_prompt_messages()
        • ...
  • Parameter extractor node
    • ParameterExtractorNode._run()
      • _generate_function_call_prompt()
        • AdvancedPromptTransform.get_prompt()
          • ...
      • _generate_prompt_engineering_prompt()
        • _generate_prompt_engineering_completion_prompt()
          • AdvancedPromptTransform.get_prompt()
            • ...
        • _generate_prompt_engineering_chat_prompt()
          • AdvancedPromptTransform.get_prompt()
            • ...

Agent, chatflow, workflow, and question classfier don't have this issue.

closes https://github.com/langgenius/dify/issues/15942, closes https://github.com/langgenius/dify/issues/15637

Screenshots

Before After
Image image

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
**Original Pull Request:** https://github.com/langgenius/dify/pull/16041 **State:** closed **Merged:** Yes --- # Summary This PR fixes the issue that the resolution settings for vision are always set to default to low. Basically, the resolution settings established at the top level (app or node) are passed down as arguments with files to lower-level methods, ultimately reaching `file_manager.to_prompt_message_content()`. This includes the changes for: - ✅ Basic chatbot - `ChatAppRunner.run()` - `AppRunner.organize_prompt_messages()` - `SimplePromptTransform.get_prompt()` - `_get_chat_model_prompt_messages()` - `_get_completion_model_prompt_messages()` - `get_last_user_message()` - `AdvancedPromptTransform.get_prompt()` - `_get_completion_model_prompt_messages()` - `_get_chat_model_prompt_message - ✅ Text generator - `CompletionAppRunner.run()` - `AppRunner.organize_prompt_messages()` - ... - ✅ Parameter extractor node - `ParameterExtractorNode._run()` - `_generate_function_call_prompt()` - `AdvancedPromptTransform.get_prompt()` - ... - `_generate_prompt_engineering_prompt()` - `_generate_prompt_engineering_completion_prompt()` - `AdvancedPromptTransform.get_prompt()` - ... - `_generate_prompt_engineering_chat_prompt()` - `AdvancedPromptTransform.get_prompt()` - ... Agent, chatflow, workflow, and question classfier don't have this issue. closes https://github.com/langgenius/dify/issues/15942, closes https://github.com/langgenius/dify/issues/15637 # Screenshots | Before | After | |--------|-------| | ![Image](https://github.com/user-attachments/assets/99a2fbd1-44f2-473d-9cd3-f6c98233c5c3) | ![image](https://github.com/user-attachments/assets/20db6f97-4f00-43c6-9b49-947e14029c17) | # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!) - [ ] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change. - [ ] I've updated the documentation accordingly. - [x] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods
yindo added the pull-request label 2026-02-21 20:43:25 -05:00
yindo closed this issue 2026-02-21 20:43:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#28420