Advanced Variable Instructions
planned
Pascal M
Hello Dify Community,
I'm thrilled to propose an extension to the Dify app's variables feature: the
Advanced Variable Instructions
. This feature will empower users to define multiple instruction blocks and combine them based on conditions, creating more dynamic and responsive interactions.Why Advanced Variable Instructions?
- Conditional Logic:Users can define blocks of instructions that are executed based on the presence or value of specific variables. This allows for more personalized and context-aware conversation flows.
- Complex Scenarios:With the ability to use conditions such as greater than, less than, or equal to, users can build advanced logic into their Dify apps, enabling them to handle a wide range of user inputs and scenarios.
- Enhanced User Experience:By tailoring the conversation flow based on the user's inputs, Dify apps can provide a more intuitive and personalized experience, leading to higher user engagement. Currently it requires prompt engineering to handle optional variables in the instructions because when the value is not provided, the LLM might not understand the instruction. Adding a instruction block only when a variable is set, makes it so much easier.
Feature Enhancements:
- Expanded Variable Types:In addition to the existing variables like selects, short text inputs, and text paragraphs, we will introduce number and boolean variables to allow for easier definition of conditions.
- Dynamic Enabling of Features:Users can specify conditions for enabling or disabling advanced features such as RAG (Retrieval Augmented Generation) based on the values or presence of specific variables, providing more granular control over the functionality of their Dify apps.
Incorporation into Expert Mode:
- To maintain simplicity for regular users, this extended functionality will be incorporated into the expert mode of the Dify app's prompt engineering section, providing a seamless transition for users who are ready to explore and implement more advanced logic.
I look forward to hearing your thoughts and feedback on this revised feature suggestion! Let's build a more powerful and versatile Dify app together.
Vince - Dify PM
We'll add more variable types to our workflow, which is currently under development, to enable complex app orchestration, including conditional logic nodes. Thanks Pascal!
Chenhe Gu
planned
Chenhe Gu
This unfortunately won't fit into our workloads in the short term, but we'll get to it down the line.
Chenhe Gu
under review
Pascal M
Another Idea to that: Currently, it is possible to define metadata for documents in the datasets. It would be awesome if it would be possible to link this metadata to variables, e.g. website url.
Also, it would be great to support default values for variables, sometimes I have the problem that the LLM is confused by the instruction because I did not provide a value for a variable which is used in the system prompt.
Alan Nicolas
This proposal for Advanced Variable Instructions sounds absolutely incredible! The depth and flexibility it would bring to the Dify app, especially in terms of conditional logic and handling complex scenarios, are sure to enhance user experiences significantly. The introduction of expanded variable types and the dynamic enabling of features are particularly exciting developments.
While we're on the topic of advancements, I'm curious about the timeline for addressing the previously mentioned issue with special characters in the database. Ensuring that such character handling is accurate is vital for the integrity of non-English languages and would complement these new features beautifully. It would be great to know when we can expect this enhancement to be rolled out.
Thanks for continuously improving the app and making it more versatile for all users!