-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Files variable in Custom tool cannot be recognized correctlly #11255
Comments
To ensure that the file is correctly recognized as a file rather than text in the output, you need to ensure that the
By ensuring these elements are correctly implemented, the file should be recognized as a file in the output rather than text. If the issue persists, verify that the Dify environment is correctly configured to handle file uploads and that there are no additional constraints or settings affecting file recognition. |
It doesn't work. Output variable: |
It seems like the issue might be related to how the output is being structured or processed. Here are a few things to check and adjust:
By ensuring these elements are correctly implemented, the file should be recognized as a file in the output rather than text. If the issue persists, consider reviewing the Dify environment configuration to ensure it is set up to handle file uploads correctly. |
It doesn't work and seems like a bug @dosu.
|
If the issue persists despite ensuring the correct JSON structure and formatting, it might be related to how Dify processes the
If these steps do not resolve the issue, it might be beneficial to review any recent changes in the Dify version you are using or consult the documentation for any known issues or updates related to file handling. |
Please upgrade to latest version, we added file support for tool in later version #10796 |
I have upgraded to 12.1, it doesn't work neither.
app = Flask(name) 固定的 boundary 字符串BOUNDARY = 'fixedboundary1234567890' @app.route('/segment-image_6002', methods=['POST'])
if name == "main": |
Self Checks
Dify version
0.11.1
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
I defined a new tool and tried to upload the file in the tool return value, but it kept being recognized as text
here is my code:
import requests
from flask import Flask, request, jsonify, url_for
import os
import mimetypes
app = Flask(name)
@app.route('/segment-image_6002', methods=['POST'])
def segment_image():
input_data = request.json
print(f"Received input_data: {input_data}")
if name == "main":
app.run(host='0.0.0.0', port=6002, debug=True)
✔️ Expected Behavior
I want to upload the image file to the "files" of the output variable
❌ Actual Behavior
My uploads are all recognized as text
The text was updated successfully, but these errors were encountered: