Another batch of renaming Record to Data
This commit is contained in:
parent
e827789a09
commit
16089ea5b2
61 changed files with 283 additions and 441 deletions
|
|
@ -44,9 +44,13 @@ Adding or removing any of the below components modifies your Playground so you c
|
|||
- Text Input
|
||||
- Chat Output
|
||||
- Text Output
|
||||
- Records Output
|
||||
- Data Output
|
||||
- Inspect Memory
|
||||
|
||||
You can also select **Options** > **Logs** to see your flow's logs.
|
||||
|
||||
For more information, see [Inputs and Outputs](../components/inputs-and-outputs.mdx).
|
||||
For more information, see [Inputs and Outputs](../components/inputs-and-outputs.mdx).import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import ReactPlayer from "react-player";
|
||||
import Admonition from "@theme/Admonition";
|
||||
|
|
|
|||
|
|
@ -112,18 +112,18 @@ Call this component without parameters to list all flows.
|
|||
|
||||
---
|
||||
|
||||
## Merge Records
|
||||
## Merge Data
|
||||
|
||||
This component merges a list of records.
|
||||
This component merges a list of Data.
|
||||
|
||||
**Parameters**
|
||||
|
||||
- **Records:**
|
||||
- **Display Name:** Records
|
||||
- **Data:**
|
||||
- **Display Name:** Data
|
||||
|
||||
**Usage**
|
||||
|
||||
Provide the records you want to merge.
|
||||
Provide the Data you want to merge.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -59,13 +59,13 @@ Learn more about creating custom components at [Custom Component](http://docs.la
|
|||
|
||||
---
|
||||
|
||||
### Documents to records
|
||||
### Documents to Data
|
||||
|
||||
Convert LangChain documents into records.
|
||||
Convert LangChain documents into Data.
|
||||
|
||||
#### Parameters
|
||||
|
||||
- **Documents:** Documents to be converted into records.
|
||||
- **Documents:** Documents to be converted into Data.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -93,14 +93,14 @@ Retrieves stored chat messages based on a specific session ID.
|
|||
|
||||
---
|
||||
|
||||
### Records to text
|
||||
### Data to text
|
||||
|
||||
Convert records into plain text following a specified template.
|
||||
Convert Data into plain text following a specified template.
|
||||
|
||||
#### Parameters
|
||||
|
||||
- **Records:** The records to convert to text.
|
||||
- **Template:** The template used for formatting the records. It can contain keys like `{text}`, `{data}`, or any other key in the record.
|
||||
- **Data:** The Data to convert to text.
|
||||
- **Template:** The template used for formatting the Data. It can contain keys like `{text}`, `{data}`, or any other key in the record.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ In Langflow 1.0, we added two main input and output types: `Text` and `Data`.
|
|||
|
||||
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
|
||||
## Data 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 `Data`, one per line.
|
||||
This is a component that takes in Data and outputs a `Text`. It does this using a template string and concatenating the values of the `Data`, one per line.
|
||||
|
||||
If we have the following Records:
|
||||
If we have the following Data:
|
||||
|
||||
```json
|
||||
{
|
||||
|
|
@ -36,7 +36,7 @@ John: Hi!
|
|||
|
||||
This component allows you to create a `Data` 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
|
||||
## Documents To Data
|
||||
|
||||
This component takes in a LangChain `Document` and outputs a `Data`. It does this by extracting the `page_content` and the `metadata` from the `Document` and adding them to the `Data` as text and data respectively.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,11 @@ import Admonition from "@theme/Admonition";
|
|||
|
||||
### Astra DB
|
||||
|
||||
The `Astra DB` initializes a vector store using Astra DB from records. It creates Astra DB-based vector indexes to efficiently store and retrieve documents.
|
||||
The `Astra DB` initializes a vector store using Astra DB from Data. It creates Astra DB-based vector indexes to efficiently store and retrieve documents.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
- **Input:** Documents or records for input.
|
||||
- **Input:** Documents or Data for input.
|
||||
- **Embedding:** Embedding model Astra DB uses.
|
||||
- **Collection Name:** Name of the Astra DB collection.
|
||||
- **Token:** Authentication token for Astra DB.
|
||||
|
|
@ -99,12 +99,12 @@ For detailed documentation and integration guides, please refer to the [Chroma C
|
|||
|
||||
### Couchbase
|
||||
|
||||
`Couchbase` builds a Couchbase vector store from records, streamlining the storage and retrieval of documents.
|
||||
`Couchbase` builds a Couchbase vector store from Data, streamlining the storage and retrieval of documents.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
- **Embedding:** Model used by Couchbase.
|
||||
- **Input:** Documents or records.
|
||||
- **Input:** Documents or Data.
|
||||
- **Couchbase Cluster Connection String:** Cluster Connection string.
|
||||
- **Couchbase Cluster Username:** Cluster Username.
|
||||
- **Couchbase Cluster Password:** Cluster Password.
|
||||
|
|
@ -165,12 +165,12 @@ For more details, see the [FAISS Component Documentation](https://faiss.ai/index
|
|||
|
||||
### MongoDB Atlas
|
||||
|
||||
`MongoDBAtlas` builds a MongoDB Atlas-based vector store from records, streamlining the storage and retrieval of documents.
|
||||
`MongoDBAtlas` builds a MongoDB Atlas-based vector store from Data, streamlining the storage and retrieval of documents.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
- **Embedding:** Model used by MongoDB Atlas.
|
||||
- **Input:** Documents or records.
|
||||
- **Input:** Documents or Data.
|
||||
- **Collection Name:** Collection identifier in MongoDB Atlas.
|
||||
- **Database Name:** Database identifier.
|
||||
- **Index Name:** Index identifier.
|
||||
|
|
@ -235,11 +235,11 @@ For more details, see the [PGVector Component Documentation](https://python.lang
|
|||
|
||||
### Pinecone
|
||||
|
||||
`Pinecone` constructs a Pinecone wrapper from records, setting up Pinecone-based vector indexes for document storage and retrieval.
|
||||
`Pinecone` constructs a Pinecone wrapper from Data, setting up Pinecone-based vector indexes for document storage and retrieval.
|
||||
|
||||
**Parameters:**
|
||||
|
||||
- **Input:** Documents or records.
|
||||
- **Input:** Documents or Data.
|
||||
- **Embedding:** Model used.
|
||||
- **Index Name:** Index identifier.
|
||||
- **Namespace:** Namespace used.
|
||||
|
|
@ -278,7 +278,7 @@ For more details, see the [PGVector Component Documentation](https://python.lang
|
|||
|
||||
**Parameters:**
|
||||
|
||||
- **Input:** Documents or records.
|
||||
- **Input:** Documents or Data.
|
||||
- **Embedding:** Model used.
|
||||
- **API Key:** Qdrant API key.
|
||||
- **Collection Name:** Collection identifier.
|
||||
|
|
@ -345,7 +345,7 @@ For detailed documentation, refer to the [Redis Documentation](https://python.la
|
|||
|
||||
**Parameters:**
|
||||
|
||||
- **Input:** Documents or records.
|
||||
- **Input:** Documents or data.
|
||||
- **Embedding:** Model used.
|
||||
- **Query Name:** Optional query name.
|
||||
- **Search Kwargs:** Advanced search parameters.
|
||||
|
|
|
|||
|
|
@ -8,14 +8,13 @@ import Admonition from "@theme/Admonition";
|
|||
|
||||
In Langflow, a `Data` has a structure very similar to a Python dictionary. It is a key-value pair data structure.
|
||||
|
||||
The **Create Data** component allows you to dynamically create a `Data` from a specified 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 chosen the number of `Records`, add keys and fill up values, or pass on values from other components to the component using the input handles.
|
||||
The **Create Data** component allows you to dynamically create a `Data` from a specified 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 chosen the number of `Data`, add keys and fill up values, or pass on values from other components to the component using the input handles.
|
||||
|
||||
<div
|
||||
style={{ marginBottom: "20px", display: "flex", justifyContent: "center" }}
|
||||
>
|
||||
<ReactPlayer playing controls url="/videos/create_record.mp4" />
|
||||
</div>
|
||||
import ThemedImage from "@theme/ThemedImage"; import useBaseUrl from
|
||||
"@docusaurus/useBaseUrl"; import ZoomableImage from
|
||||
"/src/theme/ZoomableImage.js"; import ReactPlayer from "react-player"; import
|
||||
Admonition from "@theme/Admonition";
|
||||
import ThemedImage from "@theme/ThemedImage"; import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js"; import ReactPlayer from
|
||||
"react-player"; import Admonition from "@theme/Admonition";
|
||||
|
|
|
|||
|
|
@ -136,10 +136,10 @@ 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 Playground
|
||||
- **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 Playground
|
||||
- **Astra DB Search** component that retrieves the most relevant Data from the Astra DB database
|
||||
- **Text Output** component that turns the Data into Text by concatenating them and also displays it in the Playground
|
||||
- One interesting point you'll see here is that this component is named `Extracted Chunks`, and that is how it will appear in the Playground
|
||||
- **Prompt** component that takes in the user input and the retrieved Records as text and builds a prompt for the OpenAI model
|
||||
- **Prompt** component that takes in the user input and the retrieved Data 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 Playground
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ Because this flow has a **Chat Input** and a **Text Output** component, the Pane
|
|||
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.
|
||||
Once we interact with it we get a response and the Extracted Chunks section is updated with the retrieved data.
|
||||
|
||||
<ZoomableImage
|
||||
alt="Docusaurus themed image"
|
||||
|
|
@ -192,4 +192,16 @@ And that's it! You have successfully ran a RAG application using Astra DB and La
|
|||
# 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.
|
||||
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.import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class NotionListPages(CustomComponent):
|
|||
response.raise_for_status()
|
||||
|
||||
results = response.json()
|
||||
records = []
|
||||
data = []
|
||||
combined_text = f"Pages found: {len(results['results'])}\n\n"
|
||||
for page in results['results']:
|
||||
page_data = {
|
||||
|
|
@ -127,10 +127,10 @@ class NotionListPages(CustomComponent):
|
|||
)
|
||||
|
||||
combined_text += text
|
||||
records.append(Data(text=text, data=page_data))
|
||||
data.append(Data(text=text, data=page_data))
|
||||
|
||||
self.status = combined_text.strip()
|
||||
return records
|
||||
return data
|
||||
|
||||
except Exception as e:
|
||||
self.status = f"An error occurred: {str(e)}"
|
||||
|
|
|
|||
|
|
@ -65,14 +65,14 @@ class NotionUserList(CustomComponent):
|
|||
data = response.json()
|
||||
results = data['results']
|
||||
|
||||
records = []
|
||||
data = []
|
||||
for user in results:
|
||||
id = user['id']
|
||||
type = user['type']
|
||||
name = user.get('name', '')
|
||||
avatar_url = user.get('avatar_url', '')
|
||||
|
||||
record_data = {
|
||||
data_dict = {
|
||||
"id": id,
|
||||
"type": type,
|
||||
"name": name,
|
||||
|
|
@ -80,15 +80,15 @@ class NotionUserList(CustomComponent):
|
|||
}
|
||||
|
||||
output = "User:\n"
|
||||
for key, value in record_data.items():
|
||||
for key, value in data_dict.items():
|
||||
output += f"{key.replace('_', ' ').title()}: {value}\n"
|
||||
output += "________________________\n"
|
||||
|
||||
record = Data(text=output, data=record_data)
|
||||
records.append(record)
|
||||
record = Data(text=output, data=data_dict)
|
||||
data.append(record)
|
||||
|
||||
self.status = "\n".join(record.text for record in records)
|
||||
return records
|
||||
self.status = "\n".join(record.text for record in data)
|
||||
return data
|
||||
```
|
||||
|
||||
## Example Usage
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class NotionSearch(CustomComponent):
|
|||
response.raise_for_status()
|
||||
|
||||
results = response.json()
|
||||
records = []
|
||||
data = []
|
||||
combined_text = f"Results found: {len(results['results'])}\n\n"
|
||||
for result in results['results']:
|
||||
result_data = {
|
||||
|
|
@ -135,10 +135,10 @@ class NotionSearch(CustomComponent):
|
|||
|
||||
text += f"type: {result['object']}\nlast_edited_time: {result['last_edited_time']}\n\n"
|
||||
combined_text += text
|
||||
records.append(Data(text=text, data=result_data))
|
||||
data.append(Data(text=text, data=result_data))
|
||||
|
||||
self.status = combined_text
|
||||
return records
|
||||
return data
|
||||
|
||||
except Exception as e:
|
||||
self.status = f"An error occurred: {str(e)}"
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ The **query** flow (top of the screen) allows users to chat with the embedded ve
|
|||
|
||||
- **Chat Input** component defines where to put the user input coming from the Playground.
|
||||
- **OpenAI Embeddings** component generates embeddings from the user input.
|
||||
- **Astra DB Search** component retrieves the most relevant Records from the Astra DB database.
|
||||
- **Text Output** component turns the Records into Text by concatenating them and also displays it in the Playground.
|
||||
- **Prompt** component takes in the user input and the retrieved Records as text and builds a prompt for the OpenAI model.
|
||||
- **Astra DB Search** component retrieves the most relevant Data from the Astra DB database.
|
||||
- **Text Output** component turns the Data into Text by concatenating them and also displays it in the Playground.
|
||||
- **Prompt** component takes in the user input and the retrieved Data as text and builds a prompt for the OpenAI model.
|
||||
- **OpenAI** component generates a response to the prompt.
|
||||
- **Chat Output** component displays the response in the Playground.
|
||||
|
||||
|
|
@ -106,4 +106,16 @@ AI
|
|||
You should use a 3/8 inch wrench to remove the oil drain cap.
|
||||
```
|
||||
|
||||
This is the size the engine manual lists as well. This confirms our flow works, because the query returns the unique knowledge we embedded from the Astra vector store.
|
||||
This is the size the engine manual lists as well. This confirms our flow works, because the query returns the unique knowledge we embedded from the Astra vector store.import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import ReactPlayer from "react-player";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import ReactPlayer from "react-player";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import ReactPlayer from "react-player";
|
||||
import Admonition from "@theme/Admonition";
|
||||
|
|
|
|||
|
|
@ -130,10 +130,10 @@ 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 Playground
|
||||
- **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 Playground
|
||||
- **Astra DB Search** component that retrieves the most relevant Data from the Astra DB database
|
||||
- **Text Output** component that turns the Data into Text by concatenating them and also displays it in the Playground
|
||||
- One interesting point you'll see here is that this component is named `Extracted Chunks`, and that is how it will appear in the Playground
|
||||
- **Prompt** component that takes in the user input and the retrieved Records as text and builds a prompt for the OpenAI model
|
||||
- **Prompt** component that takes in the user input and the retrieved Data 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 Playground
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ Because this flow has a **Chat Input** and a **Text Output** component, the Pane
|
|||
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.
|
||||
Once we interact with it we get a response and the Extracted Chunks section is updated with the retrieved Data.
|
||||
|
||||
<ZoomableImage
|
||||
alt="Docusaurus themed image"
|
||||
|
|
@ -186,4 +186,16 @@ And that's it! You have successfully ran a RAG application using Astra DB and La
|
|||
# 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.
|
||||
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.import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";import ThemedImage from "@theme/ThemedImage";
|
||||
import useBaseUrl from "@docusaurus/useBaseUrl";
|
||||
import ZoomableImage from "/src/theme/ZoomableImage.js";
|
||||
import Admonition from "@theme/Admonition";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue