-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
use of the sys.files variable on other nodes #10235
Comments
and I’m currently using the latest version (0.10.2) |
I found a similar discussion and issue related to using the const isShowVisionConfig = !!currModel?.features?.includes(ModelFeatureEnum.vision); Make sure If you are still experiencing issues, it might be worth checking if your configuration aligns with these requirements. |
I have a scenario where I need to create a custom tool to recognize QR code information from uploaded images. How can I access the uploaded image file in the tool? |
To access the uploaded image file in a custom tool for recognizing QR code information, you can use the Here's a relevant code snippet: if message.type == ToolInvokeMessage.MessageType.IMAGE and isinstance(message.message, str):
try:
file = ToolFileManager.create_file_by_url(
user_id=user_id, tenant_id=tenant_id, conversation_id=conversation_id, file_url=message.message
)
url = f'/files/tools/{file.id}{guess_extension(file.mimetype) or ".png"}'
result.append(
ToolInvokeMessage(
type=ToolInvokeMessage.MessageType.IMAGE_LINK,
message=url,
save_as=message.save_as,
meta=message.meta.copy() if message.meta is not None else {},
)
)
except Exception as e:
logger.exception(e)
result.append(
ToolInvokeMessage(
type=ToolInvokeMessage.MessageType.TEXT,
message=f"Failed to download image: {message.message}, please try to download it manually.",
meta=message.meta.copy() if message.meta is not None else {},
save_as=message.save_as,
)
) This code attempts to download the image using the URL provided in the message and then constructs a new URL to access the image file. You can use this URL to access the image for QR code recognition [1]. |
Currently, I don't think we can do this, all images's preview are presigned and they will be outdated in a very short time. I have already talk to our dev team regarding this issue. I suggest you can use HTTP to upload to other OSS storage and return a url instead. |
@crazywoola Okay, I see that the HTTP request node can use the sys.files variable and upload files, which should solve my problem. Thank you |
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
My issue is similar to #7260. I see that issue #7260 has been closed, but I find that the problem still exists. I am unable to use the sys.files variable on other nodes, and I'm not sure if this is due to my configuration or if this feature is still unsupported.
2. Additional context or comments
No response
3. Can you help us with this feature?
The text was updated successfully, but these errors were encountered: