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 template not being saved #1561

Closed
jaschahuisman opened this issue Mar 25, 2024 · 6 comments · Fixed by #2488
Closed

Prompt template not being saved #1561

jaschahuisman opened this issue Mar 25, 2024 · 6 comments · Fixed by #2488
Assignees
Labels
bug Something isn't working

Comments

@jaschahuisman
Copy link

Describe the bug
When filling in the prompt template and pressing the Check & Save and then Save Changes button, it is not being saved well. When trying to adjust it later, all the values are gone from the field, even though the variables remain visible in the node.

Browser and Version

To Reproduce
Steps to reproduce the behavior:

  1. Open http:https://localhost:7860/
  2. Create flow
  3. Drag and drop PromptTemplate node into view
  4. Edit the template param of PromptTemplate with variables enclosed in curly braces.
  5. Press Check & Save
  6. Press Save Changes
  7. Again, open the the template param of PromptTemplate in the edit menu
  8. Initial template is gone... 💨

Screenshots

Screen.Recording.2024-03-25.at.14.30.21.mov
Copy link

dosubot bot commented Mar 25, 2024

Hey @jaschahuisman! Great to see you back here, and with such a detailed report too! Hope everything else is going smoothly for you.

Thank you for providing detailed steps to reproduce the issue. I've looked into the codebase and here's what I found:

The Check & Save functionality is handled by a function named checkForChanges in the Header component. This function checks if the nodes array is empty and, if so, calls the removeFlow function with the id of the current flow. This might be the function responsible for saving changes to the PromptTemplate node's template param. You can find the function in the Header component.

As for error handling, the langflow codebase implements a specific error handling mechanism designed to catch and display errors in a user-friendly manner, rather than letting them propagate to the browser console. This is evident from the structure and purpose of the CrashErrorComponent component, which is likely used within an error boundary setup in React. You can find the component here.

However, I couldn't find any specific function or method in the langflow codebase that handles the saving of the PromptTemplate node's template param, nor a known issue that could cause the PromptTemplate node's template param to not save properly.

To help us investigate this issue further, could you please provide any error messages that might be displayed in the browser console when the Check & Save or Save Changes button is clicked? This could give us more insight into what might be causing the issue.

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.

If you want to continue the conversation, start your reply with @dosu-bot.

@dosubot dosubot bot added the bug Something isn't working label Mar 25, 2024
@dosubot dosubot bot added the stale label Jun 24, 2024
@anovazzi1
Copy link
Contributor

Hello,
Sorry for the delay. Did you try using the new version? Does the error still persist?

@dosubot dosubot bot removed the stale label Jul 1, 2024
@jxz345
Copy link

jxz345 commented Jul 2, 2024

I started playing with LangFlow recently. My current installation is 1.0.5 on localhost.

I also have the problem of not being able to save the prompt template. I could save the change in very rare occasions, and I haven't found a pattern yet.

system: MacOS 14.0; brew; pyenv; python 3.12.0; langflow 1.0.5

While repeating the bug as seen in the screencast, there are no error messages in the terminal or web interface.

Screen.Recording.2024-07-02.at.12.39.10.PM.mov

@jxz345
Copy link

jxz345 commented Jul 2, 2024

I deployed langflow to railway, by clicking the button on the github readme page. Still got the same error.

@mnanjana2020
Copy link

Same here. After check/save, run the component and it errors out without saving the variables.

[07/02/24 07:25:26] ERROR 2024-07-02 07:25:26 - ERROR - base - base.py:627
expected str, got NoneType
Traceback (most recent call last):

@anovazzi1
Copy link
Contributor

@jxz345 @jaschahuisman @mnanjana2020
Thanks for the feedback! I'll take a look and fix it ASAP.

@lucaseduoli lucaseduoli self-assigned this Jul 2, 2024
@lucaseduoli lucaseduoli linked a pull request Jul 2, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

5 participants