docs: update docs from notion (#2684)
Co-authored-by: lucaseduoli <lucaseduoli@users.noreply.github.com>
|
|
@ -6,16 +6,16 @@ slug: /components-custom-components
|
|||
|
||||
|
||||
|
||||
Langflow components can be created from within the platform, allowing users to extend the platform's functionality using Python code. They encapsulate are designed to be independent units, reusable across different workflows.
|
||||
Langflow components can be created from within the platform, allowing users to extend the platform's functionality using Python code. They encapsulate are designed to be independent units, reusable across different workflows.
|
||||
|
||||
|
||||
These components can be easily connected within a language model pipeline, adding freedom and flexibility to what can be included in between user and AI messages.
|
||||
These components can be easily connected within a language model pipeline, adding freedom and flexibility to what can be included in between user and AI messages.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
Since Langflow operates with Python behind the scenes, you can implement any Python function within a Custom Component. This means you can leverage the power of libraries such as Pandas, Scikit-learn, Numpy, and thousands of packages to create components that handle data processing in unlimited ways.
|
||||
Since Langflow operates with Python behind the scenes, you can implement any Python function within a Custom Component. This means you can leverage the power of libraries such as Pandas, Scikit-learn, Numpy, and thousands of packages to create components that handle data processing in unlimited ways.
|
||||
|
||||
|
||||
Custom Components are not just about extending functionality; they also streamline the development process. By creating reusable and configurable components, you can enhance the capabilities of Langflow, making it a powerful tool for developing complex workflows.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ slug: /components-data
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## API Request {#23da589293f74016a1f70d6d7c0fdc55}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ slug: /components-embedding-models
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## Amazon Bedrock Embeddings {#4ddcfde8c1664e358d3f16d718e944d8}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ slug: /components-helpers
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## Chat memory {#304dc4a3bea74efb9068093ff18a56ad}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,9 +30,6 @@ You can find out more about Chat Input and other Inputs [here](/components-io).
|
|||
### Chat Input {#2a5f02262f364f8fb75bcfa246e7bb26}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
This component collects user input from the chat.
|
||||
|
||||
|
||||
|
|
@ -43,11 +40,14 @@ This component collects user input from the chat.
|
|||
- **Message:** Specifies the message text. It is a multiline text input.
|
||||
- **Session ID:** Specifies the session ID of the chat history. If provided, the message will be saved in the Message History.
|
||||
|
||||
NOTE
|
||||
|
||||
:::note
|
||||
|
||||
If `As Data` is `true` and the `Message` is a `Data`, the data of the `Data` will be updated with the `Sender`, `Sender Name`, and `Session ID`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
One significant capability of the Chat Input component is its ability to transform the Playground into a chat window. This feature is particularly valuable for scenarios requiring user input to initiate or influence the flow.
|
||||
|
||||
|
|
@ -55,9 +55,6 @@ One significant capability of the Chat Input component is its ability to transfo
|
|||
### Text Input {#260aef3726834896b496b56cdefb6d4a}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The **Text Input** component adds an **Input** field on the Playground. This enables you to define parameters while running and testing your flow.
|
||||
|
||||
|
||||
|
|
@ -99,9 +96,6 @@ You can find out more about it and the other Outputs [here](/components-io).
|
|||
### Chat Output {#1edd49b72781432ea29d70acbda4e7e7}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
This component sends a message to the chat.
|
||||
|
||||
|
||||
|
|
@ -112,18 +106,18 @@ This component sends a message to the chat.
|
|||
- **Session ID:** Specifies the session ID of the chat history. If provided, messages are saved in the Message History.
|
||||
- **Message:** Specifies the text of the message.
|
||||
|
||||
NOTE
|
||||
|
||||
:::note
|
||||
|
||||
If `As Data` is `true` and the `Message` is a `Data`, the data in the `Data` is updated with the `Sender`, `Sender Name`, and `Session ID`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
### Text Output {#b607000bc0c5402db0433c1a7d734d01}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
This component displays text data to the user. It is useful when you want to show text without sending it to the chat.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ slug: /components-models
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## Amazon Bedrock {#3b8ceacef3424234814f95895a25bf43}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ slug: /components-prompts
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
A prompt is the input provided to a language model, consisting of multiple components and can be parameterized using prompt templates. A prompt template offers a reproducible method for generating prompts, enabling easy customization through input variables.
|
||||
|
||||
|
||||
|
|
@ -25,6 +34,6 @@ This component creates a prompt template with dynamic variables. This is useful
|
|||
The `PromptTemplate` component enables users to create prompts and define variables that control how the model is instructed. Users can input a set of variables which the template uses to generate the prompt when a conversation starts.
|
||||
|
||||
|
||||
After defining a variable in the prompt template, it acts as its own component input.
|
||||
After defining a variable in the prompt template, it acts as its own component input.
|
||||
|
||||
- **template:** The template used to format an individual request.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ slug: /components-vector-stores
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
### Astra DB {#453bcf5664154e37a920f1b602bd39da}
|
||||
|
||||
|
||||
|
|
@ -298,11 +307,14 @@ Ensure the PostgreSQL server is accessible and configured correctly.
|
|||
- **Search Kwargs:** Additional search parameters.
|
||||
- **Pool Threads:** Number of threads.
|
||||
|
||||
NOTE
|
||||
|
||||
:::info
|
||||
|
||||
Ensure the Pinecone API key and environment are correctly configured.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -381,11 +393,14 @@ Ensure the Pinecone API key and environment are correctly configured.
|
|||
For detailed documentation, refer to the [Redis Documentation](https://python.langchain.com/docs/integrations/vectorstores/redis).
|
||||
|
||||
|
||||
NOTE
|
||||
|
||||
:::info
|
||||
|
||||
Ensure the Redis server URL and index name are configured correctly. Provide a schema if no documents are available.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -425,11 +440,14 @@ Ensure the Redis server URL and index name are configured correctly. Provide a s
|
|||
- **Supabase URL:** Instance URL.
|
||||
- **Table Name:** Optional table name.
|
||||
|
||||
NOTE
|
||||
|
||||
:::info
|
||||
|
||||
Ensure the Supabase service key, URL, and table name are properly configured.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -471,11 +489,14 @@ Ensure the Supabase service key, URL, and table name are properly configured.
|
|||
For more information, consult the [Vectara Component Documentation](https://python.langchain.com/docs/integrations/vectorstores/vectara).
|
||||
|
||||
|
||||
NOTE
|
||||
|
||||
:::info
|
||||
|
||||
If inputs or files_url are provided, they will be processed accordingly.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ slug: /components
|
|||
## Component {#0323a728d8314767adb907b998036bb4}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
A component is a single building block within a flow. It consists of inputs, outputs, and parameters that define their functionality. These elements provide a convenient and straightforward way to compose LLM-based applications. Learn more about components and how they work below.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,18 @@
|
|||
---
|
||||
title: Folders
|
||||
title: My Collection
|
||||
sidebar_position: 3
|
||||
slug: /365085a8-a90a-43f9-a779-f8769ec7eca1
|
||||
---
|
||||
|
||||
|
||||
|
||||
## **Collections and Projects** {#a259c11235144b18b3ae7a8265a2e6f5}
|
||||
:::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.
|
||||
|
|
@ -24,6 +30,9 @@ Click on a flow card to open it in Langflow Workspace or use the **Playground B
|
|||
## 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.
|
||||
|
||||
|
||||
|
|
@ -91,6 +100,5 @@ Langflow
|
|||
└── Documents
|
||||
├── RAG Project
|
||||
└── Advanced RAG Project
|
||||
|
||||
```
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ slug: /configuration-api-keys
|
|||
|
||||
|
||||
|
||||
:::caution
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ This page may contain outdated information. It will be updated as soon as possib
|
|||
Langflow provides an API key functionality that allows users to access their individual components and flows without traditional login authentication. The API key is a user-specific token that can be included in the request header or query parameter to authenticate API calls. This documentation outlines how to generate, use, and manage API keys in Langflow.
|
||||
|
||||
|
||||
:::caution
|
||||
:::info
|
||||
|
||||
The default user and password are set using the LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD environment variables. The default values are langflow and langflow, respectively.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,18 +6,25 @@ slug: /configuration-authentication
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## Sign Up and Sign In {#f480dac5d2094d75a433de0b8e195641}
|
||||
|
||||
|
||||
> ⚠️ WARNING
|
||||
> This page may contain outdated information. It will be updated as soon as possible.
|
||||
>
|
||||
---
|
||||
|
||||
|
||||
The login functionality in Langflow serves to authenticate users and protect sensitive routes in the application. Starting from version 0.5, Langflow introduces an enhanced login mechanism that is governed by a few environment variables. This allows new secure features.
|
||||
|
||||
|
||||
## Environment variables {#3ed7cae6f5324ba0ac14783cf2a6cc07}
|
||||
## Environment Variables {#3ed7cae6f5324ba0ac14783cf2a6cc07}
|
||||
|
||||
|
||||
The following environment variables are crucial in configuring the login settings:
|
||||
|
|
@ -37,9 +44,9 @@ langflow run --env-file .env
|
|||
```
|
||||
|
||||
|
||||
> ℹ︎ INFO
|
||||
> It is critical not to expose these environment variables in your code repository. Always set them securely in your deployment environment, for example, using Docker secrets, Kubernetes ConfigMaps/Secrets, or dedicated secure environment configuration systems like AWS Secrets Manager.
|
||||
>
|
||||
> ℹ︎ INFO
|
||||
> It is critical not to expose these environment variables in your code repository. Always set them securely in your deployment environment, for example, using Docker secrets, Kubernetes ConfigMaps/Secrets, or dedicated secure environment configuration systems like AWS Secrets Manager.
|
||||
>
|
||||
|
||||
|
||||
### _`LANGFLOW_AUTO_LOGIN`_ {#8b10059e0fbc44f3bc8ce63fe7692e7e}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,13 @@ slug: /configuration-backend-only
|
|||
|
||||
|
||||
|
||||
> ⚠️ WARNING
|
||||
> This page may contain outdated information. It will be updated as soon as possible.
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
You can run Langflow in `--backend-only` mode to expose your Langflow app as an API, without running the frontend UI.
|
||||
|
|
@ -115,11 +120,11 @@ def run_flow(message: str,
|
|||
headers = {"x-api-key": api_key}
|
||||
response = requests.post(api_url, json=payload, headers=headers)
|
||||
return response.json()
|
||||
|
||||
|
||||
# Setup any tweaks you want to apply to the flow
|
||||
|
||||
|
||||
message = "message"
|
||||
|
||||
|
||||
print(run_flow(message=message, flow_id=FLOW_ID))
|
||||
|
||||
```
|
||||
|
|
|
|||
|
|
@ -6,9 +6,13 @@ slug: /configuration-cli
|
|||
|
||||
|
||||
|
||||
> ⚠️ WARNING
|
||||
> This page may contain outdated information. It will be updated as soon as possible.
|
||||
>
|
||||
:::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.
|
||||
|
|
@ -188,7 +192,6 @@ Create a superuser for Langflow.
|
|||
langflow superuser
|
||||
# or
|
||||
python -m langflow superuser
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ slug: /contributing-community
|
|||
## 🤖 Join **Langflow** Discord server {#80011e0bda004e83a8012c7ec6eab29a}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Join us to ask questions and showcase your projects.
|
||||
|
||||
|
||||
|
|
@ -18,38 +21,32 @@ Let's bring together the building blocks of AI integration!
|
|||
Langflow [Discord](https://discord.gg/EqksyE2EX9) server.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 🐦 Stay tuned for **Langflow** on Twitter {#6a17ba5905ad4f7aa5347af7854779f6}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Follow [@langflow_ai](https://twitter.com/langflow_ai) on **Twitter** to get the latest news about **Langflow**.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## ⭐️ Star **Langflow** on GitHub {#c903a569934643799bf52b7d1b3514e1}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
You can "star" **Langflow** in [GitHub](https://github.com/langflow-ai/langflow).
|
||||
|
||||
|
||||
By adding a star, other users will be able to find it more easily and see that it has been already useful for others.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 👀 Watch the GitHub repository for releases {#d0a089ed717742308bd17430e5ae6309}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
You can "watch" **Langflow** in [GitHub](https://github.com/langflow-ai/langflow). If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue or question. You can also specify that you only want to be notified about new issues, discussions, PRs, etc. so you can try and help them solve those questions.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Thanks! 🚀
|
||||
|
||||
|
|
|
|||
|
|
@ -17,5 +17,8 @@ If you're looking for help with your code, consider posting a question on the [
|
|||
## Issue labels {#e19eae656c914ce7aedc4f55565cc0bc}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
[See this page](https://github.com/langflow-ai/langflow/labels) for an overview of the system we use to tag our issues and pull requests.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,24 +6,34 @@ slug: /contributing-how-to-contribute
|
|||
|
||||
|
||||
|
||||
👋 Hello there! We welcome contributions from developers of all levels to our open-source project on [GitHub](https://github.com/langflow-ai/langflow). If you'd like to contribute, please check our contributing guidelines and help make Langflow more accessible.
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
👋 Hello there!
|
||||
|
||||
We welcome contributions from developers of all levels to our open-source project on [GitHub](https://github.com/langflow-ai/langflow). If you'd like to contribute, please check our contributing guidelines and help make Langflow more accessible.
|
||||
|
||||
|
||||
|
||||
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether in the form of a new feature, improved infra, or better documentation.
|
||||
|
||||
|
||||
To contribute to this project, please follow a ["fork and pull request"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow.
|
||||
|
||||
To contribute to this project, please follow a ["fork and pull request"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow. Please do not try to push directly to this repo unless you are a maintainer.
|
||||
|
||||
|
||||
Please do not try to push directly to this repo unless you are a maintainer.
|
||||
## Local Development {#0388cc3c758d434d994022863a6bafa9}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Local development {#0388cc3c758d434d994022863a6bafa9}
|
||||
|
||||
|
||||
You can develop Langflow using docker compose, or locally.
|
||||
|
||||
|
||||
|
|
@ -42,12 +52,12 @@ This will install the pre-commit hooks, which will run `make format` on every
|
|||
It is advised to run `make lint` before pushing to the repository.
|
||||
|
||||
|
||||
## Run Locally {#5225c2ef0cd6403c9f6c6bbd888115e0}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Run locally {#5225c2ef0cd6403c9f6c6bbd888115e0}
|
||||
|
||||
|
||||
Langflow can run locally by cloning the repository and installing the dependencies. We recommend using a virtual environment to isolate the dependencies from your system.
|
||||
|
||||
|
||||
|
|
@ -68,24 +78,24 @@ And the frontend:
|
|||
`make frontend`
|
||||
|
||||
|
||||
## Docker Compose {#b07f359414ff4220ac615afc364ee46e}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Docker compose {#b07f359414ff4220ac615afc364ee46e}
|
||||
|
||||
|
||||
The following snippet will run the backend and frontend in separate containers. The frontend will be available at `localhost:3000` and the backend at `localhost:7860`.
|
||||
|
||||
|
||||
`docker compose up --build# ormake dev build=1`
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Documentation {#5f34bcaeccdc4489b0c5ee2c4a21354e}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The documentation is built using [Docusaurus](https://docusaurus.io/). To run the documentation locally, run the following commands:
|
||||
|
||||
|
||||
|
|
@ -104,7 +114,7 @@ The documentation will be available at `localhost:3000` and all the files are
|
|||
New components are added as objects of the [CustomComponent](https://github.com/langflow-ai/langflow/blob/dev/src/backend/base/langflow/interface/custom/custom_component/custom_component.py) class and any dependencies are added to the [pyproject.toml](https://github.com/langflow-ai/langflow/blob/dev/pyproject.toml#L27) file.
|
||||
|
||||
|
||||
## Add an example component {#8caae106c853465d83183e7f5272e4d8}
|
||||
### Add an example component {#8caae106c853465d83183e7f5272e4d8}
|
||||
|
||||
|
||||
You have a new document loader called **MyCustomDocumentLoader** and it would look awesome in Langflow.
|
||||
|
|
@ -122,15 +132,24 @@ You have a new document loader called **MyCustomDocumentLoader** and it would
|
|||
## User Sharing {#34ac32e11f344eab892b94531a21d2c9}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
You might want to share and test your custom component with others, but don't need it merged into the main source code.
|
||||
|
||||
|
||||
If so, you can share your component on the Langflow store.
|
||||
|
||||
|
||||
1. [Register at the Langflow store](https://www.langflow.store/login/).
|
||||
|
||||
|
||||
2. Undergo pre-validation before receiving an API key.
|
||||
|
||||
|
||||
3. To deploy your amazing component directly to the Langflow store, without it being merged into the main source code, navigate to your flow, and then click **Share**. The share window appears:
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,19 +6,30 @@ slug: /contributing-telemetry
|
|||
|
||||
|
||||
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
Our system uses anonymous telemetry to collect essential usage statistics to enhance functionality and user experience. This data helps us identify commonly used features and areas needing improvement, ensuring our development efforts align with what you need.
|
||||
|
||||
|
||||
INFO
|
||||
|
||||
:::note
|
||||
|
||||
We respect your privacy and are committed to protecting your data. We do not collect any personal information or sensitive data. All telemetry data is anonymized and used solely for improving Langflow.
|
||||
|
||||
|
||||
You can opt-out of telemetry by setting the `LANGFLOW_DO_NOT_TRACK` or `DO_NOT_TRACK` environment variable to `true` before running Langflow. This will disable telemetry data collection.
|
||||
|
||||
:::
|
||||
|
||||
## Data Collected Includes: {#1734ed50fb4a4a45aaa84185b44527ca}
|
||||
|
||||
|
||||
|
||||
## Data Collected Includes {#1734ed50fb4a4a45aaa84185b44527ca}
|
||||
|
||||
|
||||
### Run {#2d427dca4f0148ae867997f6789e8bfb}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,19 @@ This guide will help you get LangFlow up and running using Docker and Docker Com
|
|||
|
||||
## Prerequisites {#856bb2d98156402bbd1980365b98110c}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- Docker
|
||||
- Docker Compose
|
||||
|
||||
## Clone repo and build Docker container {#ba89773aa8b8425b985bfe7ba91c35cc}
|
||||
## Docker {#55b5d304f2294e47b0dcd3e069cf5e67}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Clone repo and build Docker container {#ba89773aa8b8425b985bfe7ba91c35cc}
|
||||
|
||||
1. Clone the LangFlow repository:
|
||||
|
||||
|
|
@ -32,7 +41,7 @@ This guide will help you get LangFlow up and running using Docker and Docker Com
|
|||
LangFlow will now be accessible at [http://localhost:7860/](http://localhost:7860/).
|
||||
|
||||
|
||||
## Docker Compose configuration {#02226209cad24185a6ec5b69bd820d0f}
|
||||
### Docker Compose configuration {#02226209cad24185a6ec5b69bd820d0f}
|
||||
|
||||
|
||||
The Docker Compose configuration spins up two services: `langflow` and `postgres`.
|
||||
|
|
@ -69,7 +78,7 @@ Volumes:
|
|||
|
||||
- `langflow-postgres`: This volume is mapped to `/var/lib/postgresql/data` in the container.
|
||||
|
||||
## Switch to a specific LangFlow version {#2b3e191ea48f4feab89242433cf012d5}
|
||||
### Switch to a specific LangFlow version {#2b3e191ea48f4feab89242433cf012d5}
|
||||
|
||||
|
||||
If you want to use a specific version of LangFlow, you can modify the `image` field under the `langflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `langflowai/langflow:latest` to `langflowai/langflow:1.0-alpha`.
|
||||
|
|
|
|||
|
|
@ -6,22 +6,37 @@ slug: /deployment-gcp
|
|||
|
||||
|
||||
|
||||
# Deploy on Google Cloud Platform {#4ee01cda736c4f7396936409f23cdb52}
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
> Warning: This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
|
||||
## Run Langflow from a New Google Cloud Project {#ce729796d7404ccdb627bee47d6a4399}
|
||||
## Deploy on Google Cloud Platform {#4ee01cda736c4f7396936409f23cdb52}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Run Langflow from a New Google Cloud Project {#ce729796d7404ccdb627bee47d6a4399}
|
||||
|
||||
|
||||
This guide will help you set up a Langflow development VM in a Google Cloud Platform project using Google Cloud Shell.
|
||||
|
||||
|
||||
> Note: When Cloud Shell opens, be sure to select Trust repo. Some gcloud commands might not run in an ephemeral Cloud Shell environment.
|
||||
:::info
|
||||
|
||||
When Cloud Shell opens, be sure to select Trust repo. Some gcloud commands might not run in an ephemeral Cloud Shell environment.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Standard VM {#245b47b450dd4159a5c56a5124bab84f}
|
||||
|
||||
|
||||
### Standard VM {#245b47b450dd4159a5c56a5124bab84f}
|
||||
|
||||
|
||||
[embed](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/langflow-ai/langflow&working_dir=scripts/gcp&shellonly=true&tutorial=walkthroughtutorial.md)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ slug: /deployment-hugging-face-spaces
|
|||
|
||||
|
||||
|
||||
# HuggingFace Spaces {#00f5b3a6818d496dbb18e1a6a910e57d}
|
||||
## HuggingFace Spaces {#00f5b3a6818d496dbb18e1a6a910e57d}
|
||||
|
||||
|
||||
---
|
||||
|
|
@ -14,13 +14,21 @@ slug: /deployment-hugging-face-spaces
|
|||
|
||||
HuggingFace provides a great alternative for running Langflow in their Spaces environment. This means you can run Langflow in the cloud without any local installation required. Here's how you can get Langflow up and running on HuggingFace Spaces:
|
||||
|
||||
|
||||
1. **Access Langflow Space**: Open a Chromium-based browser and navigate to the [Langflow Space](https://huggingface.co/spaces/Langflow/Langflow?duplicate=true). This link directs you to a pre-configured environment for Langflow.
|
||||
|
||||
|
||||
2. **Duplicate the Space**: You'll encounter an option to duplicate the Langflow space. This step involves a few simple decisions:
|
||||
|
||||
- **Naming Your Space**: Assign a unique name to your new Space.
|
||||
- **Visibility Settings**: Choose between Public or Private visibility for your Space.
|
||||
- After setting these parameters, click on **Duplicate Space** to initiate the setup.
|
||||
|
||||

|
||||
|
||||
1. **Complete Installation**: The duplication and setup process begins immediately after you click **Duplicate Space**. Once completed, you will be automatically redirected to the main page of your new Space.
|
||||
2. **Start Exploring Langflow**: With the setup complete, Langflow is now ready for use in your Space and you can start exploring its features and capabilities right away!
|
||||
|
||||
3. **Complete Installation**: The duplication and setup process begins immediately after you click **Duplicate Space**. Once completed, you will be automatically redirected to the main page of your new Space.
|
||||
|
||||
|
||||
4. **Start Exploring Langflow**: With the setup complete, Langflow is now ready for use in your Space and you can start exploring its features and capabilities right away!
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ This guide will help you get LangFlow up and running in Kubernetes cluster, incl
|
|||
## LangFlow (IDE) {#cb60b2f34e70490faf231cb0fe1a4b42}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
This solution is designed to provide a complete environment for developers to create, test, and debug their flows. It includes both the API and the UI.
|
||||
|
||||
|
||||
|
|
@ -191,6 +194,9 @@ Visit the [LangFlow Helm Charts repository](https://github.com/langflow-ai/langf
|
|||
## LangFlow (Runtime) {#49f2813ad2d3460081ad26a286a65e73}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The runtime chart is tailored for deploying applications in a production environment. It is focused on stability, performance, isolation, and security to ensure that applications run reliably and efficiently.
|
||||
|
||||
|
||||
|
|
@ -216,7 +222,6 @@ Follow the same steps as for the LangFlow IDE.
|
|||
```shell
|
||||
helm repo add langflow <https://langflow-ai.github.io/langflow-helm-charts>
|
||||
helm repo update
|
||||
|
||||
```
|
||||
|
||||
2. Install the LangFlow app with the default options in the `langflow` namespace.
|
||||
|
|
@ -225,20 +230,20 @@ If you want to download the flow from a remote location, you can specify the URL
|
|||
|
||||
```shell
|
||||
helm install my-langflow-app langflow/langflow-runtime -n langflow --create-namespace --set image.repository=myuser/langflow-just-chat --set image.tag=1.0.0
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
```shell
|
||||
helm install my-langflow-app langflow/langflow-runtime -n langflow --create-namespace --set downloadFlows.flows[0].url=https://raw.githubusercontent.com/langflow-ai/langflow/dev/src/backend/base/langflow/initial_setup/starter_projects/Basic%20Prompting%20(Hello%2C%20world!).json
|
||||
|
||||
|
||||
```
|
||||
|
||||
3. Check the status of the pods.
|
||||
|
||||
```text
|
||||
kubectl get pods -n langflow
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -250,7 +255,6 @@ Enable local port forwarding to access LangFlow from your local machine.
|
|||
|
||||
```text
|
||||
kubectl port-forward -n langflow svc/langflow-my-langflow-app 7860:7860
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -348,14 +352,20 @@ resources:
|
|||
```
|
||||
|
||||
|
||||
### Other examples {#8522b4276b51448e9f8f0c6efc731a7c}
|
||||
## Other Examples {#8522b4276b51448e9f8f0c6efc731a7c}
|
||||
|
||||
|
||||
Visit the LangFlow Helm Charts repository for more examples and configurations.
|
||||
---
|
||||
|
||||
|
||||
Use the default values file as reference for all the options available.
|
||||
Visit the LangFlow Helm Charts repository for more examples and configurations. Use the default values file as reference for all the options available.
|
||||
|
||||
|
||||
:::note
|
||||
|
||||
Visit the examples directory to learn more about different deployment options.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@ slug: /deployment-railway
|
|||
|
||||
|
||||
|
||||
# Deploy on Railway {#a9a1ce4d39e74cc29aef4d30c6172d10}
|
||||
## Deploy on Railway {#a9a1ce4d39e74cc29aef4d30c6172d10}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Railway is a cloud infrastructure platform that enables developers to deploy and manage applications effortlessly. It provides an intuitive interface, seamless integrations, and powerful features like auto-deploy from GitHub, managed databases, and automatic scaling.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@ slug: /deployment-render
|
|||
|
||||
|
||||
|
||||
# Deploy on Render {#20a959b7047e44e490cc129fd21895c0}
|
||||
## Deploy on Render {#20a959b7047e44e490cc129fd21895c0}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
[Render.com](http://render.com/) is a unified cloud platform designed to make deploying web applications, APIs, and static sites easy. It provides a streamlined experience with powerful features like automatic SSL, managed databases, and auto-deploy from Git, making it a popular choice for developers looking to simplify their deployment workflows.
|
||||
|
|
@ -14,16 +17,24 @@ slug: /deployment-render
|
|||
|
||||
Deploying Langflow to Render is a straightforward process that can be completed in just a few steps:
|
||||
|
||||
|
||||
1. **Click the Button Below**: Start by clicking the deployment button provided below. This will redirect you to the Render platform.
|
||||
|
||||
|
||||
[https://render.com/deploy?repo=https://github.com/langflow-ai/langflow/tree/dev](https://render.com/deploy?repo=https%3A%2F%2Fgithub.com%2Flangflow-ai%2Flangflow%2Ftree%2Fdev)
|
||||
|
||||
|
||||
2. **Select the Default Configuration**: Once on the Render platform, you will be prompted to provide a blueprint name and to select the default configuration for Langflow. This configuration includes all the necessary settings and resources to run Langflow efficiently. You can change the branch of the repo to “main” or “dev” based on your preference. Click “Create New Resources” to proceed.
|
||||
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
3. **Deploy**: After selecting the configuration, proceed to deploy your Langflow instance. You can keep the default Starter instance, or change it to another instance based on your specific needs. Click Apply to deploy the instance. Render will handle the rest, including setting up the database, deploying the Langflow instance, and starting the application.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 486 KiB |
BIN
docs/docs/Getting-Started/1390293355.png
Normal file
|
After Width: | Height: | Size: 118 KiB |
BIN
docs/docs/Getting-Started/1835734464.png
Normal file
|
After Width: | Height: | Size: 315 KiB |
BIN
docs/docs/Getting-Started/487525520.png
Normal file
|
After Width: | Height: | Size: 258 KiB |
BIN
docs/docs/Getting-Started/690736575.png
Normal file
|
After Width: | Height: | Size: 383 KiB |
|
|
@ -13,7 +13,7 @@ This is a list of possible issues that you may encounter when installing Langflo
|
|||
|
||||
|
||||
```bash
|
||||
> No module named 'langflow.__main__'
|
||||
> No module named 'langflow.__main__'
|
||||
```
|
||||
|
||||
1. Run `python -m langflow run` instead of `langflow run`.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ The easiest way to get started with Langflow is through the DataStax Cloud Servi
|
|||

|
||||
|
||||
|
||||
# **Install Langflow Locally** {#ef364ee864c545649d248113ad7d3038}
|
||||
## **Install Langflow Locally** {#ef364ee864c545649d248113ad7d3038}
|
||||
|
||||
|
||||
---
|
||||
|
|
@ -59,6 +59,9 @@ Pipx can fetch the missing Python version for you with `--fetch-missing-python`
|
|||
## Having a problem? {#86a16dad1d6e481cafb90efea2b9ff93}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
If you encounter a problem, see [Common Installation Issues](/getting-started-common-installation-issues).
|
||||
|
||||
|
||||
|
|
@ -72,14 +75,23 @@ python -m langflow --help
|
|||
|
||||
## ⛓️ Run Langflow {#d318c4d486b74f5383c45b4f6859dcaa}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
1. To run Langflow, enter the following command.
|
||||
|
||||
|
||||
```bash
|
||||
python -m langflow run
|
||||
```
|
||||
|
||||
1. Confirm that a local Langflow instance starts by visiting `http://127.0.0.1:7860` in a Chromium-based browser.
|
||||
|
||||
2. Confirm that a local Langflow instance starts by visiting `http://127.0.0.1:7860` in a Chromium-based browser.
|
||||
|
||||
|
||||

|
||||
|
||||
1. Continue on to the [Quickstart](/getting-started-quickstart).
|
||||
|
||||
3. Continue on to the [Quickstart](/getting-started-quickstart).
|
||||
|
||||
|
|
|
|||
|
|
@ -15,52 +15,65 @@ slug: /getting-started-quickstart
|
|||
- [OpenAI API key](https://platform.openai.com/)
|
||||
- [Langflow installed and running](/getting-started-installation)
|
||||
|
||||
## Hello World - Basic Prompting {#67e7cd59d0fa43e3926bdc75134f7472}
|
||||
## Basic Prompting {#67e7cd59d0fa43e3926bdc75134f7472}
|
||||
|
||||
|
||||
Let's start with a Prompt component to instruct an OpenAI Model.
|
||||
---
|
||||
|
||||
|
||||
Prompts serve as the inputs to a large language model (LLM), acting as the interface between human instructions and computational tasks. By submitting natural language requests in a prompt to an LLM, you can obtain answers, generate text, and solve problems.
|
||||
### Create the basic prompting project {#c029603ddb1f42f5b28df92e58426ab3}
|
||||
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
2. Select **Basic Prompting**.
|
||||
|
||||

|
||||
|
||||
3. The **Basic Prompting** flow is created.
|
||||
|
||||
|
||||
This flow allows you to chat with the **OpenAI** model by using a **Prompt** to send instructions.
|
||||

|
||||
|
||||
|
||||
This flow allows you to chat with the **OpenAI** component through the **Prompt** component.
|
||||
|
||||
|
||||
Examine the **Prompt** component. The **Template** field instructs the LLM to `Answer the user as if you were a pirate.` This should be interesting...
|
||||
|
||||
|
||||
To use the **OpenAI** component, you have two options for providing your OpenAI API Key: directly passing it to the component or creating an environment variable. For better security and manageability, creating an environment variable is recommended. Here's how to set it up:
|
||||

|
||||
|
||||
|
||||
In the **OpenAI API Key** field, click the **Globe** button to access environment variables, and then click **Add New Variable**.
|
||||
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**.
|
||||
|
||||
1. In the **Variable Name** field, enter `openai_api_key`.
|
||||
2. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
3. Click **Save Variable**.
|
||||
1. In the **Variable Name** field, enter `openai_api_key`.
|
||||
2. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
3. Click **Save Variable**.
|
||||
|
||||
By creating an environment variable, you keep your API key secure and make it easier to manage across different components or projects.
|
||||

|
||||
|
||||
|
||||
## Run the basic prompting flow {#27ac88f4721b42c9a9587326905b8df4}
|
||||
### Run {#ef0e8283bfb646f99bbb825462d8cbab}
|
||||
|
||||
1. Click the **Playground** button. This where you can interact with your bot.
|
||||
2. Type any message and press Enter. And... Ahoy! 🏴☠️ The bot responds in a piratical manner!
|
||||
1. Click the **Playground** button on the control panel (bottom right side of the workspace). This is where you can interact with your AI.
|
||||
2. Type a message and press Enter. The bot should respond in a markedly piratical manner!
|
||||
|
||||
## Modify the prompt for a different result {#5208b946024846169fe59ee206021a4f}
|
||||
### Modify the prompt for a different result {#dcea9df0cd51434db76717c78b1e9a94}
|
||||
|
||||
1. To modify your prompt results, in the **Prompt** template, click the **Template** field. The **Edit Prompt** window opens.
|
||||
2. Change `Answer the user as if you were a pirate` to a different character, perhaps `Answer the user as if you were Harold Abelson.`
|
||||
3. Run the basic prompting flow again. The response will be markedly different.
|
||||
2. Change `Answer the user as if you were a pirate` to a different character, perhaps `Answer the user as if you were Hermione Granger.`
|
||||
3. Run the workflow again. The response will be markedly different.
|
||||
|
||||
## Next steps {#63b6db6cb571489c86b3ae89051f1a4f}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Well done! You've built your first prompt in Langflow. 🎉
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ Its intuitive interface allows for easy manipulation of AI building blocks, enab
|
|||
|
||||
## 🚀 First steps {#c1ccb5e315b040edaa8d9a67f4960d81}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- [Install Langflow](/getting-started-installation) - Install and start a local Langflow server.
|
||||
- [Quickstart](/getting-started-quickstart) - Create a flow and run it.
|
||||
- [Langflow Workspace](/workspace) - Learn more about the Langflow Workspace.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ slug: /guides-chat-memory
|
|||
|
||||
|
||||
|
||||
Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate _memories_ for agents to store and recall information as needed.
|
||||
Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate _memories_ for agents to store and recall information as needed.
|
||||
|
||||
|
||||
In any project, as long as there are [**Chat**](/components-io) being used, memories are always being stored by default. These are messages from a user to the AI or vice-versa.
|
||||
|
|
@ -48,10 +48,10 @@ The **Chat Memory** component also retrieves message histories by `Session ID` w
|
|||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
By default, if the `Session ID` value is empty, it is set to match the the same value as the `Flow ID`.
|
||||
By default, if the `Session ID` value is empty, it is set to match the the same value as the `Flow ID`.
|
||||
|
||||
|
||||
You can also display all messages stored across every flow and session by going to **Settings** > **Messages**.
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ slug: /guides-data-message
|
|||
In Langflow, the `Data` and `Message` objects serve as structured, functional representations of data that enhance the capabilities and reliability of the platform.
|
||||
|
||||
|
||||
### The Data Object {#e0d56e463d2f483bb1b5df09d88bf309}
|
||||
## The Data Object {#e0d56e463d2f483bb1b5df09d88bf309}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The `Data` object is a Pydantic model that serves as a container for storing and manipulating data. It carries `data`—a dictionary that can be accessed as attributes—and uses `text_key` to specify which key in the dictionary should be considered the primary text content.
|
||||
|
|
@ -20,7 +23,7 @@ The `Data` object is a Pydantic model that serves as a container for storing a
|
|||
- `data`: A dictionary to store additional data.
|
||||
- `default_value`: default value when the `text_key` is not present in the `data` dictionary.
|
||||
|
||||
**Creating a Data Object:**
|
||||
### Creating a Data Object {#3540b7e651f74b558febebbe43380660}
|
||||
|
||||
|
||||
You can create a `Data` object by directly assigning key-value pairs to it. For example:
|
||||
|
|
@ -57,10 +60,13 @@ print(data.title) # Outputs: "Hello, World!" because "title" key is in the data
|
|||
The `Data` object is also convenient for visualization of outputs, since the output preview has visual elements to inspect data as a table and its cells as pop ups for basic types. The idea is to create a unified way to work and visualize complex information in Langflow.
|
||||
|
||||
|
||||
To receive `Data` objects in a component input, you can use the `DataInput` input type.
|
||||
To receive `Data` objects in a component input, you can use the `DataInput` input type.
|
||||
|
||||
|
||||
### The Message Object {#f4f17cad02a545068f407d515cbc2902}
|
||||
## The Message Object {#f4f17cad02a545068f407d515cbc2902}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The `Message` object extends the functionality of `Data` and includes additional attributes and methods for chat interactions.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ LangSmith is a full-lifecycle DevOps service from LangChain that provides monito
|
|||
|
||||
## Step-by-step Configuration {#b912579a43984f9a92921232b67c885d}
|
||||
|
||||
|
||||
---
|
||||
|
||||
1. Obtain your LangChain API key from [https://smith.langchain.com](https://smith.langchain.com/)
|
||||
2. Add the following keys to Langflow .env file:
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,13 @@ slug: /settings-global-variables
|
|||
|
||||
import ReactPlayer from "react-player";
|
||||
|
||||
>
|
||||
> ⚠️ WARNING
|
||||
> This page may contain outdated information. It will be updated as soon as possible.
|
||||
>
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
Global Variables are a useful feature of Langflow, allowing you to define reusable variables accessed from any Text field in your project.
|
||||
|
|
@ -24,7 +27,7 @@ Global Variables are a useful feature of Langflow, allowing you to define reusab
|
|||
- All Credential Global Variables are encrypted and accessible only by you.
|
||||
- Set _`LANGFLOW_STORE_ENVIRONMENT_VARIABLES`_ to _`true`_ in your `.env` file to add all variables in _`LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT`_ to your user's Global Variables.
|
||||
|
||||
## Create and Add a Global Variable {#3543d5ef00eb453aa459b97ba85501e5}
|
||||
### Create and Add a Global Variable {#3543d5ef00eb453aa459b97ba85501e5}
|
||||
|
||||
|
||||
To create and add a global variable, click the 🌐 button in a Text field, and then click **+ Add New Variable**.
|
||||
|
|
@ -46,9 +49,13 @@ You now have a `openai_api_key` global environment variable for your Langflow pr
|
|||
Subsequently, clicking the 🌐 button in a Text field will display the new variable in the dropdown.
|
||||
|
||||
|
||||
> 💡 TIP
|
||||
> You can also create global variables in Settings > Variables and Secrets.
|
||||
>
|
||||
:::tip
|
||||
|
||||
You can also create global variables in Settings > Variables and Secrets.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
|
@ -57,12 +64,7 @@ Subsequently, clicking the 🌐 button in a Text field will display the new vari
|
|||
To view and manage your project's global environment variables, visit **Settings** > **Variables and Secrets**.
|
||||
|
||||
|
||||
> ⚠️ WARNING
|
||||
> All Credential Global Variables are encrypted and accessible only by you.
|
||||
>
|
||||
|
||||
|
||||
## Configure Environment Variables in your .env file {#76844a93dbbc4d1ba551ea1a4a89ccdd}
|
||||
### Configure Environment Variables in your .env file {#76844a93dbbc4d1ba551ea1a4a89ccdd}
|
||||
|
||||
|
||||
Setting `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `true` in your `.env` file (default) adds all variables in `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT` to your user's Global Variables.
|
||||
|
|
@ -71,9 +73,13 @@ Setting `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `true` in your `.env` file (de
|
|||
These variables are accessible like any other Global Variable.
|
||||
|
||||
|
||||
> 💡 TIP
|
||||
> To prevent this behavior, set `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `false` in your `.env` file.
|
||||
>
|
||||
:::info
|
||||
|
||||
To prevent this behavior, set `LANGFLOW_STORE_ENVIRONMENT_VARIABLES` to `false` in your `.env` file.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
You can specify variables to get from the environment by listing them in `LANGFLOW_VARIABLES_TO_GET_FROM_ENVIRONMENT`.
|
||||
|
|
@ -106,5 +112,5 @@ The default list of variables includes the ones below and more:
|
|||
- VECTARA_CORPUS_ID
|
||||
- VECTARA_API_KEY
|
||||
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/7030d3ff-3ecd-44db-8640-9c2295b4e3bc/langflow_global_variables.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T220002Z&X-Amz-Expires=3600&X-Amz-Signature=bad6b33d89ef22b2d56becb6184c34cbc0ad51fc24d1a7d3b9f5d70d755506b1&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/7030d3ff-3ecd-44db-8640-9c2295b4e3bc/langflow_global_variables.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T232240Z&X-Amz-Expires=3600&X-Amz-Signature=463a0203fa466f5efc5812f6c991821c996ea46f0bcf0ba84177cab56d604621&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,13 @@ slug: /settings-project-general-settings
|
|||
|
||||
|
||||
|
||||
> ⚠️ WARNING
|
||||
> This page may contain outdated information. It will be updated as soon as possible.
|
||||
:::info
|
||||
|
||||
This page may contain outdated information. It will be updated as soon as possible.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
Change the **Project Settings** or **General Settings** for Langflow.
|
||||
|
|
@ -16,6 +21,9 @@ Change the **Project Settings** or **General Settings** for Langflow.
|
|||
## Project Settings {#71e61e6544c94f808cd74b8cc012363d}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Click **Project Name** > **Settings** to view your **Project Settings**.
|
||||
|
||||
- **Name** - the name of your project.
|
||||
|
|
@ -27,6 +35,9 @@ To use the default value, leave this field blank.
|
|||
## General Settings {#1a0c451fd5e84feeb1d18c2886d642eb}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Select your **Profile Picture** > **Settings** to view your **General Settings**.
|
||||
|
||||
|
||||
|
|
|
|||
BIN
docs/docs/Starter-Projects/1190998947.png
Normal file
|
After Width: | Height: | Size: 308 KiB |
|
Before Width: | Height: | Size: 270 KiB |
BIN
docs/docs/Starter-Projects/626991262.png
Normal file
|
After Width: | Height: | Size: 321 KiB |
|
Before Width: | Height: | Size: 239 KiB |
|
|
@ -17,22 +17,37 @@ This article demonstrates how to use Langflow's prompt tools to issue basic prom
|
|||
|
||||
## Prerequisites {#20bd7bc51ce04e2fb4922c95f00870d3}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- [Langflow installed and running](/getting-started-installation)
|
||||
- [OpenAI API key created](https://platform.openai.com/)
|
||||
|
||||
## Create the basic prompting project {#19d5305239c841548a695e2bf7839e7a}
|
||||
## Basic Prompting {#1fae0e83ef08453fba017870d6d981bc}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Create the basic prompting project {#19d5305239c841548a695e2bf7839e7a}
|
||||
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
|
||||

|
||||
|
||||
1. Select **Basic Prompting**.
|
||||
2. The **Basic Prompting** flow is created.
|
||||
|
||||
2. Select **Basic Prompting**.
|
||||
|
||||
|
||||
3. The **Basic Prompting** flow is created.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
This flow allows you to chat with the **OpenAI** component through the **Prompt** component.
|
||||
This flow allows you to chat with the **OpenAI** component through the **Prompt** component.
|
||||
|
||||
|
||||
Examine the **Prompt** component. The **Template** field instructs the LLM to `Answer the user as if you were a pirate.` This should be interesting...
|
||||
|
|
@ -40,7 +55,9 @@ Examine the **Prompt** component. The **Template** field instructs the LLM t
|
|||
|
||||

|
||||
|
||||
1. 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**.
|
||||
|
||||
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**.
|
||||
|
||||
1. In the **Variable Name** field, enter `openai_api_key`.
|
||||
2. In the **Value** field, paste your OpenAI API Key (`sk-...`).
|
||||
3. Click **Save Variable**.
|
||||
|
|
@ -48,12 +65,12 @@ Examine the **Prompt** component. The **Template** field instructs the LLM t
|
|||

|
||||
|
||||
|
||||
## Run {#ce52f8e6b491452a9dfb069feb962eed}
|
||||
### Run {#ce52f8e6b491452a9dfb069feb962eed}
|
||||
|
||||
1. Click the **Playground** button on the control panel (bottom right side of the workspace). This is where you can interact with your AI.
|
||||
2. Type a message and press Enter. The bot should respond in a markedly piratical manner!
|
||||
|
||||
## Modify the prompt for a different result {#3ab045fcbe774c8fb3adc528f9042ba0}
|
||||
### Modify the prompt for a different result {#3ab045fcbe774c8fb3adc528f9042ba0}
|
||||
|
||||
1. To modify your prompt results, in the **Prompt** template, click the **Template** field. The **Edit Prompt** window opens.
|
||||
2. Change `Answer the user as if you were a pirate` to a different character, perhaps `Answer the user as if you were Hermione Granger.`
|
||||
|
|
|
|||
|
|
@ -11,16 +11,25 @@ Build a blog writer with OpenAI that uses URLs for reference content.
|
|||
|
||||
## Prerequisites {#899268e6c12c49b59215373a38287507}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- [Langflow installed and running](/getting-started-installation)
|
||||
- [OpenAI API key created](https://platform.openai.com/)
|
||||
|
||||
## Create the Blog Writer project {#0c1a9c65b7d640f693ec3aad963416ff}
|
||||
## Blog Writer {#ef6e7555a96d4cbab169fbd2d8578bdc}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Create the Blog Writer project {#0c1a9c65b7d640f693ec3aad963416ff}
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
2. Select **Blog Writer**.
|
||||
3. A workspace for the **Blog Writer** is displayed.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
This flow creates a one-shot article generator with **Prompt**, **OpenAI**, and **Chat Output** components, augmented with reference content and instructions from the **URL** and **Instructions** components.
|
||||
|
|
@ -40,10 +49,7 @@ The `{instructions}` value is received from the **Instructions** component.
|
|||

|
||||
|
||||
|
||||
## Run the Blog Writer {#b93be7a567f5400293693b31b8d0f81a}
|
||||
|
||||
|
||||
---
|
||||
### Run the Blog Writer {#b93be7a567f5400293693b31b8d0f81a}
|
||||
|
||||
1. Click the **Playground** button. Here you can chat with the AI that has access to the **URL** content.
|
||||
2. Click the **Lighting Bolt** icon to run it.
|
||||
|
|
|
|||
|
|
@ -11,16 +11,25 @@ Build a question-and-answer chatbot with a document loaded from local memory.
|
|||
|
||||
## Prerequisites {#6555c100a30e4a21954af25e2e05403a}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- [Langflow installed and running](/getting-started-installation)
|
||||
- [OpenAI API key created](https://platform.openai.com/)
|
||||
|
||||
## Create the Document QA project {#204500104f024553aab2b633bb99f603}
|
||||
## Document QA {#acc90b19d4634c279b3e4e19e4e7ab1d}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Create the Document QA project {#204500104f024553aab2b633bb99f603}
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
2. Select **Document QA**.
|
||||
3. The **Document QA** project is created.
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
This flow is composed of a standard chatbot with the **Chat Input**, **Prompt**, **OpenAI**, and **Chat Output** components, but it also incorporates a **File** component, which loads a file from your local machine. **Parse Data** is used to convert the data from **File** into the **Prompt** component as `{Document}`. The **Prompt** component is instructed to answer questions based on the contents of `{Document}`. This gives the **OpenAI** component context it would not otherwise have access to.
|
||||
|
|
@ -29,11 +38,17 @@ This flow is composed of a standard chatbot with the **Chat Input**, **Prompt*
|
|||

|
||||
|
||||
|
||||
## Run the Document QA {#f58fcc2b9e594156a829b1772b6a7191}
|
||||
### Run the Document QA {#f58fcc2b9e594156a829b1772b6a7191}
|
||||
|
||||
|
||||
1. To select a document to load, in the **File** component, click the **Path** field. Select a local file, and then click **Open**. The file name appears in the field.
|
||||
|
||||
|
||||

|
||||
|
||||
1. Click the **Playground** button. Here you can chat with the AI that has access to your document's content.
|
||||
2. Type in a question about the document content and press Enter. You should see a contextual response.
|
||||
|
||||
2. Click the **Playground** button. Here you can chat with the AI that has access to your document's content.
|
||||
|
||||
|
||||
3. Type in a question about the document content and press Enter. You should see a contextual response.
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,19 @@ This flow extends the [Basic Prompting](http://localhost:3000/starter-projects/
|
|||
|
||||
## Prerequisites {#a71d73e99b1543bbba827207503cf31f}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- [Langflow installed and running](/getting-started-installation)
|
||||
- [OpenAI API key created](https://platform.openai.com/)
|
||||
|
||||
## Create the memory chatbot project {#70ce99381b7043a1b417a81e9ae74c72}
|
||||
## Memory Chatbot {#54073bf7eb1b4ff490c313f5612f0842}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Create the memory chatbot project {#70ce99381b7043a1b417a81e9ae74c72}
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
2. Select **Memory Chatbot**.
|
||||
|
|
@ -34,16 +43,19 @@ By clicking the template, you'll see the prompt editor like below:
|
|||
|
||||
This gives the **OpenAI** component a memory of previous chat messages.
|
||||
|
||||
1. Don't forget to [set up your OpenAI API key](http://localhost:3000/starter-projects/basic-prompting#open-ai)
|
||||
|
||||
## Run {#a110cad860584c98af1aead006035378}
|
||||
### Run {#a110cad860584c98af1aead006035378}
|
||||
|
||||
1. Open the Playground.
|
||||
2. Type multiple questions. In the **Memories** tab, your queries are logged in order. Up to 100 queries are stored by default. Try telling the AI your name and asking `What is my name?` on a second message, or `What is the first subject I asked you about?` to validate that previous knowledge is taking effect.
|
||||
|
||||
>
|
||||
> 💡 Check and adjust advanced parameters by opening the Advanced Settings of the **Chat Memory** component.
|
||||
>
|
||||
:::tip
|
||||
|
||||
Check and adjust advanced parameters by opening the Advanced Settings of the **Chat Memory** component.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||

|
||||
|
|
@ -52,6 +64,9 @@ This gives the **OpenAI** component a memory of previous chat messages.
|
|||
## Session ID {#4e68c3c0750942f98c45c1c45d7ffbbe}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
`SessionID` is a unique identifier in Langflow that stores conversation sessions between the AI and a user. A `SessionID` is created when a conversation is initiated, and then associated with all subsequent messages during that session.
|
||||
|
||||
|
||||
|
|
@ -61,9 +76,13 @@ In the **Memory Chatbot** flow you created, the **Chat Memory** component re
|
|||
2. Now, once you send a new message the **Playground**, you should have a new memory created on the **Memories** tab.
|
||||
3. Notice how your conversation is being stored in different memory sessions.
|
||||
|
||||
>
|
||||
> 💡 Every chat component in Langflow comes with a `SessionID`. It defaults to the flow ID. Explore how changing it affects what the AI remembers.
|
||||
>
|
||||
:::tip
|
||||
|
||||
Every chat component in Langflow comes with a `SessionID`. It defaults to the flow ID. Explore how changing it affects what the AI remembers.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
Learn more about memories in the [Chat Memory](/guides-chat-memory) section.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ We've chosen [Astra DB](https://astra.datastax.com/signup?utm_source=langflow-p
|
|||
|
||||
## Prerequisites {#6aa2c6dff6894eccadc39d4903d79e66}
|
||||
|
||||
|
||||
---
|
||||
|
||||
- [Langflow installed and running](http://localhost:3000/getting-started/install-langflow)
|
||||
- [OpenAI API key](https://platform.openai.com/)
|
||||
- [An Astra DB vector database created](https://docs.datastax.com/en/astra-db-serverless/get-started/quickstart.html) with:
|
||||
|
|
@ -29,7 +32,13 @@ We've chosen [Astra DB](https://astra.datastax.com/signup?utm_source=langflow-p
|
|||

|
||||
|
||||
|
||||
## Create the vector store RAG project {#e3ed64193e5e448f81279e1d54ba43cf}
|
||||
## Vector Store RAG {#1c37d15332f94cfe8f6e11dc6cc8a4ea}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
### Create the vector store RAG project {#e3ed64193e5e448f81279e1d54ba43cf}
|
||||
|
||||
1. From the Langflow dashboard, click **New Project**.
|
||||
2. Select **Vector Store RAG**.
|
||||
|
|
@ -41,12 +50,16 @@ We've chosen [Astra DB](https://astra.datastax.com/signup?utm_source=langflow-p
|
|||
The vector store RAG flow is built of two separate flows. Ingestion and query.
|
||||
|
||||
|
||||
The **ingestion** part (bottom of the screen) populates the vector store with data from a local file. It ingests data from a file (**File**), splits it into chunks (**Split Text**), indexes it in Astra DB (**Astra DB**), and computes embeddings for the chunks using an embedding model (**OpenAI Embeddings**).
|
||||
The **ingestion** part (bottom of the screen) populates the vector store with data from a local file. It ingests data from a file (**File**), splits it into chunks (**Split Text**), indexes it in Astra DB (**Astra DB**), and computes embeddings for the chunks using an embedding model (**OpenAI Embeddings**).
|
||||
|
||||
|
||||
:::tip
|
||||
|
||||
Embeddings are numerical vectors that represent data meaningfully. They enable efficient similarity searches in vector stores by placing similar items close together in the vector space, enhancing search and recommendation tasks.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
>
|
||||
> 💡 Embeddings are numerical vectors that represent data meaningfully. They enable efficient similarity searches in vector stores by placing similar items close together in the vector space, enhancing search and recommendation tasks.
|
||||
>
|
||||
|
||||
|
||||
This part creates a searchable index to be queried for contextual similarity.
|
||||
|
|
@ -73,7 +86,7 @@ The **query** part (top of the screen) allows users to retrieve embedded vecto
|
|||
5. Repeat the above steps for the **API Endpoint** field, pasting your Astra API Endpoint instead (`https://ASTRA_DB_ID-ASTRA_DB_REGION.apps.astra.datastax.com`).
|
||||
6. Add the global variable to both the **Astra DB** and **Astra DB Search** components.
|
||||
|
||||
## Run the Vector Store RAG {#815a6536d2d548d987f0f4e375a58b15}
|
||||
### Run the Vector Store RAG {#815a6536d2d548d987f0f4e375a58b15}
|
||||
|
||||
1. Click the **Playground** button. Here you can chat with the AI that uses context from the database you created.
|
||||
2. Type a message and press Enter. (Try something like "What topics do you know about?")
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ We introduced folders on the home page to help categorize flows and components.
|
|||
### Playground {#27649918dcb64a0ebae83db767bfe2eb}
|
||||
|
||||
|
||||
By having a clear definition of Inputs and Outputs, we could build the experience around that, which led us to create the Playground.
|
||||
By having a clear definition of Inputs and Outputs, we could build the experience around that, which led us to create the Playground.
|
||||
|
||||
|
||||
When building a project, testing and debugging are crucial. The Playground is an interface that changes dynamically based on the Inputs and Outputs you defined in your project.
|
||||
|
|
|
|||
|
|
@ -36,10 +36,13 @@ The **Python Code** tab displays code to interact with your flow's `.json` f
|
|||
The **Tweaks** tab displays the available parameters for your flow. Modifying the parameters changes the code parameters across all windows. For example, changing the **Chat Input** component's `input_value` will change that value across all API calls.
|
||||
|
||||
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/d4b5f648-d99f-47cc-9ac6-986e1c32a71d/langflow_api.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T215853Z&X-Amz-Expires=3600&X-Amz-Signature=04dac9770b972cad199be655db11a8e81d293b5eba4a32b10fa680487f850650&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/d4b5f648-d99f-47cc-9ac6-986e1c32a71d/langflow_api.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T232153Z&X-Amz-Expires=3600&X-Amz-Signature=bd499e71c606d6c2e3adf576abbfb5ce39105a0166bd9f7fdaa1e1a63529c64b&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
|
||||
|
||||
### Chat Widget HTML {#48f121a6cb3243979a341753da0c2700}
|
||||
## Chat Widget {#48f121a6cb3243979a341753da0c2700}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The **Chat Widget HTML** tab displays code that can be inserted in the `<body>` of your HTML to interact with your flow.
|
||||
|
|
@ -63,67 +66,83 @@ Clicking the Chat Widget HTML tab, you'll get the code to be inserted. Read belo
|
|||
The Chat Widget can be embedded into any HTML page, inside a `<body>` tag, as demonstrated in the video below.
|
||||
|
||||
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/01200476-f343-41e1-8be7-059250e0ce5e/langflow_widget.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T215853Z&X-Amz-Expires=3600&X-Amz-Signature=20a6051ace6798a47ce595026a856286f81facd75ad04adae75edf0368d30c0e&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/01200476-f343-41e1-8be7-059250e0ce5e/langflow_widget.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T232153Z&X-Amz-Expires=3600&X-Amz-Signature=e0430a3c60852de518287b6dbb8e3437663b880dee6d5d0016e21a257c21a6c8&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
|
||||
|
||||
### Embed your flow with React {#fe5d3b1c42e74e4c84ebc9d1799b7665}
|
||||
|
||||
1. To embed the Chat Widget using React, insert this `<script>` tag into the React _index.html_ file, inside the `<body>`tag:
|
||||
|
||||
To embed the Chat Widget using React, insert this `<script>` tag into the React _index.html_ file, inside the `<body>`tag:
|
||||
|
||||
|
||||
```javascript
|
||||
<script src="https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"></script>
|
||||
```
|
||||
|
||||
1. Declare your Web Component and encapsulate it in a React component.
|
||||
|
||||
|
||||
Declare your Web Component and encapsulate it in a React component.
|
||||
|
||||
|
||||
```javascript
|
||||
declare global { namespace JSX { interface IntrinsicElements { "langflow-chat": any; } }}export default function ChatWidget({ className }) { return ( <div className={className}> <langflow-chat chat_inputs='{"your_key":"value"}' chat_input_field="your_chat_key" flow_id="your_flow_id" host_url="langflow_url" ></langflow-chat> </div> );}
|
||||
```
|
||||
|
||||
1. Finally, you can place the component anywhere in your code to display the Chat Widget.
|
||||
|
||||
---
|
||||
|
||||
Finally, you can place the component anywhere in your code to display the Chat Widget.
|
||||
|
||||
|
||||
### Embed your flow with Angular {#4fd87355b9aa409894acfbb9e1497980}
|
||||
|
||||
1. To use the chat widget in Angular, first add this `<script>` tag into the Angular _index.html_ file, inside the `<body>` tag.
|
||||
|
||||
To use the chat widget in Angular, first add this `<script>` tag into the Angular _index.html_ file, inside the `<body>` tag.
|
||||
|
||||
|
||||
```javascript
|
||||
<script src="https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@main/dist/build/static/js/bundle.min.js"></script>
|
||||
```
|
||||
|
||||
1. When you use a custom web component in an Angular template, the Angular compiler might show a warning when it doesn't recognize the custom elements by default. To suppress this warning, add `CUSTOM_ELEMENTS_SCHEMA` to the module's `@NgModule.schemas`.
|
||||
2. Open the module file (it typically ends with _.module.ts_) where you'd add the `langflow-chat` web component.
|
||||
3. Import `CUSTOM_ELEMENTS_SCHEMA` at the top of the file:
|
||||
|
||||
|
||||
When you use a custom web component in an Angular template, the Angular compiler might show a warning when it doesn't recognize the custom elements by default. To suppress this warning, add `CUSTOM_ELEMENTS_SCHEMA` to the module's `@NgModule.schemas`.
|
||||
|
||||
- Open the module file (it typically ends with _.module.ts_) where you'd add the `langflow-chat` web component.
|
||||
- Import `CUSTOM_ELEMENTS_SCHEMA` at the top of the file:
|
||||
|
||||
`import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";`
|
||||
|
||||
1. Add `CUSTOM_ELEMENTS_SCHEMA` to the 'schemas' array inside the '@NgModule' decorator:
|
||||
- Add `CUSTOM_ELEMENTS_SCHEMA` to the 'schemas' array inside the '@NgModule' decorator:
|
||||
|
||||
```javascript
|
||||
@NgModule({ declarations: [ // ... Other components and directives ... ], imports: [ // ... Other imported modules ... ], schemas: [CUSTOM_ELEMENTS_SCHEMA], // Add the CUSTOM_ELEMENTS_SCHEMA here})export class YourModule {}
|
||||
```
|
||||
|
||||
1. In your Angular project, find the component belonging to the module where `CUSTOM_ELEMENTS_SCHEMA` was added. Inside the template, add the `langflow-chat` tag to include the Chat Widget in your component's view:
|
||||
|
||||
|
||||
In your Angular project, find the component belonging to the module where `CUSTOM_ELEMENTS_SCHEMA` was added. Inside the template, add the `langflow-chat` tag to include the Chat Widget in your component's view:
|
||||
|
||||
|
||||
```javascript
|
||||
<langflow-chat chat_inputs='{"your_key":"value"}' chat_input_field="your_chat_key" flow_id="your_flow_id" host_url="langflow_url"></langflow-chat>
|
||||
```
|
||||
|
||||
|
||||
INFO
|
||||
:::tip
|
||||
|
||||
`CUSTOM_ELEMENTS_SCHEMA` is a built-in schema that allows Angular to recognize custom elements. Adding `CUSTOM_ELEMENTS_SCHEMA` tells Angular to allow custom elements in your templates, and it will suppress the warning related to unknown elements like `langflow-chat`. Notice that you can only use the Chat Widget in components that are part of the module where you added `CUSTOM_ELEMENTS_SCHEMA`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
## Chat Widget Configuration {#5ede4bbbd2ac43e29c90f3edb43cba58}
|
||||
|
||||
- `CUSTOM_ELEMENTS_SCHEMA` is a built-in schema that allows Angular to recognize custom elements.
|
||||
- Adding `CUSTOM_ELEMENTS_SCHEMA` tells Angular to allow custom elements in your templates, and it will suppress the warning related to unknown elements like `langflow-chat`.
|
||||
- Notice that you can only use the Chat Widget in components that are part of the module where you added `CUSTOM_ELEMENTS_SCHEMA`.
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Chat widget configuration {#5ede4bbbd2ac43e29c90f3edb43cba58}
|
||||
|
||||
|
||||
Use the widget API to customize your Chat Widget:
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,24 +9,25 @@ import ReactPlayer from "react-player";
|
|||
The **Playground** is a dynamic interface designed for real-time interaction with AIs, allowing users to chat, access memories and monitor inputs and outputs. Here, users can directly prototype and their models, making adjustments and observing different outcomes.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
As long as you have an [Input or Output](/components-io) component working, you can open it up by clicking the **Playground** button.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
>
|
||||
> 💡 Notice how the **Playground's** window arrangement changes depending on what components are being used. Langflow can be used for applications that go beyond chat-based interfaces.
|
||||
>
|
||||
:::tip
|
||||
|
||||
Notice how the **Playground's** window arrangement changes depending on what components are being used. Langflow can be used for applications that go beyond chat-based interfaces.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
|
||||
|
||||
You can also open a flow's **Playground** without entering its workspace. From **My Collections** or **Langflow Store**, click the **Playground** in one of the projects card.
|
||||
|
||||
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/80ac6543-5548-4751-94fd-ddca60c23e62/langflow_playground.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T215851Z&X-Amz-Expires=3600&X-Amz-Signature=47ab219c1220fd83e433fd9199f597045bf9b6829313a7686dea70bd7b35afb5&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
<ReactPlayer controls url="https://prod-files-secure.s3.us-west-2.amazonaws.com/09f11537-5a5b-4f56-9e8d-de8ebcfae549/80ac6543-5548-4751-94fd-ddca60c23e62/langflow_playground.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=AKIAT73L2G45HZZMZUHI%2F20240712%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20240712T232151Z&X-Amz-Expires=3600&X-Amz-Signature=368f36f4aeb440a76c48960cc542c28dfc4f536686a32d8338b1dc66414b1588&X-Amz-SignedHeaders=host&x-id=GetObject" />
|
||||
|
||||
|
||||
## Memory Management {#821a5ee2a8a44d35b49943cba630511c}
|
||||
|
|
@ -38,8 +39,5 @@ You can also open a flow's **Playground** without entering its workspace. From *
|
|||
Whenever you send a message from the **Playground** interface, under the **Memories** **Tab** you'll see a table of previous interactions for that session.
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. To learn more about how to use memories in Langflow, see [Chat Memory](/guides-chat-memory).
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ slug: /workspace
|
|||
---
|
||||
|
||||
|
||||
The **Langflow Workspace** is where you assemble new flows and create AIs by connecting and running components.
|
||||
The **Langflow Workspace** is where you assemble new flows and create AIs by connecting and running components.
|
||||
|
||||
|
||||

|
||||
|
|
@ -21,9 +21,6 @@ The **Langflow Workspace** is where you assemble new flows and create AIs by c
|
|||
### Sidebar {#9d571b1d46804a01bcd8fbb9a4677af4}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
Located on the left, this the sidebar includes several collapsible sections that categorize the different types of pre-built components available in Langflow. Use the search bar to locate components by name.
|
||||
|
||||
|
||||
|
|
@ -33,9 +30,6 @@ Located on the left, this the sidebar includes several collapsible sections that
|
|||
### Canvas {#5b050d0f8406436a9201f4711f0063ae}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The canvas is the main area in the center where you can drag and drop components to create workflows.
|
||||
|
||||
|
||||
|
|
@ -48,9 +42,6 @@ Use canvas controls in the bottom left side for zooming in and out, resetting th
|
|||
### Top Navigation Bar {#603c9941be154e1eba4e7c9ec9554b92}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
In the top navigation bar, the dropdown menu labeled with the project name offers several management and customization options for the current flow in the Langflow Workspace.
|
||||
|
||||
|
||||
|
|
@ -68,9 +59,6 @@ In the top navigation bar, the dropdown menu labeled with the project name offer
|
|||
### Toolbar {#8038bcc315c34350a1f587e1ad0de59f}
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
The toolbar at the bottom-right corner that provides options for executing, accessing the API, and sharing workflows.
|
||||
|
||||
|
||||
|
|
|
|||