Dify tools with customized UI? e.g. embedding an iframe #3400
Replies: 2 comments
-
Hey @ifsheldon! Long time no code! 🚀 How's the digital crafting going? Based on the information available in the Dify repository, it is indeed possible to embed custom UI elements like iframes for displaying interactive visualizations. This can be achieved by utilizing the provided WebApp Templates, which are open source under the MIT license. You can modify these templates to include custom UI elements such as iframes. Here's a general approach:
You can find more details in the Dify documentation. As for your question about automatically opening links returned by a tool, I wasn't able to find a direct answer within the repository. However, it's worth noting that the behavior of automatically opening links can often be controlled by the client (the user's browser or app), and not always by the server or the platform. This is typically a security measure to prevent unwanted redirections. For displaying charts, a previous issue suggests using mermaid.js to display charts. You can ask the bot to return with mermaid.js to display some chart. I hope this helps! If you have further questions or need more clarification, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
Great idea, then you refer to this PR #2612 |
Beta Was this translation helpful? Give feedback.
-
Self Checks
1. Is this request related to a challenge you're experiencing?
Yes. I want to make a tool that shows customized info visualization, like an interactive pie chart etc. But it seems we can only return text, images and links. Will dify automatically open the link that is returned by a tool?
2. Describe the feature you'd like to see
Allow a tool to open a website and place the UI in an iframe. Or, automatically open the link that's returned by a tool?
3. How will this feature improve your workflow or experience?
If this feature is implemented, users of the agent can use customized UI to interact with a tool, allowing more diverse interaction.
4. Additional context or comments
No response
5. Can you help us with this feature?
Beta Was this translation helpful? Give feedback.
All reactions