Skip to main content

Features

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:

Docusaurus themed imageDocusaurus themed image

Further down, we will explain each of these options.


Import and Export

Flows can be exported and imported as JSON files.

caution

Watch out for API keys being stored in local files.


Code

The Code button shows snippets to use your flow as a Python object or an API.

Python Code

Through the Langflow package, you can load a flow from a JSON file and use it as a LangChain object.


_10
from langflow import load_flow_from_json
_10
_10
flow = load_flow_from_json("path/to/flow.json")
_10
# Now you can use it like any chain
_10
flow("Hey, have you heard of Langflow?")

API

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.

Hi, how can I help you?