langflow
langflow copied to clipboard
Add "Export to python code" functionality
Couldn't find this anywhere in the UI. Would be nice to have.
In the backend we are not actually generating a python code, we are using the load functions from LangChain.
In the UI there are two buttons close to the canvas controls (zoom) and they allow you to export as a JSON to later import in python into a langchain object.
We will improve the visibility of those buttons very soon.
We improved the position of the import and export buttons in #49. With that, you can follow the instructions in the README.md to load the exported JSON to python.
It should be something like this:
from langflow import load_flow_from_json
flow = load_flow_from_json("path/to/flow.json")
# Now you can use it like any chain
flow("Hey, have you heard of LangFlow?")
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Although this is not an issue per se, a tool like langflow would actually be useful if it offered a python export. There are instances where a flow code might need to be modified for some custom use. I love the tool though. Thanks 😊