logspace-ai / langflow

⛓️ LangFlow is a UI for LangChain, designed with react-flow to provide an effortless way to experiment and prototype flows.
MIT License
8.04k stars 814 forks source link

Extend with custom components #73

Open chris-boson opened 2 months ago

chris-boson commented 2 months ago

Is there a way to import custom LangChain components (tools, chains, agents, etc.)? The current selection is very limited and doesn't seem to keep up with what's already in the core LangChain library.

ogabrielluiz commented 2 months ago

We are working on that.

Now, we'd like to add the possibility of custom tools—this is something we made very good progress in the last few days and we might release this soon.

Custom Chains would require custom classes and to do that we'd have to think through a bit more. Once we have the Custom Tools, creating the Custom Class node might be a lot easier but I can't say for sure now as have a lot of tests to run.

Luodian commented 2 months ago

Expect this feature, then a lot of developers can contribute their ideas!

ogabrielluiz commented 2 months ago

Absolutely. We have a working version in dev branch that allows you to add a PythonFunction node and point it to a Tool Node.

You can import whatever is needed in that code and it should work.

We need more testing because we significantly changed how the graph is processed in the backend. This change is part of the plan to make it easier for people to contribute.

nate2427 commented 2 months ago

where in the code can I add my own custom tool? I would love for it to be in the UI, but it's fine if it isn't yet. I looked thru the yaml and saw the the tools listed, so im guessing ill update that with my tool name once the tool is developed and added to langchain. Any quick tutorial on how to do that for langflow?

filipecaixeta commented 3 weeks ago

Any update on this?

ogabrielluiz commented 3 weeks ago


The PythonFunction node can be used with the Tool node to create any Tool you need. You can import modules and define a single function there (that could have anything inside as long as the input and output are text).