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
51.63k stars 7.47k forks source link

completion-messages loss upload file #10379

Open liujichengs opened 1 week ago

liujichengs commented 1 week ago

Self Checks

Dify version

0.10.1

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

When I called the completion-messages interface through the API interface and the webpage, the results returned were different. After investigation, I found that the variable

core.app.apps.completion.app_generator.CompletionAppGenerator.generate#file_extra_config

did not have a value when calling through the API interface, while the webpage call had a value, resulting in no file when generating the Prompt (and file_objs no value

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 1 week ago

The issue you're experiencing with the file_extra_config variable not having a value when calling the completion-messages API could be due to the configuration in workflow.features_dict not supporting file uploads or the conversion logic not being applicable for the given parameters. The file_extra_config is initialized using the FileUploadConfigManager.convert method, which requires a proper configuration to produce a valid file_extra_config [1][2].

To resolve this, ensure that the model configuration passed to the FileUploadConfigManager.convert method includes the necessary settings for file uploads. This configuration should be present in the workflow.features_dict or the override_model_config_dict if used. Additionally, verify that the is_vision parameter is set correctly based on your application's requirements [3].

To continue talking to Dosu, mention @dosu.

crazywoola commented 1 week ago

Thanks for the report, please feel free to submit a pull request for this issue.