docs: update docs from notion (#2684)
Co-authored-by: lucaseduoli <lucaseduoli@users.noreply.github.com>
This commit is contained in:
parent
6756ef22b7
commit
b731983f31
51 changed files with 533 additions and 232 deletions
BIN
docs/docs/Starter-Projects/1190998947.png
Normal file
BIN
docs/docs/Starter-Projects/1190998947.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 308 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 270 KiB |
BIN
docs/docs/Starter-Projects/626991262.png
Normal file
BIN
docs/docs/Starter-Projects/626991262.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 321 KiB |
Binary file not shown.
|
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?")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue