langflow icon indicating copy to clipboard operation
langflow copied to clipboard

Nowhere to edit the variables?

Open maxpaynebupt opened this issue 1 year ago • 4 comments

Bug Description

Nowhere to edit the variables. In docutment, it says: TIP You can also create global variables in Settings > Variables and Secrets. image

But, actually, there is no such "Variables and Secrets" section.

image

Reproduction

  1. Create a flow.
  2. Check the Settings.

Expected behavior

There should be a "Variables and Secrets" section in Settings

Who can help?

No response

Operating System

Docker image v1.0.15

Langflow Version

v1.0.15

Python Version

None

Screenshot

No response

Flow File

No response

maxpaynebupt avatar Aug 21 '24 01:08 maxpaynebupt

The "Variables and Secrets" section might not be present in the Settings as described in the documentation for Langflow v1.0.15 because the documentation contains a note indicating that the information may be outdated and will be updated as soon as possible [1].

However, you can manage global variables and secrets by configuring environment variables in your .env file. Set LANGFLOW_STORE_ENVIRONMENT_VARIABLES to true and list the variables in LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT [2][1].

For example:

LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true
LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT=VARIABLE1,VARIABLE2

This will make the specified environment variables accessible and manageable within the "Variables and Secrets" section, if it becomes available.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Aug 21 '24 01:08 dosubot[bot]

I found that these variable exists in the langflow software's settings, this is a bit little weird. And, still it's not editable. There is no value field. image

How can I set a project level variable which can be exported with the project and modified when the project is imported somewhere else?

maxpaynebupt avatar Aug 21 '24 01:08 maxpaynebupt

To set a project-level variable in Langflow that can be exported with the project and modified when the project is imported somewhere else, you can create a Global Variable. Here are the steps to do this:

  1. In a Text field, click the 🌐 button.
  2. Click + Add New Variable.
  3. Define the Name, Type, and Value of the variable.
  4. Click Save Variable to create it.

To ensure these variables are included when exporting and can be modified upon import, you can configure environment variables in your .env file:

  1. Set LANGFLOW_STORE_ENVIRONMENT_VARIABLES to true in your .env file.
  2. List the variables you want to include in LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT as a comma-separated list or as a JSON-encoded string.

Example .env configuration:

LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true
LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT="VARIABLE1, VARIABLE2"

or

LANGFLOW_STORE_ENVIRONMENT_VARIABLES=true
LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT='["VARIABLE1", "VARIABLE2"]'

This setup will ensure that the specified variables are included in the project's Global Variables and can be modified when the project is imported elsewhere. Additionally, you can manage these variables in Settings > Variables and Secrets [1][2][3].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Aug 21 '24 01:08 dosubot[bot]

Currently, you can edit the global variables directly through the API. I believe that the frontend will soon support editing global variables as well. Untitled

italojohnny avatar Aug 21 '24 19:08 italojohnny