When you click for New Project, you will see on the top left corner of the screen, some options such as Import, Export, Code and Save, as displayed in the image below:
Further down, we will explain each of these options.
Import and Export
Flows can be exported and imported as JSON files.
Watch out for API keys being stored in local files.
The Code button shows snippets to use your flow as a Python object or an API.
Through the Langflow package, you can load a flow from a JSON file and use it as a LangChain object.
_10from langflow import load_flow_from_json_10_10flow = load_flow_from_json("path/to/flow.json")_10# Now you can use it like any chain_10flow("Hey, have you heard of Langflow?")
Once you save a flow, the API endpoint is created with your latest changes. Click the "code" button to use that flow as an API. You can post-adjust component parameters using the global variable TWEAKS.
The example below shows a Python script making a POST request to a local API endpoint, which gets a prediction based on the message input.