initial-content
This commit is contained in:
parent
da256785d0
commit
d8c8f4db7a
3 changed files with 44 additions and 0 deletions
43
docs/docs/administration/global-env.mdx
Normal file
43
docs/docs/administration/global-env.mdx
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";
|
||||
|
||||
# Global environment variables
|
||||
|
||||
Langflow 1.0 alpha includes the option to add **Global Environment Variables** for your application.
|
||||
|
||||
## Example
|
||||
|
||||
In this example, you'll add the `openai_api_key` credential as a global environment variable to the **Basic Prompting** starter project.
|
||||
|
||||
For more information on the starter flow, see [Basic prompting ](../starter-projects/basic-prompting.mdx).
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
2. Select **Basic Prompting**.
|
||||
3. The **Basic Prompting** flow is created.
|
||||
4. To create an environment variable for the **OpenAI** component, in the **OpenAI API Key** field, click the **Globe** button, and then click **Add New Variable**.
|
||||
|
||||
<Admonition type="tip">
|
||||
You can also create global variables in **Settings** > **Variables and Secrets**.
|
||||
</Admonition>
|
||||
|
||||
1. In the **Variable Name** field, enter `openai_api_key`.
|
||||
2. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
3. For the variable **Type**, select **Credential**.
|
||||
4. In the **Apply to Fields** field, select **OpenAI API Key** to apply this variable to all fields named **OpenAI API Key**.
|
||||
5. Click **Save Variable**.
|
||||
|
||||
<ZoomableImage
|
||||
alt="Docusaurus themed image"
|
||||
sources={{
|
||||
light: "img/global-env.png",
|
||||
dark: "img/global-env.png",
|
||||
}}
|
||||
style={{ width: "40%", margin: "20px auto" }}
|
||||
/>
|
||||
|
||||
You now have a `openai_api_key` global environment variable for your Langflow project.
|
||||
|
||||
5. To view and manage your project's global environment variables, visit **Settings** > **Variables and Secrets**.
|
||||
|
||||
For more on variables in HuggingFace Spaces, see [Managing Secrets](https://huggingface.co/docs/hub/spaces-overview#managing-secrets).
|
||||
|
||||
|
|
@ -40,6 +40,7 @@ module.exports = {
|
|||
"administration/login",
|
||||
"administration/api",
|
||||
"administration/cli",
|
||||
"administration/global-env",
|
||||
"administration/components",
|
||||
"administration/collection",
|
||||
"administration/prompt-customization",
|
||||
|
|
|
|||
BIN
docs/static/img/global-env.png
vendored
Normal file
BIN
docs/static/img/global-env.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
Loading…
Add table
Add a link
Reference in a new issue