merge fix

This commit is contained in:
cristhianzl 2024-04-08 12:56:28 -03:00
commit 357029865f
72 changed files with 2282 additions and 2558 deletions

View file

@ -2,10 +2,6 @@ import Admonition from "@theme/Admonition";
# Embeddings
Embeddings are vector representations of text that capture the semantic meaning of the text. They are created using text embedding models and allow us to think about the text in a vector space, enabling us to perform tasks like semantic search, where we look for pieces of text that are most similar in the vector space.
---
### Amazon Bedrock Embeddings
Used to load [Amazon Bedrocks’s](https://aws.amazon.com/bedrock/) embedding models.
@ -127,7 +123,12 @@ Used to load [OpenAI’s](https://openai.com/) embedding models.
Wrapper around [Google Vertex AI](https://cloud.google.com/vertex-ai) [Embeddings API](https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings).
<Admonition type="info">
Vertex AI is a cloud computing platform offered by Google Cloud Platform (GCP). It provides access, management, and development of applications and services through global data centers. To use Vertex AI PaLM, you need to have the [google-cloud-aiplatform](https://pypi.org/project/google-cloud-aiplatform/) Python package installed and credentials configured for your environment.
Vertex AI is a cloud computing platform offered by Google Cloud Platform
(GCP). It provides access, management, and development of applications and
services through global data centers. To use Vertex AI PaLM, you need to have
the
[google-cloud-aiplatform](https://pypi.org/project/google-cloud-aiplatform/)
Python package installed and credentials configured for your environment.
</Admonition>
- **credentials:** The default custom credentials (google.auth.credentials.Credentials) to use.

View file

@ -1,13 +1,7 @@
import Admonition from '@theme/Admonition';
import Admonition from "@theme/Admonition";
# Models
<Admonition type="caution" icon="🚧" title="ZONE UNDER CONSTRUCTION">
<p>
We appreciate your understanding as we polish our documentation – it may contain some rough edges. Share your feedback or report issues to help us improve! 🛠️📝
</p>
</Admonition>
### Amazon Bedrock
This component facilitates the generation of text using the LLM (Large Language Model) model from Amazon Bedrock.
@ -19,16 +13,17 @@ This component facilitates the generation of text using the LLM (Large Language
- **System Message (Optional):** A system message to pass to the model.
- **Model ID (Optional):** Specifies the model ID to be used for text generation. Defaults to _`"anthropic.claude-instant-v1"`_. Available options include:
- _`"ai21.j2-grande-instruct"`_
- _`"ai21.j2-jumbo-instruct"`_
- _`"ai21.j2-mid"`_
- _`"ai21.j2-mid-v1"`_
- _`"ai21.j2-ultra"`_
- _`"ai21.j2-ultra-v1"`_
- _`"anthropic.claude-instant-v1"`_
- _`"anthropic.claude-v1"`_
- _`"anthropic.claude-v2"`_
- _`"cohere.command-text-v14"`_
- _`"ai21.j2-grande-instruct"`_
- _`"ai21.j2-jumbo-instruct"`_
- _`"ai21.j2-mid"`_
- _`"ai21.j2-mid-v1"`_
- _`"ai21.j2-ultra"`_
- _`"ai21.j2-ultra-v1"`_
- _`"anthropic.claude-instant-v1"`_
- _`"anthropic.claude-v1"`_
- _`"anthropic.claude-v2"`_
- _`"cohere.command-text-v14"`_
- **Credentials Profile Name (Optional):** Specifies the name of the credentials profile.
@ -45,12 +40,12 @@ This component facilitates the generation of text using the LLM (Large Language
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to _`False`_.
<Admonition type="note" title="Note">
<p>
Ensure that necessary credentials are provided to connect to the Amazon Bedrock API. If connection fails, a ValueError will be raised.
</p>
<p>
Ensure that necessary credentials are provided to connect to the Amazon
Bedrock API. If connection fails, a ValueError will be raised.
</p>
</Admonition>
---
### Anthropic
@ -60,10 +55,11 @@ This component allows the generation of text using Anthropic Chat&Completion lar
**Params**
- **Model Name:** Specifies the name of the Anthropic model to be used for text generation. Available options include:
- _`"claude-2.1"`_
- _`"claude-2.0"`_
- _`"claude-instant-1.2"`_
- _`"claude-instant-1"`_
- _`"claude-2.1"`_
- _`"claude-2.0"`_
- _`"claude-instant-1.2"`_
- _`"claude-instant-1"`_
- **Anthropic API Key:** Your Anthropic API key.
@ -90,25 +86,27 @@ This component allows the generation of text using the LLM (Large Language Model
**Params**
- **Model Name:** Specifies the name of the Azure OpenAI model to be used for text generation. Available options include:
- _`"gpt-35-turbo"`_
- _`"gpt-35-turbo-16k"`_
- _`"gpt-35-turbo-instruct"`_
- _`"gpt-4"`_
- _`"gpt-4-32k"`_
- _`"gpt-4-vision"`_
- _`"gpt-35-turbo"`_
- _`"gpt-35-turbo-16k"`_
- _`"gpt-35-turbo-instruct"`_
- _`"gpt-4"`_
- _`"gpt-4-32k"`_
- _`"gpt-4-vision"`_
- **Azure Endpoint:** Your Azure endpoint, including the resource. Example: `https://example-resource.azure.openai.com/`.
- **Deployment Name:** Specifies the name of the deployment.
- **API Version:** Specifies the version of the Azure OpenAI API to be used. Available options include:
- _`"2023-03-15-preview"`_
- _`"2023-05-15"`_
- _`"2023-06-01-preview"`_
- _`"2023-07-01-preview"`_
- _`"2023-08-01-preview"`_
- _`"2023-09-01-preview"`_
- _`"2023-12-01-preview"`_
- _`"2023-03-15-preview"`_
- _`"2023-05-15"`_
- _`"2023-06-01-preview"`_
- _`"2023-07-01-preview"`_
- _`"2023-08-01-preview"`_
- _`"2023-09-01-preview"`_
- _`"2023-12-01-preview"`_
- **API Key:** Your Azure OpenAI API key.
@ -124,7 +122,6 @@ This component allows the generation of text using the LLM (Large Language Model
For detailed documentation and integration guides, please refer to the [Azure OpenAI Component Documentation](https://python.langchain.com/docs/integrations/llms/azure_openai).
---
### Cohere
@ -197,6 +194,29 @@ This component facilitates text generation using LLM models from the Hugging Fac
---
### LiteLLM Model
Generates text using the `LiteLLM` collection of large language models.
**Parameters**
- **Model name:** The name of the model to use. For example, `gpt-3.5-turbo`. (Type: str)
- **API key:** The API key to use for accessing the provider's API. (Type: str, Optional)
- **Provider:** The provider of the API key. (Type: str, Choices: "OpenAI", "Azure", "Anthropic", "Replicate", "Cohere", "OpenRouter")
- **Temperature:** Controls the randomness of the text generation. (Type: float, Default: 0.7)
- **Model kwargs:** Additional keyword arguments for the model. (Type: Dict, Optional)
- **Top p:** Filter responses to keep the cumulative probability within the top p tokens. (Type: float, Optional)
- **Top k:** Filter responses to only include the top k tokens. (Type: int, Optional)
- **N:** Number of chat completions to generate for each prompt. (Type: int, Default: 1)
- **Max tokens:** The maximum number of tokens to generate for each chat completion. (Type: int, Default: 256)
- **Max retries:** Maximum number of retries for failed requests. (Type: int, Default: 6)
- **Verbose:** Whether to print verbose output. (Type: bool, Default: False)
- **Input:** The input prompt for text generation. (Type: str)
- **Stream:** Whether to stream the output. (Type: bool, Default: False)
- **System message:** System message to pass to the model. (Type: str, Optional)
---
### Ollama
Generate text using Ollama Local LLMs.
@ -248,7 +268,7 @@ This component facilitates text generation using OpenAI's models.
- **OpenAI API Base (Optional):** The base URL of the OpenAI API. Defaults to _`https://api.openai.com/v1`_.
- **OpenAI API Key (Optional):** The API key for accessing the OpenAI API.
- **OpenAI API Key (Optional):** The API key for accessing the OpenAI API.
- **Temperature:** Controls the creativity of model responses. Defaults to _`0.7`_.
@ -265,16 +285,17 @@ This component facilitates the generation of text using Baidu Qianfan chat model
**Params**
- **Model Name:** Specifies the name of the Qianfan chat model to be used for text generation. Available options include:
- _`"ERNIE-Bot"`_
- _`"ERNIE-Bot-turbo"`_
- _`"BLOOMZ-7B"`_
- _`"Llama-2-7b-chat"`_
- _`"Llama-2-13b-chat"`_
- _`"Llama-2-70b-chat"`_
- _`"Qianfan-BLOOMZ-7B-compressed"`_
- _`"Qianfan-Chinese-Llama-2-7B"`_
- _`"ChatGLM2-6B-32K"`_
- _`"AquilaChat-7B"`_
- _`"ERNIE-Bot"`_
- _`"ERNIE-Bot-turbo"`_
- _`"BLOOMZ-7B"`_
- _`"Llama-2-7b-chat"`_
- _`"Llama-2-13b-chat"`_
- _`"Llama-2-70b-chat"`_
- _`"Qianfan-BLOOMZ-7B-compressed"`_
- _`"Qianfan-Chinese-Llama-2-7B"`_
- _`"ChatGLM2-6B-32K"`_
- _`"AquilaChat-7B"`_
- **Qianfan Ak:** Your Baidu Qianfan access key, obtainable from [here](https://cloud.baidu.com/product/wenxinworkshop).
@ -326,4 +347,4 @@ The `ChatVertexAI` is a component for generating text using Vertex AI Chat large
- **Stream (Optional):** Specifies whether to stream the response from the model. Defaults to _`False`_.
- **System Message (Optional):** System message to pass to the model.
- **System Message (Optional):** System message to pass to the model.

View file

@ -2,14 +2,6 @@ import Admonition from "@theme/Admonition";
# Vector Stores
<Admonition type="caution" icon="🚧" title="ZONE UNDER CONSTRUCTION">
<p>
We appreciate your understanding as we polish our documentation – it may
contain some rough edges. Share your feedback or report issues to help us
improve! 🛠️📝
</p>
</Admonition>
### Astra DB
The `Astra DB` is a component for initializing an Astra DB Vector Store from Records. It facilitates the creation of Astra DB-based vector indexes for efficient document storage and retrieval.

View file

@ -1,6 +1,5 @@
# 🖥️ Command Line Interface (CLI)
## Overview
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.
@ -8,9 +7,9 @@ Langflow's Command Line Interface (CLI) is a powerful tool that allows you to in
Running the CLI without any arguments will display a list of available commands and options.
```bash
langflow --help
python -m langflow --help
# or
langflow
python -m langflow
```
Each option is detailed below:

View file

@ -366,7 +366,7 @@ For advanced customization, Langflow offers the option to create and load custom
### Folder Structure
Create a folder that follows the same structural conventions as the [config.yaml](https://github.com/logspace-ai/langflow/blob/dev/src/backend/langflow/config.yaml) file. Inside this main directory, use a `custom_components` subdirectory for your custom components.
Create a folder that follows the same structural conventions as the [config.yaml](https://github.com/logspace-ai/langflow/blob/dev/src/backend/base/langflow/config.yaml) file. Inside this main directory, use a `custom_components` subdirectory for your custom components.
Inside `custom_components`, you can create a Python file for each component. Similarly, any custom agents should be housed in an `agents` subdirectory.

View file

@ -41,14 +41,12 @@ The Code button shows snippets to use your flow as a Python object or an API.
**Python Code**
Through the Langflow package, you can load a flow from a JSON file and use it as a LangChain object.
Through the Langflow package, you can run your flow from a JSON file. The example below shows how to run a flow from a JSON file.
```python
from langflow.load import load_flow_from_json
from langflow.load import run_flow_from_json
flow = load_flow_from_json("path/to/flow.json")
# Now you can use it like any chain
flow("Hey, have you heard of Langflow?")
results = run_flow_from_json("path/to/flow.json", input_value="Hello, World!")
```
**API**

View file

View file

View file

View file

View file

@ -0,0 +1,186 @@
import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";
import ZoomableImage from "/src/theme/ZoomableImage.js";
import Admonition from "@theme/Admonition";
# 🌟 RAG with Astra DB
This guide will walk you through how to build a RAG (Retrieval Augmented Generation) application using **Astra DB** and **Langflow**.
[Astra DB](https://www.datastax.com/products/datastax-astra?utm_source=langflow-pre-release&utm_medium=referral&utm_campaign=langflow-announcement&utm_content=astradb) is a cloud-native database built on Apache Cassandra that is optimized for the cloud. It is a fully managed database-as-a-service that simplifies operations and reduces costs. Astra DB is built on the same technology that powers the largest Cassandra deployments in the world.
In this guide, we will use Astra DB as a vector store to store and retrieve the documents that will be used by the RAG application to generate responses.
<Admonition type="tip">
This guide assumes that you have Langflow up and running. If you are new to
Langflow, you can check out the [Getting Started](/) guide.
</Admonition>
TLDR;
- [Create a free Astra DB account](https://astra.datastax.com/signup?utm_source=langflow-pre-release&utm_medium=referral&utm_campaign=langflow-announcement&utm_content=create-a-free-astra-db-account)
- Duplicate our [Langflow 1.0 Space](https://huggingface.co/spaces/Langflow/Langflow-Preview?duplicate=true)
- Create a new database, get a **Token** and the **API Endpoint**
- Click on the **New Project** button and look for Vector Store RAG. This will create a new project with the necessary components
- Import the project into Langflow by dropping it on the Canvas or My Collection page
- Update the **Token** and **API Endpoint** in the **Astra DB** components
- Update the OpenAI API key in the **OpenAI** components
- Run the ingestion flow which is the one that uses the **Astra DB** component
- Click on the ⚡ _Run_ button and start interacting with your RAG application
# First things first
## Create an Astra DB Database
To get started, you will need to [create an Astra DB database](https://astra.datastax.com/signup?utm_source=langflow-pre-release&utm_medium=referral&utm_campaign=langflow-announcement&utm_content=create-an-astradb-database).
Once you have created an account, you will be taken to the Astra DB dashboard. Click on the **Create Database** button.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-create-database.png",
dark: "img/astra-create-database.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
Now you will need to configure your database. Choose the **Serverless (Vector)** deployment type, and pick a Database name, provider and region.
After you have configured your database, click on the **Create Database** button.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-configure-deployment.png",
dark: "img/astra-configure-deployment.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
Once your database is initialized, to the right of the page, you will see the _Database Details_ section which contains a button for you to copy the **API Endpoint** and another to generate a **Token**.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-generate-token.png",
dark: "img/astra-generate-token.png",
}}
style={{ width: "50%", margin: "20px auto" }}
/>
Now we are all set to start building our RAG application using Astra DB and Langflow.
## (Optional) Duplicate the Langflow 1.0 HuggingFace Space
If you haven't already, now is the time to launch Langflow. To make things easier, you can duplicate our [Langflow 1.0 Space](https://huggingface.co/spaces/Langflow/Langflow-Preview?duplicate=true) which sets up a Langflow instance just for you.
## Open the Vector Store RAG Project
To get started, click on the **New Project** button and look for the **Vector Store RAG** project. This will open a starter project with the necessary components to run a RAG application using Astra DB.
This project consists of two flows. The simpler one is the **Ingestion Flow** which is responsible for ingesting the documents into the Astra DB database.
Your first step should be to understand what each flow does and how they interact with each other.
The ingestion flow consists of:
- **Files** component that uploads a text file to Langflow
- **Recursive Character Text Splitter** component that splits the text into smaller chunks
- **OpenAIEmbeddings** component that generates embeddings for the text chunks
- **Astra DB** component that stores the text chunks in the Astra DB database
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-ingestion-flow.png",
dark: "img/astra-ingestion-flow.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
Now, let's update the **Astra DB** and **Astra DB Search** components with the **Token** and **API Endpoint** that we generated earlier, and the OpenAI Embeddings components with your OpenAI API key.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-ingestion-fields.png",
dark: "img/astra-ingestion-fields.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
And run it! This will ingest the Text data from your file into the Astra DB database.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-ingestion-run.png",
dark: "img/astra-ingestion-run.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
Now, on to the **RAG Flow**. This flow is responsible for generating responses to your queries. It will define all of the steps from getting the User's input to generating a response and displaying it in the Interaction Panel.
The RAG flow is a bit more complex. It consists of:
- **Chat Input** component that defines where to put the user input coming from the Interaction Panel
- **OpenAI Embeddings** component that generates embeddings from the user input
- **Astra DB Search** component that retrieves the most relevant Records from the Astra DB database
- **Text Output** component that turns the Records into Text by concatenating them and also displays it in the Interaction Panel
- One interesting point you'll see here is that this component is named `Extracted Chunks`, and that is how it will appear in the Interaction Panel
- **Prompt** component that takes in the user input and the retrieved Records as text and builds a prompt for the OpenAI model
- **OpenAI** component that generates a response to the prompt
- **Chat Output** component that displays the response in the Interaction Panel
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-rag-flow.png",
dark: "img/astra-rag-flow.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
To run it all we have to do is click on the ⚡ _Run_ button and start interacting with your RAG application.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-rag-flow-run.png",
dark: "img/astra-rag-flow-run.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
This opens the Interaction Panel where you can chat your data.
Because this flow has a **Chat Input** and a **Text Output** component, the Panel displays a chat input at the bottom and the Extracted Chunks section on the left.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-rag-flow-interaction-panel.png",
dark: "img/astra-rag-flow-interaction-panel.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
Once we interact with it we get a response and the Extracted Chunks section is updated with the retrieved records.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/astra-rag-flow-interaction-panel-interaction.png",
dark: "img/astra-rag-flow-interaction-panel-interaction.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
And that's it! You have successfully ran a RAG application using Astra DB and Langflow.
# Conclusion
In this guide, we have learned how to run a RAG application using Astra DB and Langflow.
We have seen how to create an Astra DB database, import the Astra DB RAG Flows project into Langflow, and run the ingestion and RAG flows.

View file

@ -1,6 +1,13 @@
import ThemedImage from "@theme/ThemedImage";
import useBaseUrl from "@docusaurus/useBaseUrl";
import ZoomableImage from "/src/theme/ZoomableImage.js";
import Admonition from "@theme/Admonition";
# 👋 Welcome to Langflow
Langflow is an easy way to build from simple to complex AI applications. It is a low-code platform that allows you to integrate AI into everything you do.
{" "}
# 👋 Welcome to Langflow
@ -30,7 +37,8 @@ You can install **Langflow** with [pipx](https://pipx.pypa.io/stable/installatio
Pipx can fetch the missing Python version for you, but you can also install it manually.
```bash
pip install langflow -U
# Remember to check if you have Python 3.10 installed
python -m pip install langflow -U
# or
pipx install langflow --python python3.10 --fetch-missing-python
```
@ -38,11 +46,19 @@ pipx install langflow --python python3.10 --fetch-missing-python
Or you can install a pre-release version using:
```bash
pip install langflow --pre --force-reinstall
python -m pip install langflow --pre --force-reinstall
# or
pipx install langflow --python python3.10 --fetch-missing-python --pip-args="--pre --force-reinstall"
```
<Admonition type="tip">
<p>
Please, check out our [Possible Installation Issues
section](/migration/possible-installation-issues) if you encounter any
problems.
</p>
</Admonition>
We recommend using --force-reinstall to ensure you have the latest version of Langflow and its dependencies.
### ⛓️ Running Langflow
@ -50,14 +66,14 @@ We recommend using --force-reinstall to ensure you have the latest version of La
Langflow can be run in a variety of ways, including using the command-line interface (CLI) or HuggingFace Spaces.
```bash
langflow run # or langflow --help
python -m langflow run # or langflow --help
```
#### 🤗 HuggingFace Spaces
Hugging Face provides a great alternative for running Langflow in their Spaces environment. This means you can run Langflow without any local installation required.
The first step is to go to the [Langflow Space](https://huggingface.co/spaces/Logspace/Langflow?duplicate=true).
The first step is to go to the [Langflow Space](https://huggingface.co/spaces/Langflow/Langflow?duplicate=true) or [Langflow 1.0 Preview Space](https://huggingface.co/spaces/Langflow/Langflow-Preview?duplicate=true)
Remember to use a Chromium-based browser for the best experience. You'll be presented with the following screen:
@ -91,5 +107,17 @@ langflow run [OPTIONS]
Find more information about the available options by running:
```bash
langflow --help
python -m langflow --help
```
## Find out more about 1.0
<Admonition type="caution" icon="🚧" title="ZONE UNDER CONSTRUCTION">
<p>
We are currently working on updating the documentation for Langflow 1.0.
</p>
</Admonition>
To get you learning more about what's new and why you should be excited about Langflow 1.0,
go to [A new chapter for Langflow](/whats-new/a-new-chapter-langflow) and also come back often
to check out our [migration guides](/whats-new/migrating-to-one-point-zero) as we release them.

View file

@ -1,12 +1,12 @@
import Admonition from '@theme/Admonition';
import Admonition from "@theme/Admonition";
import ZoomableImage from "/src/theme/ZoomableImage.js";
# Compatibility with Previous Versions
## TLDR;
- You'll need to add a few components to your flow to make it compatible with the new version of Langflow.
- Add a Runnable Executor, connect it to the last component (a Chain or an Agent) in your flow, and connect a Chat Input and a Chat Output to the Runnable Executor. This should work *most of the time*.
- Add a Runnable Executor, connect it to the last component (a Chain or an Agent) in your flow, and connect a Chat Input and a Chat Output to the Runnable Executor. This should work _most of the time_.
- You might also need to update the Chain or Agent component to the latest version.
- Most Components will work as they are, but you'll need to add an Input and an Output to your flow.
- You can use the Runnable Executor to run a LangChain runnable (which is the output of many components before 1.0)
@ -22,23 +22,31 @@ We've tried to make it as easy as possible for you to adapt your existing flows
## How to Adapt Your Existing Flows
The steps to take are few but not always simple. Here's how you can adapt your existing flows to work seamlessly in the new version of Langflow:
<Admonition type="caution">
<p>**Caution:**</p>
<p>While this should work most of the time, it might not work for all flows. You might need to update the Chain or Agent component to the latest version. Please let us know if you encounter any issues.</p>
<p>
While this should work most of the time, it might not work for all flows.
You might need to update the Chain or Agent component to the latest version.
Please let us know if you encounter any issues.
</p>
</Admonition>
1. **Check if your flow ends with a Chain or Agent component**.
- If it does not, it *should* work as it is because it probably was not a chat flow.
- If it does not, it _should_ work as it is because it probably was not a chat flow.
2. **Add a Runnable Executor**.
- Add a Runnable Executor to the end of your flow.
- Connect the last component (a Chain or an Agent) in your flow to the Runnable Executor.
- Add a Runnable Executor to the end of your flow.
- Connect the last component (a Chain or an Agent) in your flow to the Runnable Executor.
3. **Add a Chat Input and a Chat Output**.
- Add a Chat Input and a Chat Output to your flow.
- Connect the Chat Input to the Runnable Executor.
- Connect the Chat Output to the Runnable Executor.
{/* Add picture of the flow */}
- Add a Chat Input and a Chat Output to your flow.
- Connect the Chat Input to the Runnable Executor.
- Connect the Chat Output to the Runnable Executor.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/runnable-executor.png",
dark: "img/runnable-executor.png",
}}
style={{ width: "100%", margin: "20px auto" }}
/>

View file

@ -0,0 +1,27 @@
# Possible Installation Issues
This is a list of possible issues that you may encounter when installing Langflow 1.0 Alpha and how to solve them.
## _`No module named 'langflow.__main__'`_
TLDR;
- Run _`python -m langflow run`_ instead of _`langflow run`_. If that doesn't work, run _`_python -m pip install langflow --pre -U`_ to reinstall langflow.
- If the above doesn't work, run _`python -m pip install langflow --pre -U --force-reinstall`_ to reinstall langflow and its dependencies.
When you try to run langflow using the command `langflow run`, you may encounter the following error:
```bash
> langflow run
Traceback (most recent call last):
File ".../langflow", line 5, in <module>
from langflow.__main__ import main
ModuleNotFoundError: No module named 'langflow.__main__'
```
For this error to occur, two scenarios are possible:
1. You've installed langflow using _`pip install langflow`_ but you already had a previous version of langflow installed in your system.
In this case, you might not be running the correct executable.
To solve this issue, you can run the correct executable by running _`python -m langflow run`_ instead of _`langflow run`_ and if that doesn't work, you can try uninstalling langflow and reinstalling it using _`python -m pip install langflow --pre -U`_.
2. Some version conflicts might have occurred during the installation process. Run _`python -m pip install langflow --pre -U --force-reinstall`_ to reinstall langflow and its dependencies.

View file

@ -0,0 +1,45 @@
# Text and Record
In Langflow 1.0 we added two main input and output types: Text and Record. Text is a simple string input and output type, while Record is a structure very similar to a dictionary in Python. It is a key-value pair data structure.
We've created a few components to help you work with these types. Let's see how a few of them work.
### Records To Text
This is a Component that takes in Records and outputs a Text. It does this using a template string and concatenating the values of the Record, one per line.
If we have the following Records:
```json
{
"sender_name": "Alice",
"message": "Hello!"
}
{
"sender_name": "John",
"message": "Hi!"
}
```
And the template string is: _`{sender_name}: {message}`_
```
Alice: Hello!
John: Hi!
```
### Create Record
This Component allows you to create a Record from a number of inputs. You can add as many key-value pairs as you want (as long as it is less than 15 😅). Once you've picked that number you'll need to write the name of the Key and can pass Text values from other components to it.
### Documents To Records
This Component takes in a [LangChain](https://langchain.com) Document and outputs a Record. It does this by extracting the _`page_content`_ and the _`metadata`_ from the Document and adding them to the Record as _`text`_ and _`data`_ respectively.
## Why is this useful?
The idea was to create a unified way to work with complex data in Langflow, and to make it easier to work with data that is not just a simple string. This way you can create more complex workflows and use the data in more ways.
## What's next?
We are planning to integrate an array of modalities to Langflow, such as images, audio, and video. This will allow you to create even more complex workflows and use cases. Stay tuned for more updates! 🚀

View file

@ -2,7 +2,7 @@
# First things first
Thank you all for being part of the Langflow community. The journey so far has been amazing and we are happy to have you with us.
**Thank you all for being part of the Langflow community**. The journey so far has been amazing and we are happy to have you with us.
We have some exciting news to share with you. Langflow is changing, and we want to tell you all about it.
@ -61,11 +61,11 @@ We wanted to create start projects that would help you learn about new features
For now, we have:
- **[Basic Prompting (Ahoy World!)](/getting-started/basic-prompting)**: A simple flow that shows you how to use the Prompt Component and how to talk like a pirate.
- **[Vector Store RAG](/getting-started/rag-with-astradb)**: A flow that shows you how to ingest data into a Vector Store and then use it to run a RAG application.
- **[Memory Chatbot](/getting-started/memory-chatbot)**: This one shows you how to create a simple chatbot that can remember things about the user.
- **[Document QA](/getting-started/document-qa)**: This flow shows you how to build a simple flow that helps you get answers about a document.
- **[Blog Writer](/getting-started/blog-writer)**: Shows you how you can expand on the Prompt variables and be creative about what inputs you add to it.
- **[Basic Prompting (Hello, world!)](/guides/basic-prompting)**: A simple flow that shows you how to use the Prompt Component and how to talk like a pirate.
- **[Vector Store RAG](/guides/rag-with-astradb)**: A flow that shows you how to ingest data into a Vector Store and then use it to run a RAG application.
- **[Memory Chatbot](/guides/memory-chatbot)**: This one shows you how to create a simple chatbot that can remember things about the user.
- **[Document QA](/guides/document-qa)**: This flow shows you how to build a simple flow that helps you get answers about a document.
- **[Blog Writer](/guides/blog-writer)**: Shows you how you can expand on the Prompt variables and be creative about what inputs you add to it.
As always, your feedback is invaluable, so please let us know what you think of the new starter projects and what you would like to see in the future.

View file

@ -1,5 +1,16 @@
import Admonition from "@theme/Admonition";
# Migrating to Langflow 1.0: A Guide
<Admonition type="caution" icon="🚧" title="ZONE UNDER CONSTRUCTION">
<p>
We are currently working on updating this guide to provide the most accurate
and up-to-date information on migrating to Langflow 1.0. We will be adding
more content and examples to help you navigate the changes and improvements
in the new version.
</p>
</Admonition>
Langflow 1.0 is a significant update that brings many exciting changes and improvements to the platform.
This guide will walk you through the key improvements and help you migrate your existing projects to the new version.
@ -42,19 +53,19 @@ We will create guides on how to interweave LangChain components with our Core co
Langflow 1.0 continues to support LangChain while also introducing support for multiple frameworks. This is another important boon that adding the paradigm of data flow brings to the table. Find out how to leverage the power of different frameworks in your projects.
[Learn more about Supported Frameworks](../migration/supported-frameworks)
**Guide coming soon**
## Sidebar Redesign and Customizable Interaction Panel
We've expanded on the chat experience by creating a customizable interaction panel that allows you to design a panel that fits your needs and interact with it. The sidebar has also been redesigned to provide a more intuitive and user-friendly experience. Explore the new sidebar and interaction panel features to enhance your workflow.
[Learn more about some of the UI updates](../migration/sidebar-and-interaction-panel)
**Guide coming soon**
## New Native Categories and Components
Langflow 1.0 introduces many new native categories, including Inputs, Outputs, Helpers, Experimental, Models, and more. Discover the new components available, such as Chat Input, Prompt, Files, API Request, and others.
[Learn more about New Categories and Components](../migration/new-categories-and-components)
**Guide coming soon**
## New Way of Using Langflow: Text and Record (and more to come)
@ -66,7 +77,7 @@ With the introduction of Text and Record types connections between Components ar
Almost all components in Langflow 1.0 are now CustomComponents, allowing you to check and modify the code of each component. Discover how to leverage this feature to customize your components to your specific needs.
[Learn more about CustomComponent](../migration/custom-component)
**Guide coming soon**
## Compatibility with Previous Versions
@ -78,31 +89,31 @@ To use flows built in previous versions of Langflow, you can utilize the experim
Langflow 1.0 allows you to have more than one flow in the canvas and run them separately. Discover how to create and manage multiple flows within a single project.
[Learn more about Multiple Flows](../migration/multiple-flows)
**Guide coming soon**
## Improved Component Status
Each component now displays its status more clearly, allowing you to quickly identify any issues or errors. Explore how to use the new component status feature to troubleshoot and optimize your flows.
[Learn more about Component Status](../migration/component-status-and-data-passing)
**Guide coming soon**
## Connecting Output Components
You can now connect Output components to any other component (that has a Text output), providing a better understanding of the data flow. Explore the possibilities of connecting Output components and how it enhances your flow's functionality.
[Learn more about Connecting Output Components](../migration/connecting-output-components)
**Guide coming soon**
## Renaming and Editing Component Descriptions
Langflow 1.0 allows you to rename and edit the description of each component, making it easier to understand and interact with the flow. Learn how to customize your component names and descriptions for improved clarity.
[Learn more about Renaming and Editing Components](../migration/renaming-and-editing-components)
**Guide coming soon**
## Passing Tweaks and Inputs in the API
Things got a whole lot easier. You can now pass tweaks and inputs in the API by referencing the Display Name of the component. Discover how to leverage this feature to dynamically control your flow's behavior.
[Learn more about Passing Tweaks and Inputs](../migration/passing-tweaks-and-inputs)
**Guide coming soon**
## Global Variables for Text Fields
@ -114,12 +125,12 @@ Global Variables can be used in any Text Field across your projects. Learn how t
Explore the experimental components available in Langflow 1.0, such as SubFlow, which allows you to load a flow as a component dynamically, and Flow as Tool, which enables you to use a flow as a tool for an Agent.
[Learn more about Experimental Components](../migration/experimental-components)
**Guide coming soon**
## Experimental State Management System
We are experimenting with a State Management system for flows that allows components to trigger other components and pass messages between them using the Notify and Listen components. Discover how to leverage this system to create more dynamic and interactive flows.
[Learn more about State Management](../migration/state-management)
**Guide coming soon**
We hope this guide helps you navigate the changes and improvements in Langflow 1.0. If you have any questions or need further assistance, please don't hesitate to reach out to us in our [Discord](https://discord.gg/wZSWQaukgJ).
We hope this guide helps you navigate the changes and improvements in Langflow 1.0. If you have any questions or need further assistance, please don't hesitate to reach out to us in our [Discord](https://discord.gg/wZSWQaukgJ).

View file

@ -7,11 +7,11 @@ module.exports = {
items: [
"index",
"getting-started/cli",
"getting-started/basic-prompting",
"getting-started/document-qa",
"getting-started/blog-writer",
"getting-started/memory-chatbot",
"getting-started/rag-with-astradb",
// "guides/basic-prompting",
// "guides/document-qa",
// "guides/blog-writer",
// "guides/memory-chatbot",
"guides/rag-with-astradb",
],
},
{
@ -29,18 +29,19 @@ module.exports = {
label: " Migration Guides",
collapsed: false,
items: [
"migration/possible-installation-issues",
// "migration/flow-of-data",
"migration/inputs-and-outputs",
// "migration/supported-frameworks",
"migration/sidebar-and-interaction-panel",
"migration/new-categories-and-components",
// "migration/sidebar-and-interaction-panel",
// "migration/new-categories-and-components",
"migration/text-and-record",
// "migration/custom-component",
"migration/compatibility",
"migration/multiple-flows",
"migration/component-status-and-data-passing",
// "migration/multiple-flows",
// "migration/component-status-and-data-passing",
// "migration/connecting-output-components",
"migration/renaming-and-editing-components",
// "migration/renaming-and-editing-components",
// "migration/passing-tweaks-and-inputs",
"migration/global-variables",
// "migration/experimental-components",
@ -55,17 +56,17 @@ module.exports = {
"guidelines/login",
"guidelines/api",
"guidelines/components",
"guidelines/features",
// "guidelines/features",
"guidelines/collection",
"guidelines/prompt-customization",
"guidelines/chat-interface",
"guidelines/chat-widget",
"guidelines/custom-component",
// "guidelines/chat-interface",
// "guidelines/chat-widget",
// "guidelines/custom-component",
],
},
{
type: "category",
label: "Step-by-Step Guides",
label: "Extended Components",
collapsed: false,
items: ["guides/langfuse_integration"],
},
@ -101,20 +102,20 @@ module.exports = {
"components/tools",
],
},
{
type: "category",
label: "Examples",
collapsed: false,
items: [
"examples/flow-runner",
"examples/conversation-chain",
"examples/buffer-memory",
"examples/csv-loader",
"examples/searchapi-tool",
"examples/serp-api-tool",
"examples/python-function",
],
},
// {
// type: "category",
// label: "Examples",
// collapsed: false,
// items: [
// // "examples/flow-runner",
// // "examples/conversation-chain",
// // "examples/buffer-memory",
// // "examples/csv-loader",
// // "examples/searchapi-tool",
// // "examples/serp-api-tool",
// // "examples/python-function",
// ],
// },
{
type: "category",
label: "Deployment",

BIN
docs/static/img/hero.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

BIN
docs/static/img/runnable-executor.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB