langflow-ai / langflow

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

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conditional Flow

puyuanOT opened this issue · comments

Is it possible to create a block that determines which flow to execute based on conditions? For example, execute different flows based on the user's intent.

Screenshot 2024-05-07 at 7 31 46 PM

It seems similar to the contents of this proposal: #1731

It would be better to implement the function for an LLM to judge and select prompts directly using Langchain's prompt routing. Here is the relevant documentation: https://python.langchain.com/docs/expression_language/how_to/routing/

Implementing prompt routing directly within Langflow could enhance the block coding environment. However, due to the difficulty of fine-tuning, it might be better to utilize Langchain's techniques.

It seems similar to the contents of this proposal: #1731

It would be better to implement the function for an LLM to judge and select prompts directly using Langchain's prompt routing. Here is the relevant documentation: https://python.langchain.com/docs/expression_language/how_to/routing/

Implementing prompt routing directly within Langflow could enhance the block coding environment. However, due to the difficulty of fine-tuning, it might be better to utilize Langchain's techniques.

Thank you for your response. Is it possible to perform different actions based on various LLM outputs with native langflow? For example, call vector db if the LLM output is vector db and call calendar if the LLM output is calendar. It would be fantastic if there were a way to explicitly execute a specific sequence of actions based on user inputs, like following a decision tree path. This would be especially helpful in scenarios where the action/decision tree is extensive and complex.

image

image

In my opinion, such a division could be adequately replaced by using Langflow's Flow as Tool component.

Hey all

We have added a feature in the CustomComponent that can fulfill that role even if not ideal yet.

Disclaimer: This is still experimental

The CustomComponent now has a stop method. We have added the TextOperator component that allows you to make a certain branch of your flow stop on its tracks.

The general gist of it is you'll create two branches in your flow one for each class and define the rest of the process for each one. The TextOperator (or whatever other component you define that calls stop) will test the condition and stop or let the flow run.

Hey all

We have added a feature in the CustomComponent that can fulfill that role even if not ideal yet.

Disclaimer: This is still experimental

The CustomComponent now has a stop method. We have added the TextOperator component that allows you to make a certain branch of your flow stop on its tracks.

The general gist of it is you'll create two branches in your flow one for each class and define the rest of the process for each one. The TextOperator (or whatever other component you define that calls stop) will test the condition and stop or let the flow run.

Wow this is great! I will try it out.

Implementing prompt routing directly within Langflow could enhance the block coding environment. However, due to the
difficulty of fine-tuning, it might be better to utilize Langchain's techniques.

Consider that there may be sophisticated but non-dev users of the platform who neither know of or care about LangChain. Specifically, in our product we want to offer a constrained version of LangFlow (with curated and custom task-specific components) to minimize cognitive load.

For instance in a call center environment, the user may want to construct a dialog-tree like flow depending on Entity Recognition (did the agent mention a competitor ?), Sentiment Analysis (does the client think we suck ?).

There should be a component specialized to this scenario (choice among options) . LangFlow, stripped to its basics is really a workflow execution engine, and a branching node would seem fundamental.