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?
  1. 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.
  2. 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.
  3. 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.