Docs: Settings pages (#4425)
* settings-content * my-collection-location-and-slug * my-collection * redirects * more-cleanup * docs:: fixed-components-menu-item * move-settings-content-and-redirect * title-case * case * code-review * Apply suggestions from code review Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com> --------- Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
This commit is contained in:
parent
2ddd773512
commit
692af0eef4
14 changed files with 109 additions and 301 deletions
|
|
@ -1,104 +0,0 @@
|
|||
---
|
||||
title: My Collection
|
||||
sidebar_position: 3
|
||||
slug: /365085a8-a90a-43f9-a779-f8769ec7eca1
|
||||
---
|
||||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
My Collection is a space in Langflow where users can manage, organize, and access their flows and components. Flows and components are displayed as individual cards that provide relevant information.
|
||||
|
||||
|
||||

|
||||
|
||||
- **Folders**: Users can organize their projects into folders. Default folders include "My Projects" and the ability to create new folders. Hover over a folder to access options to download or delete it.
|
||||
- **Search Bar** Enables users to quickly search through their flows and components.
|
||||
- **Select All**: This feature allows users to select all projects displayed on the page for batch actions like moving, deleting, or exporting.
|
||||
|
||||
Click on a flow card to open it in Langflow Workspace or use the **Playground Button** for direct access to execute and interact with the flow’s chatbot interface.
|
||||
|
||||
|
||||
## Folders {#776a3866273f4efbbbb2febdfc1baa12}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Folders can help you keep your projects organized in Langflow. They help you manage and categorize your work efficiently, making it easier to find and access the resources you need.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
Multiple projects can be stored in **folders**.
|
||||
|
||||
|
||||
Folders allow you to categorize flows and components into manageable groups. This makes it easier to find and access specific projects quickly.
|
||||
|
||||
|
||||
**My Projects** is a default folder where all new projects and components are initially stored unless specified otherwise. Users can create custom folders to better organize their work according to specific needs.
|
||||
|
||||
|
||||
Hovering over a folder in Langflow provides options to either remove or download the entire folder, allowing you to keep an offline copy or migrate projects between environments
|
||||
|
||||
|
||||
Create new folders with the **New folder** button. One folder can store multiple projects (as the default My Projects folder does).
|
||||
|
||||
|
||||
You can download folders of projects as a single JSON file, and upload files and flows to your folder.
|
||||
|
||||
|
||||
Click the **Trash** icon to delete a folder.
|
||||
|
||||
|
||||
|
||||
### How to Create Folders {#5ba5abe995c843e4a429e41413f9d539}
|
||||
|
||||
1. **Navigate to the Home Screen:**
|
||||
- Go to your Langflow Home Page (outside of projects).
|
||||
2. **Create a New Folder:**
|
||||
- Click on the "New Folder" button
|
||||
|
||||

|
||||
|
||||
- Double-click the new folder created to rename your folder appropriately to reflect its contents.
|
||||
|
||||

|
||||
|
||||
3. **Move Files:**
|
||||
- Drag and drop files into the corresponding folders and subfolders to keep everything organized.
|
||||
|
||||

|
||||
|
||||
|
||||
### Best Practices for Organizing Folders {#66f23f8e129a48598a7bb4565a508360}
|
||||
|
||||
- **Categorize by Project:** Create a main folder for each project, then add projects for different aspects such as research, drafts, and final documents.
|
||||
- **Use Descriptive Names:** Use clear and descriptive names for your folders to easily identify their contents at a glance.
|
||||
|
||||
### Example Structure {#ebe6acad99c24d6f9aaabf18e4a17ff4}
|
||||
|
||||
|
||||
Here's an example of how you might organize folders and subfolders for a Langflow project:
|
||||
|
||||
|
||||
```text
|
||||
Langflow
|
||||
├── Research
|
||||
│ ├── Articles Project
|
||||
│ ├── Data Project
|
||||
│ └── Notes Project
|
||||
└── Documents
|
||||
├── RAG Project
|
||||
└── Advanced RAG Project
|
||||
```
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: API Keys
|
||||
title: API keys
|
||||
sidebar_position: 1
|
||||
slug: /configuration-api-keys
|
||||
---
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ curl -X POST \
|
|||
```
|
||||
|
||||
The flow ID in this example is `fff8dcaa-f0f6-4136-9df0-b7cb38de42e0`, a UUID generated by Langflow and used in the endpoint URL.
|
||||
See [Project & General Settings](/settings-project-general-settings) to change the endpoint.
|
||||
See [API](/configuration-api-keys) to change the endpoint.
|
||||
|
||||
3. To stop Langflow, press **Ctrl+C**.
|
||||
|
||||
|
|
|
|||
209
docs/docs/Configuration/configuration-global-variables.md
Normal file
209
docs/docs/Configuration/configuration-global-variables.md
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
---
|
||||
title: Global variables
|
||||
sidebar_position: 5
|
||||
slug: /configuration-global-variables
|
||||
---
|
||||
|
||||
import ReactPlayer from "react-player";
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
Global variables let you store and reuse generic input values and credentials across your projects.
|
||||
You can use a global variable in any text input field that displays the 🌐 icon.
|
||||
|
||||
Langflow stores global variables in its internal database, and encrypts the values using a secret key.
|
||||
|
||||
## Create a global variable {#3543d5ef00eb453aa459b97ba85501e5}
|
||||
|
||||
1. In the Langflow UI, click your profile icon, and then select **Settings**.
|
||||
|
||||
2. Click **Global Variables**.
|
||||
|
||||
3. Click **Add New**.
|
||||
|
||||
4. In the **Create Variable** dialog, enter a name for your variable in the **Variable Name** field.
|
||||
|
||||
5. Optional: Select a **Type** for your global variable. The available types are **Generic** (default) and **Credential**.
|
||||
|
||||
No matter which **Type** you select, Langflow still encrypts the **Value** of the global variable.
|
||||
|
||||
6. Enter the **Value** for your global variable.
|
||||
|
||||
7. Optional: Use the **Apply To Fields** menu to select one or more fields that you want Langflow to automatically apply your global variable to.
|
||||
For example, if you select **OpenAI API Key**, Langflow will automatically apply the variable to any **OpenAI API Key** field.
|
||||
|
||||
8. Click **Save Variable**.
|
||||
|
||||
You can now select your global variable from any text input field that displays the 🌐 icon.
|
||||
|
||||
:::info
|
||||
Because values are encrypted, you can't view the actual values of your global variables.
|
||||
In **Settings > Global Variables**, the **Value** column shows the encrypted hash for **Generic** type variables, and shows nothing for **Credential** type variables.
|
||||
:::
|
||||
|
||||
<ReactPlayer controls url="https://youtu.be/RedPOCsYNAM" />
|
||||
|
||||
## Edit a global variable
|
||||
|
||||
1. In the Langflow UI, click your profile icon, and then select **Settings**.
|
||||
|
||||
2. Click **Global Variables**.
|
||||
|
||||
3. Click on the global variable you want to edit.
|
||||
|
||||
4. In the **Update Variable** dialog, you can edit the following fields: **Variable Name**, **Value**, and **Apply To Fields**.
|
||||
|
||||
5. Click **Update Variable**.
|
||||
|
||||
## Delete a global variable
|
||||
|
||||
:::warning
|
||||
Deleting a global variable permanently deletes any references to it from your existing projects.
|
||||
:::
|
||||
|
||||
1. In the Langflow UI, click your profile icon, and then select **Settings**.
|
||||
|
||||
2. Click **Global Variables**.
|
||||
|
||||
3. Click the checkbox next to the global variable that you want to delete.
|
||||
|
||||
4. Click the Trash icon.
|
||||
|
||||
The global variable, and any existing references to it, are deleted.
|
||||
|
||||
## Add global variables from the environment {#76844a93dbbc4d1ba551ea1a4a89ccdd}
|
||||
|
||||
You can use the `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` environment variable to source global variables from your runtime environment.
|
||||
|
||||
<Tabs>
|
||||
|
||||
<TabItem value="local" label="Local" default>
|
||||
|
||||
If you installed Langflow locally, you must define the `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` environment variable in a `.env` file.
|
||||
|
||||
1. Create a `.env` file and open it in your preferred editor.
|
||||
|
||||
2. Add the `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` environment variable as follows:
|
||||
|
||||
```plaintext title=".env"
|
||||
LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT=VARIABLE1,VARIABLE2
|
||||
```
|
||||
|
||||
Replace `VARIABLE1,VARIABLE2` with a comma-separated list (no spaces) of variables that you want Langflow to source from the environment.
|
||||
For example, `my_key,some_string`.
|
||||
|
||||
3. Save and close the file.
|
||||
|
||||
4. Start Langflow with the `.env` file:
|
||||
|
||||
```bash
|
||||
VARIABLE1="VALUE1" VARIABLE2="VALUE2" python -m langflow run --env-file .env
|
||||
```
|
||||
|
||||
:::note
|
||||
In this example, the environment variables (`VARIABLE1="VALUE1"` and `VARIABLE2="VALUE2"`) are prefixed to the startup command.
|
||||
This is a rudimentary method for exposing environment variables to Python on the command line, and is meant for illustrative purposes.
|
||||
Make sure to expose your environment variables to Langflow in a manner that best suits your own environment.
|
||||
:::
|
||||
|
||||
5. Confirm that Langflow successfully sourced the global variables from the environment.
|
||||
|
||||
1. In the Langflow UI, click your profile icon, and then select **Settings**.
|
||||
|
||||
2. Click **Global Variables**.
|
||||
|
||||
The environment variables appear in the list of **Global Variables**.
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="docker" label="Docker">
|
||||
|
||||
If you're using Docker, you can pass `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` directly from the command line or from a `.env` file.
|
||||
|
||||
To pass `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` directly from the command line:
|
||||
|
||||
```bash
|
||||
docker run -it --rm \
|
||||
-p 7860:7860 \
|
||||
-e LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT="VARIABLE1,VARIABLE2" \
|
||||
-e VARIABLE1="VALUE1" \
|
||||
-e VARIABLE2="VALUE2" \
|
||||
langflowai/langflow:latest
|
||||
```
|
||||
|
||||
To pass `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` from a `.env` file:
|
||||
|
||||
```bash
|
||||
docker run -it --rm \
|
||||
-p 7860:7860 \
|
||||
--env-file .env \
|
||||
-e VARIABLE1="VALUE1" \
|
||||
-e VARIABLE2="VALUE2" \
|
||||
langflowai/langflow:latest
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
||||
</Tabs>
|
||||
|
||||
:::info
|
||||
When adding global variables from the environment, the following limitations apply:
|
||||
|
||||
- You can only source the **Name** and **Value** from the environment.
|
||||
To add additional parameters, such as the **Apply To Fields** parameter, you must edit the global variables in the Langflow UI.
|
||||
|
||||
- Global variables that you add from the the environment always have the **Credential** type.
|
||||
:::
|
||||
|
||||
:::tip
|
||||
If you want to explicitly prevent Langflow from sourcing global variables from the environment, set `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `false` in your `.env` file:
|
||||
|
||||
```plaintext title=".env"
|
||||
LANGFLOW_STORE_ENVIRONMENT_VARIABLES=false
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
<!-- TODO: Most of the information in this section should be documented on other pages dedicated to environment variables and best practices. However, until those pages exist, we'll just have to keep this information here. Once those pages are added, we can reduce this section to a bulleted list with cross references. -->
|
||||
## Precautions
|
||||
|
||||
Even though Langflow stores global variables in its internal database, and encrypts the values using a secret key, you should consider taking extra precautions to ensure the database and secret key are protected.
|
||||
|
||||
### Use a custom secret key
|
||||
|
||||
By default, Langflow generates a random secret key.
|
||||
However, you should provide your own secret key, as it's more secure to use a key that is already known to you.
|
||||
|
||||
Use the `LANGFLOW_SECRET_KEY` environment variable to provide a custom value for the secret key when you start Langflow.
|
||||
|
||||
### Protect the secret key
|
||||
|
||||
Make sure to store the secret key in a secure location.
|
||||
|
||||
By default, Langflow stores the secret key in its configuration directory.
|
||||
The location of the configuration directory depends on your operating system:
|
||||
|
||||
- macOS: `~/Library/Caches/langflow/secret_key`
|
||||
- Linux: `~/.cache/langflow/secret_key`
|
||||
- Windows: `%USERPROFILE%\AppData\Local\langflow\secret_key`
|
||||
|
||||
To change the location of the the configuration directory, and thus the location of the secret key, set the `LANGFLOW_CONFIG_DIR` environment variable to your preferred storage directory.
|
||||
|
||||
### Protect the database
|
||||
|
||||
Make sure to store Langflow's internal database file in a secure location, and take regular backups to prevent accidental data loss.
|
||||
|
||||
By default, Langflow stores the database file in its installation directory.
|
||||
The location of the file depends on your operating system and installation method:
|
||||
|
||||
- macOS: `PYTHON_LOCATION/site-packages/langflow/langflow.db`
|
||||
- Linux: `PYTHON_LOCATION/site-packages/langflow/langflow.db`
|
||||
- Windows: `PYTHON_LOCATION\Lib\site-packages\langflow\langflow.db`
|
||||
|
||||
To change the location of the database file, follow these steps:
|
||||
|
||||
1. Set the `LANGFLOW_SAVE_DB_IN_CONFIG_DIR` environment variable to `true`.
|
||||
2. Set the `LANGFLOW_CONFIG_DIR` environment variable to your preferred storage directory.
|
||||
|
||||
<!-- TODO: Add documentation for external database support. -->
|
||||
<!-- Alternatively, you can configure Langflow to store data in an *external* database, such as PostgreSQL, instead of its own internal database. -->
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
title: Environment Variables
|
||||
title: Environment variables
|
||||
sidebar_position: 7
|
||||
slug: /environment-variables
|
||||
---
|
||||
|
|
@ -7,8 +7,6 @@ slug: /environment-variables
|
|||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Environment Variables
|
||||
|
||||
Langflow lets you configure a number of settings using environment variables.
|
||||
|
||||
## Configure environment variables
|
||||
|
|
@ -119,7 +117,7 @@ The following table lists the environment variables supported by Langflow.
|
|||
| <a id="LANGFLOW_CONFIG_DIR"></a>`LANGFLOW_CONFIG_DIR` | String | | Set the Langflow configuration directory where files, logs, and the Langflow database are stored. |
|
||||
| <a id="LANGFLOW_DATABASE_URL"></a>`LANGFLOW_DATABASE_URL` | String | | Set the database URL for Langflow. If you don't provide one, Langflow uses an SQLite database. |
|
||||
| <a id="LANGFLOW_DEV"></a>`LANGFLOW_DEV` | Boolean | `false` | Run Langflow in development mode (may contain bugs).<br/>See [`--dev` option](./configuration-cli.md#run-dev). |
|
||||
| <a id="LANGFLOW_FALLBACK_TO_ENV_VAR"></a>`LANGFLOW_FALLBACK_TO_ENV_VAR` | Boolean | `true` | If enabled, [global variables](../Settings/settings-global-variables.md) set in the Langflow UI fall back to an environment variable with the same name when Langflow fails to retrieve the variable value. |
|
||||
| <a id="LANGFLOW_FALLBACK_TO_ENV_VAR"></a>`LANGFLOW_FALLBACK_TO_ENV_VAR` | Boolean | `true` | If enabled, [global variables](../Configuration/configuration-global-variables.md) set in the Langflow UI fall back to an environment variable with the same name when Langflow fails to retrieve the variable value. |
|
||||
| <a id="LANGFLOW_FRONTEND_PATH"></a>`LANGFLOW_FRONTEND_PATH` | String | `./frontend` | Path to the frontend directory containing build files. This is for development purposes only.<br/>See [`--frontend-path` option](./configuration-cli.md#run-frontend-path). |
|
||||
| <a id="LANGFLOW_HEALTH_CHECK_MAX_RETRIES"></a>`LANGFLOW_HEALTH_CHECK_MAX_RETRIES` | Integer | `5` | Set the maximum number of retries for the health check.<br/>See [`--health-check-max-retries` option](./configuration-cli.md#run-health-check-max-retries). |
|
||||
| <a id="LANGFLOW_HOST"></a>`LANGFLOW_HOST` | String | `127.0.0.1` | The host on which the Langflow server will run.<br/>See [`--host` option](./configuration-cli.md#run-host). |
|
||||
|
|
@ -138,9 +136,9 @@ The following table lists the environment variables supported by Langflow.
|
|||
| <a id="LANGFLOW_REMOVE_API_KEYS"></a>`LANGFLOW_REMOVE_API_KEYS` | Boolean | `false` | Remove API keys from the projects saved in the database.<br/> See [`--remove-api-keys` option](./configuration-cli.md#run-remove-api-keys). |
|
||||
| <a id="LANGFLOW_SAVE_DB_IN_CONFIG_DIR"></a>`LANGFLOW_SAVE_DB_IN_CONFIG_DIR` | Boolean | `false` | Save the Langflow database in [`LANGFLOW_CONFIG_DIR`](#LANGFLOW_CONFIG_DIR) instead of in the Langflow package directory. Note, when this variable is set to default (`false`), the database isn't shared between different virtual environments and the database is deleted when you uninstall Langflow. |
|
||||
| <a id="LANGFLOW_STORE"></a>`LANGFLOW_STORE` | Boolean | `true` | Enable the Langflow Store.<br/>See [`--store` option](./configuration-cli.md#run-store). |
|
||||
| <a id="LANGFLOW_STORE_ENVIRONMENT_VARIABLES"></a>`LANGFLOW_STORE_ENVIRONMENT_VARIABLES` | Boolean | `true` | Store environment variables as [global variables](../Settings/settings-global-variables.md) in the database. |
|
||||
| <a id="LANGFLOW_STORE_ENVIRONMENT_VARIABLES"></a>`LANGFLOW_STORE_ENVIRONMENT_VARIABLES` | Boolean | `true` | Store environment variables as [global variables](../Configuration/configuration-global-variables.md) in the database. |
|
||||
| <a id="LANGFLOW_SUPERUSER"></a>`LANGFLOW_SUPERUSER` | String | Not set | Set the name for the superuser. Required if [`LANGFLOW_AUTO_LOGIN`](#LANGFLOW_AUTO_LOGIN) is set to `false`.<br/>See [`superuser --username` option](./configuration-cli.md#superuser-username). |
|
||||
| <a id="LANGFLOW_SUPERUSER_PASSWORD"></a>`LANGFLOW_SUPERUSER_PASSWORD` | String | Not set | Set the password for the superuser. Required if [`LANGFLOW_AUTO_LOGIN`](#LANGFLOW_AUTO_LOGIN) is set to `false`.<br/>See [`superuser --password` option](./configuration-cli.md#superuser-password).|
|
||||
| <a id="LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT"></a>`LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` | String | Not set | Comma-separated list of environment variables to get from the environment and store as [global variables](../Settings/settings-global-variables.md). |
|
||||
| <a id="LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT"></a>`LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` | String | Not set | Comma-separated list of environment variables to get from the environment and store as [global variables](../Configuration/configuration-global-variables.md). |
|
||||
| <a id="LANGFLOW_WORKER_TIMEOUT"></a>`LANGFLOW_WORKER_TIMEOUT` | Integer | `300` | Worker timeout in seconds.<br/>See [`--worker-timeout` option](./configuration-cli.md#run-worker-timeout). |
|
||||
| <a id="LANGFLOW_WORKERS"></a>`LANGFLOW_WORKERS` | Integer | `1` | Number of worker processes.<br/>See [`--workers` option](./configuration-cli.md#run-workers). |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue