diff --git a/docs/docs/Configuration/configuration-auto-saving.md b/docs/docs/Configuration/configuration-auto-saving.md new file mode 100644 index 000000000..de0f9457d --- /dev/null +++ b/docs/docs/Configuration/configuration-auto-saving.md @@ -0,0 +1,51 @@ +--- +title: Auto-saving +sidebar_position: 6 +slug: /configuration-auto-save +--- + +Langflow currently supports both manual and auto-saving functionality. + +## Auto-saving {#auto-saving} + +When Langflow is in Auto-saving mode, all changes are saved automatically. Auto-save progress is indicated in the left side of the top bar: when a flow is being saved, a Loading icon indicates that the flow is being saved in the database. + +![](./saving-header.png) + +If you try to exit the flow page before auto-save completes, a dialog will appear to confirm you want to exit before the flow has saved. + +![](./flow-saving.png) + +When the flow has successfully saved, you can click the 'Exit' button. + +![](./flow-saved.png) + +## Manual Saving {#manual-saving} + +When auto-saving is disabled, you need to manually save your flow when making changes. You can still run the flow without saving, for testing purposes. + +If you make any changes and Langflow detects that the saved flow is different from the current flow, a Save button will be enabled and the last time saved will appear at the left side of the topbar. To save the flow, click the Save button, or hit Ctrl+S or Command+S. + +![](./manual-save-button.png) + +If you try to exit after making changes and not saving, a confirmation dialog will appear. You can choose to exit anyway or save and exit. + +![](./flow-unsaved.png) + +## Disable Auto Saving {#environment} + +In Langflow, all changes made in the flows are saved automatically. However, you may prefer to disable this functionality, if you want a quick way to prototype and test changes before they are actually saved to the database. + +If you wish to disable this functionality, you can run Langflow with an environment variable to tell Langflow to use manual saving. + +```shell +langflow --no-auto-saving +# or +python -m langflow --no-auto-saving +``` + +If you installed the local version of Langflow, you can set an environment variable and load it automatically by inserting this line into the `.env` file inside the directory. + +```env +LANGFLOW_AUTO_SAVING=false +``` diff --git a/docs/docs/Configuration/configuration-cli.md b/docs/docs/Configuration/configuration-cli.md index 13ca1bdce..770ff17fb 100644 --- a/docs/docs/Configuration/configuration-cli.md +++ b/docs/docs/Configuration/configuration-cli.md @@ -4,20 +4,14 @@ sidebar_position: 2 slug: /configuration-cli --- - - :::info This page may contain outdated information. It will be updated as soon as possible. ::: - - - Langflow's Command Line Interface (CLI) is a powerful tool that allows you to interact with the Langflow server from the command line. The CLI provides a wide range of commands to help you shape Langflow to your needs. - The available commands are below. Navigate to their individual sections of this page to see the parameters. - [langflow](/configuration-cli) @@ -29,10 +23,8 @@ The available commands are below. Navigate to their individual sections of this ## Overview {#c50e5530289349cf8ed7bee22ba2211a} - Running the CLI without any arguments displays a list of available options and commands. - ```shell langflow # or @@ -42,7 +34,6 @@ python -m langflow ``` - | Command | Description | | ----------- | ---------------------------------------------------------------------- | | `api-key` | Creates an API key for the default superuser if AUTO_LOGIN is enabled. | @@ -51,23 +42,18 @@ python -m langflow | `run` | Run the Langflow. | | `superuser` | Create a superuser. | - ### Options {#8a3b5b7ed55b4774ad6d533bb337ef47} - | Option | Description | | ---------------------- | -------------------------------------------------------------------------------- | | `--install-completion` | Install completion for the current shell. | | `--show-completion` | Show completion for the current shell, to copy it or customize the installation. | | `--help` | Show this message and exit. | - ## langflow api-key {#dbfc8c4c83474b83a38bdc7471bccf41} - Run the `api-key` command to create an API key for the default superuser if `LANGFLOW_AUTO_LOGIN` is set to `True`. - ```shell langflow api-key # or @@ -85,37 +71,27 @@ python -m langflow api-key ``` - ### Options {#ec2ef993dc984811b25838c8d8230b31} - | Option | Type | Description | | ----------- | ---- | ------------------------------------------------------------- | | --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] | | --help | | Show this message and exit. | - ## langflow copy-db {#729a13f4847545e5973d8f9c20f8833d} - Run the `copy-db` command to copy the cached `langflow.db` and `langflow-pre.db` database files to the current directory. - If the files exist in the cache directory, they will be copied to the same directory as `__main__.py`, which can be found with `which langflow`. - ### Options {#7b7e6bd02b3243218e1d666711854673} - None. - ## langflow migration {#7027c1925a444119a7a8ea2bff4bd16d} - Run or test migrations with the Alembic database tool. - ```shell langflow migration # or @@ -123,23 +99,18 @@ python -m langflow migration ``` - ### Options {#0b38fbe97bb34edeb7740a7db58433e9} - | Option | Description | | ------------------- | -------------------------------------------------------------------------------------------------------------------------- | | `--test, --no-test` | Run migrations in test mode. [default: test] | | `--fix, --no-fix` | Fix migrations. This is a destructive operation, and should only be used if you know what you are doing. [default: no-fix] | | `--help` | Show this message and exit. | - ## langflow run {#fe050aa659cb4d33a560b859d54c94ea} - Run Langflow. - ```shell langflow run # or @@ -147,61 +118,51 @@ python -m langflow run ``` - ### Options {#4e811481ec9142f1b60309bb1ce5a2ce} - -| Option | Description | -| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--help` | Displays all available options. | -| `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. | -| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. | -| `--timeout` | Sets the worker timeout in seconds. The default is `60`. | -| `--port` | Sets the port to listen on. Can be set using the `LANGFLOW_PORT` environment variable. The default is `7860`. | -| `--env-file` | Specifies the path to the .env file containing environment variables. The default is `.env`. | -| `--log-level` | Defines the logging level. Can be set using the `LANGFLOW_LOG_LEVEL` environment variable. The default is `critical`. | -| `--components-path` | Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`. | -| `--log-file` | Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`. | -| `--cache` | Select the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`. | -| `--dev`/`--no-dev` | Toggles the development mode. The default is `no-dev`. | -| `--path` | Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable. | -| `--open-browser`/`--no-open-browser` | Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`. | -| `--remove-api-keys`/`--no-remove-api-keys` | Toggles the option to remove API keys from the projects saved in the database. Can be set using the `LANGFLOW_REMOVE_API_KEYS` environment variable. The default is `no-remove-api-keys`. | -| `--install-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Installs completion for the specified shell. | -| `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. | -| `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. | -| `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. | - +| Option | Description | +| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--help` | Displays all available options. | +| `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. | +| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. | +| `--timeout` | Sets the worker timeout in seconds. The default is `60`. | +| `--port` | Sets the port to listen on. Can be set using the `LANGFLOW_PORT` environment variable. The default is `7860`. | +| `--env-file` | Specifies the path to the .env file containing environment variables. The default is `.env`. | +| `--log-level` | Defines the logging level. Can be set using the `LANGFLOW_LOG_LEVEL` environment variable. The default is `critical`. | +| `--components-path` | Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`. | +| `--log-file` | Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`. | +| `--cache` | Select the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`. | +| `--dev`/`--no-dev` | Toggles the development mode. The default is `no-dev`. | +| `--path` | Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable. | +| `--open-browser`/`--no-open-browser` | Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`. | +| `--remove-api-keys`/`--no-remove-api-keys` | Toggles the option to remove API keys from the projects saved in the database. Can be set using the `LANGFLOW_REMOVE_API_KEYS` environment variable. The default is `no-remove-api-keys`. | +| `--install-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Installs completion for the specified shell. | +| `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. | +| `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. | +| `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. | +| `--auto-saving` | This parameter, with a default value of `True`, enables the auto-saving functionality, use `--no-auto-saving` to deactivate it. It can be configured using the `LANGFLOW_AUTO_SAVING` environment variable. | ### CLI environment variables {#5868aaccfcc74e26968538ef4d07e756} - You can configure many of the CLI options using environment variables. These can be exported in your operating system or added to a `.env` file and loaded using the `--env-file` option. - A sample `.env` file named `.env.example` is included with the project. Copy this file to a new file named `.env` and replace the example values with your actual settings. If you're setting values in both your OS and the `.env` file, the `.env` settings will take precedence. - ## langflow superuser {#5944233ce0c942878e928e1f2945d717} - Create a superuser for Langflow. - ```shell langflow superuser # or python -m langflow superuser ``` - ### Options {#f333c5635ead4c3d95985467bb08cc8f} - | Option | Type | Description | | ------------- | ---- | ------------------------------------------------------------- | | `--username` | TEXT | Username for the superuser. [default: None] [required] | | `--password` | TEXT | Password for the superuser. [default: None] [required] | | `--log-level` | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] | | `--help` | | Show this message and exit. | - diff --git a/docs/docs/Configuration/flow-saved.png b/docs/docs/Configuration/flow-saved.png new file mode 100644 index 000000000..c0ded77f2 Binary files /dev/null and b/docs/docs/Configuration/flow-saved.png differ diff --git a/docs/docs/Configuration/flow-saving.png b/docs/docs/Configuration/flow-saving.png new file mode 100644 index 000000000..65d34017f Binary files /dev/null and b/docs/docs/Configuration/flow-saving.png differ diff --git a/docs/docs/Configuration/flow-unsaved.png b/docs/docs/Configuration/flow-unsaved.png new file mode 100644 index 000000000..afab2a404 Binary files /dev/null and b/docs/docs/Configuration/flow-unsaved.png differ diff --git a/docs/docs/Configuration/manual-save-button.png b/docs/docs/Configuration/manual-save-button.png new file mode 100644 index 000000000..735725e5b Binary files /dev/null and b/docs/docs/Configuration/manual-save-button.png differ diff --git a/docs/docs/Configuration/saving-header.png b/docs/docs/Configuration/saving-header.png new file mode 100644 index 000000000..607e02b65 Binary files /dev/null and b/docs/docs/Configuration/saving-header.png differ diff --git a/docs/yarn.lock b/docs/yarn.lock index ab4f1a700..44d04f436 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1853,15 +1853,10 @@ html-react-parser "^4.2.0" posthog-js "^1.45.1" -"@node-rs/jieba-linux-x64-gnu@1.10.3": +"@node-rs/jieba-darwin-arm64@1.10.3": version "1.10.3" - resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.10.3.tgz" - integrity sha512-GF5cfvu/0wXO2fVX/XV3WYH/xEGWzMBvfqLhGiA1OA1xHIufnA1T7uU3ZXkyoNi5Bzf6dmxnwtE4CJL0nvhwjQ== - -"@node-rs/jieba-linux-x64-musl@1.10.3": - version "1.10.3" - resolved "https://registry.npmjs.org/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.10.3.tgz" - integrity sha512-h45HMVU/hgzQ0saXNsK9fKlGdah1i1cXZULpB5vQRlRL2ZIaGp+ULtWTogS7vkoo2K8s2l4tqakWMg9eUjIJ2A== + resolved "https://registry.npmjs.org/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.10.3.tgz" + integrity sha512-dwPhkav1tEARskwPz91UUXL2NXy4h0lJYTuJzpGgwXxm552zBM2JJ41kjah1364j+EOq5At3NQvf5r5rH89phQ== "@node-rs/jieba@^1.6.0": version "1.10.3" @@ -5602,6 +5597,11 @@ fs.realpath@^1.0.0: resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + function-bind@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"