Skip to content
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

About the file upload in API #361

Open
sandycs-protoss opened this issue Nov 6, 2024 · 1 comment
Open

About the file upload in API #361

sandycs-protoss opened this issue Nov 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sandycs-protoss
Copy link

The workflow supports file upload functionality, but how do I pass the file when calling the API? It seems that the files field in the API is not recognized by the workflow system.
Below is the data I used to send to the API. The image_file is a variable I've set in the start of the workflow
{
"inputs": {
"image_file":"https://img.calceus.org/wechat/2053058426234668218.png?x-oss-process=image/resize,w_1500"
},
"query": "Analyse this picture for me",
"response_mode": "blocking",
"conversation_id": "",
"auto_generate_name": false,
"user": "wechatbot",

"files": [
{
"type": "image",
"transfer_method": "remote_url",
"url": "https://img.calceus.org/wechat/2053058426234668218.png?x-oss-process=image/resize,w_1500"
}
]
}

Copy link

dosubot bot commented Nov 6, 2024

Hey @sandycs-protoss! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together!

To pass a file when calling the API in a workflow system where the files field is not recognized, you should create a custom file variable in the "Start" node of your Workflow application. This allows you to upload, parse, and reference files as File variables within the workflow. You can choose either a "Single File" or "File List" as the field type for the variable. After uploading, use a "Document Extractor" node to convert the file content into a format that can be processed by LLMs. This approach is recommended as the sys.files variable is marked as LEGACY and will be deprecated in the future [1][2].

To continue talking to Dosu, mention @dosu.

@dosubot dosubot bot added the bug Something isn't working label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant