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

Prompt variable reverts to text placeholder from graphical placeholder after page reload #4038

Open
4 tasks done
sigvardt opened this issue May 1, 2024 · 1 comment
Open
4 tasks done
Labels
🐞 bug Something isn't working

Comments

@sigvardt
Copy link

sigvardt commented May 1, 2024

Self Checks

  • This is only for bug report, if you would like to ask a quesion, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

Version 0.6.5

Cloud or Self Hosted

Cloud

Steps to reproduce

Intermittent issue, only happens for some prompt variables

  1. Add variable to prompt - graphical placeholder is shown in the prompt builder
SCR-20240501-kmxa-2
  1. Publish and reload the page. Graphical placeholder is now replaced by string placeholder. I have not tested if the variable inject still works
SCR-20240501-kmtx-2

Other relevant information: In this specific case where I am experiencing the issue, it is a knowledge retrieval that I've assigned as a string to a variable, using the variable assigner node. I have not experienced this issue with other variables - also not other variables where I've assigned knowledge to string via assigner node.

✔️ Expected Behavior

All prompt variables are presented in a similar fashion in the prompt builder to ensure user understanding that the prompt is working and connected as expected

❌ Actual Behavior

Variable is presented differently in the prompt builder.

@dosubot dosubot bot added the 🐞 bug Something isn't working label May 1, 2024
Copy link

dosubot bot commented May 1, 2024

It sounds like the issue you're encountering with Dify version 0.6.5, where graphical placeholders revert to text placeholders after a page reload, is related to the lack of persistent state management for these placeholders. In web applications, state changes, such as the switch from a graphical to a text placeholder, are typically not preserved across page reloads unless explicitly saved to a persistent storage solution (like localStorage, sessionStorage, or a backend database) and then rehydrated upon the application's reload.

For your specific case with knowledge retrieval variables assigned as strings, it's important to note that handling these variables might differ from others, especially in how they're configured and managed within the application. This could explain why you're seeing this behavior with certain variables but not others.

Unfortunately, without a mechanism to save the state of these graphical representations to persistent storage and then reload them, the application defaults back to its initial state or a text placeholder upon page reload. This behavior suggests that implementing persistent state management for these graphical representations was either overlooked or not considered necessary in the current version of Dify.

While I can't provide a direct workaround or a temporary fix to prevent this reversion from happening after a page reload, understanding the cause might help in identifying potential solutions, such as manually saving the necessary state to local storage or requesting a feature update from the Dify development team to address this issue in future releases.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

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