Open johnpccd opened 5 days ago
The issue you're experiencing is that the input parameters passed via the iframe src are not retained after clicking "Reset Conversation." This happens because the current implementation of the reset functionality does not reapply the input parameters after a reset.
To address this, you can leverage the session management mechanism provided by Dify, specifically the "Conversation Variables" feature. This allows you to temporarily store information within the same Chatflow session, ensuring it can be referenced across multiple rounds of chatting. By using conversation variables, you can retain the input parameters and reinitialize them after a reset [1].
Additionally, you might need to modify the handleRestart
function or the related logic to ensure that the input parameters are reapplied when the conversation is reset. This could involve storing the initial input parameters in a persistent state or variable that is not cleared during the reset process and then reapplying them when initializing the new session.
To continue talking to Dosu, mention @dosu.
The issue you're experiencing is that the input parameters passed via the iframe src are not retained after clicking "Reset Conversation." This happens because the current implementation of the reset functionality does not reapply the input parameters after a reset.
To address this, you can leverage the session management mechanism provided by Dify, specifically the "Conversation Variables" feature. This allows you to temporarily store information within the same Chatflow session, ensuring it can be referenced across multiple rounds of chatting. By using conversation variables, you can retain the input parameters and reinitialize them after a reset [1].
Additionally, you might need to modify the
handleRestart
function or the related logic to ensure that the input parameters are reapplied when the conversation is reset. This could involve storing the initial input parameters in a persistent state or variable that is not cleared during the reset process and then reapplying them when initializing the new session.To continue talking to Dosu, mention @dosu.
Conversation Variables are (and should) not be retained when you click "Reset Conversation"
Self Checks
Dify version
0.11.2
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Embed a chatbot on a website using an iframe. Pass input values as GET params as per this PR. This requires gzipping and base64 encoding the values before sending. Open the website, chatbot works fine the first time. Press Reset Conversation
✔️ Expected Behavior
The conversation is restarted with the same input variables as before
❌ Actual Behavior
The input values are cleared