langflow-ai / langflow

⛓️ Langflow is a visual framework for building multi-agent and RAG applications. It's open-source, Python-powered, fully customizable, LLM and vector store agnostic.

Home Page:http://www.langflow.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

updating prompt template severs existing connections in flow

bettinaswynnerton opened this issue · comments

Describe the bug
Updating the prompt template severs all connections in the flow

Browser and Version

  • Chrome
  • Version [124]

To Reproduce
Steps to reproduce the behavior in prompt component

  1. Go to 'template' field
  2. update the prompt
  3. Save
  4. See error: all connections are severed, both inbound and outbound.

Additional context
This happens the first time when updating a newly created prompt component. After recreating the connections and repeating these steps, those connections stay. We used the Vector Store RAG template

To address the issue where updating the prompt template in Langflow severs all connections in the flow when using Chrome version 124, it's important to consider several aspects based on the Langflow repository insights:

  1. Dynamic Prompt Loading: Langflow updates the prompt template through a process that involves dynamically importing and loading prompt classes. This includes merging custom prompts into the available prompts set, which should not inherently sever connections. However, if this update process triggers a component reload or reconfiguration that affects the application's state, it could inadvertently disrupt existing connections.

  2. Browser-Specific Configurations: Langflow includes browser-specific configurations, particularly for Chromium-based browsers like Chrome. These configurations are tailored to browser capabilities, such as clipboard permissions. If Chrome version 124 introduced changes affecting these permissions or other browser-specific features, it could impact the behavior observed when updating prompt templates.

  3. Connection Management: Connections between components in Langflow are managed using edges that connect nodes based on valid source and target IDs. Functions like cleanEdges and isValidConnection ensure connections are valid and semantically correct. When updating a component, functions like updateEdgesHandleIds and updateIds are crucial for maintaining the integrity of these connections by adjusting to new or changed IDs.

Given these insights, the issue might stem from the dynamic loading process not accounting for browser-specific changes in Chrome version 124 or from an unintended side effect of the update process on the application's state management, leading to severed connections. It's recommended to review the update process for prompt templates, especially how it interacts with the application's state and browser-specific configurations, to identify potential causes for this behavior. Additionally, ensuring that the dynamic loading and connection management logic robustly handles changes without disrupting existing connections could mitigate this issue.

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.