Enhanced Component Testing & General Test Fixes (#1585)

This pull request introduces comprehensive new tests for our components,
significantly improving our project's test coverage. In addition to the
new component tests, this PR addresses and resolves several issues that
were affecting our general test suite, enhancing its reliability and
efficiency.
This commit is contained in:
Cristhian Zanforlin Lousa 2024-04-08 14:08:15 -03:00 committed by GitHub
commit 452eb224d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 2472 additions and 640 deletions

View file

@ -1,9 +1,11 @@
<!-- markdownlint-disable MD030 -->
# [![Langflow](https://github.com/logspace-ai/langflow/blob/dev/docs/static/img/hero.png)](https://www.langflow.org)
### [Langflow](https://www.langflow.org) is a new, visual way to build, iterate and deploy AI apps.
# ⚡️ Documentation and Community
- [Documentation](https://docs.langflow.org)
- [Discord](https://discord.com/invite/EqksyE2EX9)

View file

@ -123,7 +123,12 @@ Used to load [OpenAIs](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,4 +1,4 @@
import Admonition from '@theme/Admonition';
import Admonition from "@theme/Admonition";
# Models
@ -13,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.
@ -39,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
@ -54,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.
@ -84,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.
@ -118,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
@ -265,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`_.
@ -282,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).
@ -343,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

@ -0,0 +1,195 @@
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.
<ZoomableImage
alt="Docusaurus themed image"
sources={{
light: "img/drag-and-drop-flow.png",
dark: "img/drag-and-drop-flow.png",
}}
style={{ width: "80%", margin: "20px auto" }}
/>
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

@ -9,6 +9,12 @@ Langflow is an easy way to build from simple to complex AI applications. It is a
{" "}
# 👋 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.
{" "}
{" "}
<ZoomableImage

View file

@ -66,7 +66,7 @@ module.exports = {
},
{
type: "category",
label: "Step-by-Step Guides",
label: "Extended Components",
collapsed: false,
items: ["guides/langfuse_integration"],
},

176
poetry.lock generated
View file

@ -1312,6 +1312,33 @@ tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.1
[package.extras]
toml = ["tomli"]
[[package]]
name = "crewai"
version = "0.22.5"
description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks."
optional = false
python-versions = ">=3.10,<=3.13"
files = [
{file = "crewai-0.22.5-py3-none-any.whl", hash = "sha256:9f254d8b2ebd7fae9a43d0ebab116a3f536c6620ca3bc955cb796fc8bb9beb7d"},
{file = "crewai-0.22.5.tar.gz", hash = "sha256:03c76a04f46a432a1c3d9e5e0c8e039f983b25019194b0ab2ec594762ac380cf"},
]
[package.dependencies]
click = ">=8.1.7,<9.0.0"
instructor = ">=0.5.2,<0.6.0"
langchain = ">=0.1.10,<0.2.0"
langchain-openai = ">=0.0.5,<0.0.6"
openai = ">=1.13.3,<2.0.0"
opentelemetry-api = ">=1.22.0,<2.0.0"
opentelemetry-exporter-otlp-proto-http = ">=1.22.0,<2.0.0"
opentelemetry-sdk = ">=1.22.0,<2.0.0"
pydantic = ">=2.4.2,<3.0.0"
python-dotenv = "1.0.0"
regex = ">=2023.12.25,<2024.0.0"
[package.extras]
tools = ["crewai-tools (>=0.0.15,<0.0.16)"]
[[package]]
name = "cryptography"
version = "42.0.5"
@ -3293,6 +3320,26 @@ files = [
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
]
[[package]]
name = "instructor"
version = "0.5.2"
description = "structured outputs for llm"
optional = false
python-versions = ">=3.10,<4.0"
files = [
{file = "instructor-0.5.2-py3-none-any.whl", hash = "sha256:8c7c927f3cbf6cd863eeebceae3f021e27eaca2ceaf9e9f3c8204540a1126160"},
{file = "instructor-0.5.2.tar.gz", hash = "sha256:d8d679eb4624254db615794aaab59840e506fa696bc0181d998ae4f9ded2706d"},
]
[package.dependencies]
aiohttp = ">=3.9.1,<4.0.0"
docstring-parser = ">=0.15,<0.16"
openai = ">=1.1.0,<2.0.0"
pydantic = ">=2.0.2,<3.0.0"
rich = ">=13.7.0,<14.0.0"
tenacity = ">=8.2.3,<9.0.0"
typer = ">=0.9.0,<0.10.0"
[[package]]
name = "ipykernel"
version = "6.29.4"
@ -3739,6 +3786,37 @@ files = [
cohere = ">=5.1.4,<6.0.0"
langchain-core = ">=0.1.32,<0.2.0"
[[package]]
name = "langchain-astradb"
version = "0.1.0"
description = "An integration package connecting Astra DB and LangChain"
optional = false
python-versions = ">=3.8.1,<4.0"
files = [
{file = "langchain_astradb-0.1.0-py3-none-any.whl", hash = "sha256:c6686089da343fce8c31e36c9162323e88888300b09d56b72347a19449d7361f"},
{file = "langchain_astradb-0.1.0.tar.gz", hash = "sha256:c8a3426c9daa2beeec2dc7a718186b0b9c388082e9543e0bc07363712cc3b947"},
]
[package.dependencies]
astrapy = ">=0.7.7,<0.8.0"
langchain-core = ">=0.1.31,<0.2.0"
numpy = ">=1,<2"
[[package]]
name = "langchain-cohere"
version = "0.1.0"
description = "An integration package connecting Cohere and LangChain"
optional = false
python-versions = "<4.0,>=3.8.1"
files = [
{file = "langchain_cohere-0.1.0-py3-none-any.whl", hash = "sha256:f60e9eb41f7d4ead9659bddb3fae7aa18ddc3fdf2b2867be4bd8a565229f488d"},
{file = "langchain_cohere-0.1.0.tar.gz", hash = "sha256:960551293ea58d170fad37d44657d3ae4587f6b2e8f3f58922c53c59b9e9d85c"},
]
[package.dependencies]
cohere = ">=5.1.4,<6.0.0"
langchain-core = ">=0.1.32,<0.2.0"
[[package]]
name = "langchain-community"
version = "0.0.31"
@ -3837,7 +3915,7 @@ files = [
[package.dependencies]
langchain-core = ">=0.1.33,<0.2.0"
openai = ">=1.10.0,<2.0.0"
tiktoken = ">=0.5.2,<1"
tiktoken = ">=0.5.2,<0.6.0"
[[package]]
name = "langchain-text-splitters"
@ -5570,6 +5648,26 @@ opentelemetry-sdk = ">=1.24.0,<1.25.0"
[package.extras]
test = ["pytest-grpc"]
[[package]]
name = "opentelemetry-exporter-otlp-proto-http"
version = "1.24.0"
description = "OpenTelemetry Collector Protobuf over HTTP Exporter"
optional = false
python-versions = ">=3.8"
files = [
{file = "opentelemetry_exporter_otlp_proto_http-1.24.0-py3-none-any.whl", hash = "sha256:25af10e46fdf4cd3833175e42f4879a1255fc01655fe14c876183a2903949836"},
{file = "opentelemetry_exporter_otlp_proto_http-1.24.0.tar.gz", hash = "sha256:704c066cc96f5131881b75c0eac286cd73fc735c490b054838b4513254bd7850"},
]
[package.dependencies]
deprecated = ">=1.2.6"
googleapis-common-protos = ">=1.52,<2.0"
opentelemetry-api = ">=1.15,<2.0"
opentelemetry-exporter-otlp-proto-common = "1.24.0"
opentelemetry-proto = "1.24.0"
opentelemetry-sdk = ">=1.24.0,<1.25.0"
requests = ">=2.7,<3.0"
[[package]]
name = "opentelemetry-instrumentation"
version = "0.45b0"
@ -8293,7 +8391,7 @@ name = "shellingham"
version = "1.5.4"
description = "Tool to Detect Surrounding Shell"
optional = false
python-versions = ">=3.7"
python-versions = ">=3.6"
files = [
{file = "shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686"},
{file = "shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de"},
@ -8632,47 +8730,47 @@ files = [
[[package]]
name = "tiktoken"
version = "0.6.0"
version = "0.5.2"
description = "tiktoken is a fast BPE tokeniser for use with OpenAI's models"
optional = false
python-versions = ">=3.8"
files = [
{file = "tiktoken-0.6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:277de84ccd8fa12730a6b4067456e5cf72fef6300bea61d506c09e45658d41ac"},
{file = "tiktoken-0.6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9c44433f658064463650d61387623735641dcc4b6c999ca30bc0f8ba3fccaf5c"},
{file = "tiktoken-0.6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afb9a2a866ae6eef1995ab656744287a5ac95acc7e0491c33fad54d053288ad3"},
{file = "tiktoken-0.6.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c62c05b3109fefca26fedb2820452a050074ad8e5ad9803f4652977778177d9f"},
{file = "tiktoken-0.6.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0ef917fad0bccda07bfbad835525bbed5f3ab97a8a3e66526e48cdc3e7beacf7"},
{file = "tiktoken-0.6.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e095131ab6092d0769a2fda85aa260c7c383072daec599ba9d8b149d2a3f4d8b"},
{file = "tiktoken-0.6.0-cp310-cp310-win_amd64.whl", hash = "sha256:05b344c61779f815038292a19a0c6eb7098b63c8f865ff205abb9ea1b656030e"},
{file = "tiktoken-0.6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cefb9870fb55dca9e450e54dbf61f904aab9180ff6fe568b61f4db9564e78871"},
{file = "tiktoken-0.6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:702950d33d8cabc039845674107d2e6dcabbbb0990ef350f640661368df481bb"},
{file = "tiktoken-0.6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8d49d076058f23254f2aff9af603863c5c5f9ab095bc896bceed04f8f0b013a"},
{file = "tiktoken-0.6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:430bc4e650a2d23a789dc2cdca3b9e5e7eb3cd3935168d97d43518cbb1f9a911"},
{file = "tiktoken-0.6.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:293cb8669757301a3019a12d6770bd55bec38a4d3ee9978ddbe599d68976aca7"},
{file = "tiktoken-0.6.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7bd1a288b7903aadc054b0e16ea78e3171f70b670e7372432298c686ebf9dd47"},
{file = "tiktoken-0.6.0-cp311-cp311-win_amd64.whl", hash = "sha256:ac76e000183e3b749634968a45c7169b351e99936ef46f0d2353cd0d46c3118d"},
{file = "tiktoken-0.6.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:17cc8a4a3245ab7d935c83a2db6bb71619099d7284b884f4b2aea4c74f2f83e3"},
{file = "tiktoken-0.6.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:284aebcccffe1bba0d6571651317df6a5b376ff6cfed5aeb800c55df44c78177"},
{file = "tiktoken-0.6.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c1a3a5d33846f8cd9dd3b7897c1d45722f48625a587f8e6f3d3e85080559be8"},
{file = "tiktoken-0.6.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6318b2bb2337f38ee954fd5efa82632c6e5ced1d52a671370fa4b2eff1355e91"},
{file = "tiktoken-0.6.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1f5f0f2ed67ba16373f9a6013b68da298096b27cd4e1cf276d2d3868b5c7efd1"},
{file = "tiktoken-0.6.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:75af4c0b16609c2ad02581f3cdcd1fb698c7565091370bf6c0cf8624ffaba6dc"},
{file = "tiktoken-0.6.0-cp312-cp312-win_amd64.whl", hash = "sha256:45577faf9a9d383b8fd683e313cf6df88b6076c034f0a16da243bb1c139340c3"},
{file = "tiktoken-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7c1492ab90c21ca4d11cef3a236ee31a3e279bb21b3fc5b0e2210588c4209e68"},
{file = "tiktoken-0.6.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e2b380c5b7751272015400b26144a2bab4066ebb8daae9c3cd2a92c3b508fe5a"},
{file = "tiktoken-0.6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9f497598b9f58c99cbc0eb764b4a92272c14d5203fc713dd650b896a03a50ad"},
{file = "tiktoken-0.6.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e65e8bd6f3f279d80f1e1fbd5f588f036b9a5fa27690b7f0cc07021f1dfa0839"},
{file = "tiktoken-0.6.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5f1495450a54e564d236769d25bfefbf77727e232d7a8a378f97acddee08c1ae"},
{file = "tiktoken-0.6.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6c4e4857d99f6fb4670e928250835b21b68c59250520a1941618b5b4194e20c3"},
{file = "tiktoken-0.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:168d718f07a39b013032741867e789971346df8e89983fe3c0ef3fbd5a0b1cb9"},
{file = "tiktoken-0.6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:47fdcfe11bd55376785a6aea8ad1db967db7f66ea81aed5c43fad497521819a4"},
{file = "tiktoken-0.6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fb7d2ccbf1a7784810aff6b80b4012fb42c6fc37eaa68cb3b553801a5cc2d1fc"},
{file = "tiktoken-0.6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1ccb7a111ee76af5d876a729a347f8747d5ad548e1487eeea90eaf58894b3138"},
{file = "tiktoken-0.6.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2048e1086b48e3c8c6e2ceeac866561374cd57a84622fa49a6b245ffecb7744"},
{file = "tiktoken-0.6.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:07f229a5eb250b6403a61200199cecf0aac4aa23c3ecc1c11c1ca002cbb8f159"},
{file = "tiktoken-0.6.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:432aa3be8436177b0db5a2b3e7cc28fd6c693f783b2f8722539ba16a867d0c6a"},
{file = "tiktoken-0.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:8bfe8a19c8b5c40d121ee7938cd9c6a278e5b97dc035fd61714b4f0399d2f7a1"},
{file = "tiktoken-0.6.0.tar.gz", hash = "sha256:ace62a4ede83c75b0374a2ddfa4b76903cf483e9cb06247f566be3bf14e6beed"},
{file = "tiktoken-0.5.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8c4e654282ef05ec1bd06ead22141a9a1687991cef2c6a81bdd1284301abc71d"},
{file = "tiktoken-0.5.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:7b3134aa24319f42c27718c6967f3c1916a38a715a0fa73d33717ba121231307"},
{file = "tiktoken-0.5.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6092e6e77730929c8c6a51bb0d7cfdf1b72b63c4d033d6258d1f2ee81052e9e5"},
{file = "tiktoken-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72ad8ae2a747622efae75837abba59be6c15a8f31b4ac3c6156bc56ec7a8e631"},
{file = "tiktoken-0.5.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:51cba7c8711afa0b885445f0637f0fcc366740798c40b981f08c5f984e02c9d1"},
{file = "tiktoken-0.5.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:3d8c7d2c9313f8e92e987d585ee2ba0f7c40a0de84f4805b093b634f792124f5"},
{file = "tiktoken-0.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:692eca18c5fd8d1e0dde767f895c17686faaa102f37640e884eecb6854e7cca7"},
{file = "tiktoken-0.5.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:138d173abbf1ec75863ad68ca289d4da30caa3245f3c8d4bfb274c4d629a2f77"},
{file = "tiktoken-0.5.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7388fdd684690973fdc450b47dfd24d7f0cbe658f58a576169baef5ae4658607"},
{file = "tiktoken-0.5.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a114391790113bcff670c70c24e166a841f7ea8f47ee2fe0e71e08b49d0bf2d4"},
{file = "tiktoken-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ca96f001e69f6859dd52926d950cfcc610480e920e576183497ab954e645e6ac"},
{file = "tiktoken-0.5.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:15fed1dd88e30dfadcdd8e53a8927f04e1f6f81ad08a5ca824858a593ab476c7"},
{file = "tiktoken-0.5.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:93f8e692db5756f7ea8cb0cfca34638316dcf0841fb8469de8ed7f6a015ba0b0"},
{file = "tiktoken-0.5.2-cp311-cp311-win_amd64.whl", hash = "sha256:bcae1c4c92df2ffc4fe9f475bf8148dbb0ee2404743168bbeb9dcc4b79dc1fdd"},
{file = "tiktoken-0.5.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:b76a1e17d4eb4357d00f0622d9a48ffbb23401dcf36f9716d9bd9c8e79d421aa"},
{file = "tiktoken-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:01d8b171bb5df4035580bc26d4f5339a6fd58d06f069091899d4a798ea279d3e"},
{file = "tiktoken-0.5.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42adf7d4fb1ed8de6e0ff2e794a6a15005f056a0d83d22d1d6755a39bffd9e7f"},
{file = "tiktoken-0.5.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c3f894dbe0adb44609f3d532b8ea10820d61fdcb288b325a458dfc60fefb7db"},
{file = "tiktoken-0.5.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:58ccfddb4e62f0df974e8f7e34a667981d9bb553a811256e617731bf1d007d19"},
{file = "tiktoken-0.5.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58902a8bad2de4268c2a701f1c844d22bfa3cbcc485b10e8e3e28a050179330b"},
{file = "tiktoken-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:5e39257826d0647fcac403d8fa0a474b30d02ec8ffc012cfaf13083e9b5e82c5"},
{file = "tiktoken-0.5.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8bde3b0fbf09a23072d39c1ede0e0821f759b4fa254a5f00078909158e90ae1f"},
{file = "tiktoken-0.5.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2ddee082dcf1231ccf3a591d234935e6acf3e82ee28521fe99af9630bc8d2a60"},
{file = "tiktoken-0.5.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35c057a6a4e777b5966a7540481a75a31429fc1cb4c9da87b71c8b75b5143037"},
{file = "tiktoken-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c4a049b87e28f1dc60509f8eb7790bc8d11f9a70d99b9dd18dfdd81a084ffe6"},
{file = "tiktoken-0.5.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5bf5ce759089f4f6521ea6ed89d8f988f7b396e9f4afb503b945f5c949c6bec2"},
{file = "tiktoken-0.5.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0c964f554af1a96884e01188f480dad3fc224c4bbcf7af75d4b74c4b74ae0125"},
{file = "tiktoken-0.5.2-cp38-cp38-win_amd64.whl", hash = "sha256:368dd5726d2e8788e47ea04f32e20f72a2012a8a67af5b0b003d1e059f1d30a3"},
{file = "tiktoken-0.5.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a2deef9115b8cd55536c0a02c0203512f8deb2447f41585e6d929a0b878a0dd2"},
{file = "tiktoken-0.5.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2ed7d380195affbf886e2f8b92b14edfe13f4768ff5fc8de315adba5b773815e"},
{file = "tiktoken-0.5.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c76fce01309c8140ffe15eb34ded2bb94789614b7d1d09e206838fc173776a18"},
{file = "tiktoken-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60a5654d6a2e2d152637dd9a880b4482267dfc8a86ccf3ab1cec31a8c76bfae8"},
{file = "tiktoken-0.5.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:41d4d3228e051b779245a8ddd21d4336f8975563e92375662f42d05a19bdff41"},
{file = "tiktoken-0.5.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c1cdec2c92fcde8c17a50814b525ae6a88e8e5b02030dc120b76e11db93f13"},
{file = "tiktoken-0.5.2-cp39-cp39-win_amd64.whl", hash = "sha256:84ddb36faedb448a50b246e13d1b6ee3437f60b7169b723a4b2abad75e914f3e"},
{file = "tiktoken-0.5.2.tar.gz", hash = "sha256:f54c581f134a8ea96ce2023ab221d4d4d81ab614efa0b2fbce926387deb56c80"},
]
[package.dependencies]

View file

@ -0,0 +1,888 @@
{
"id": "c091a57f-43a7-4a5e-b352-035ae8d8379c",
"data": {
"nodes": [
{
"id": "Prompt-uxBqP",
"type": "genericNode",
"position": {
"x": 53.588791333410654,
"y": -107.07318910019967
},
"data": {
"type": "Prompt",
"node": {
"template": {
"code": {
"type": "code",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "from langchain_core.prompts import PromptTemplate\n\nfrom langflow.field_typing import Prompt, TemplateField, Text\nfrom langflow.interface.custom.custom_component import CustomComponent\n\n\nclass PromptComponent(CustomComponent):\n display_name: str = \"Prompt\"\n description: str = \"Create a prompt template with dynamic variables.\"\n icon = \"prompts\"\n\n def build_config(self):\n return {\n \"template\": TemplateField(display_name=\"Template\"),\n \"code\": TemplateField(advanced=True),\n }\n\n def build(\n self,\n template: Prompt,\n **kwargs,\n ) -> Text:\n from langflow.base.prompts.utils import dict_values_to_string\n\n prompt_template = PromptTemplate.from_template(Text(template))\n kwargs = dict_values_to_string(kwargs)\n kwargs = {k: \"\\n\".join(v) if isinstance(v, list) else v for k, v in kwargs.items()}\n try:\n formated_prompt = prompt_template.format(**kwargs)\n except Exception as exc:\n raise ValueError(f\"Error formatting prompt: {exc}\") from exc\n self.status = f'Prompt:\\n\"{formated_prompt}\"'\n return formated_prompt\n",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "code",
"advanced": true,
"dynamic": true,
"info": "",
"load_from_db": false,
"title_case": false
},
"template": {
"type": "prompt",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": "Answer the user as if you were a pirate.\n\nUser: {user_input}\n\nAnswer: ",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "template",
"display_name": "Template",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
},
"_type": "CustomComponent",
"user_input": {
"field_type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "user_input",
"display_name": "user_input",
"advanced": false,
"input_types": [
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"type": "str"
}
},
"description": "Create a prompt template with dynamic variables.",
"icon": "prompts",
"is_input": null,
"is_output": null,
"is_composition": null,
"base_classes": [
"object",
"str",
"Text"
],
"name": "",
"display_name": "Prompt",
"documentation": "",
"custom_fields": {
"template": [
"user_input"
]
},
"output_types": [
"Text"
],
"full_path": null,
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false,
"error": null
},
"id": "Prompt-uxBqP",
"description": "Create a prompt template with dynamic variables.",
"display_name": "Prompt"
},
"selected": true,
"width": 384,
"height": 383,
"dragging": false,
"positionAbsolute": {
"x": 53.588791333410654,
"y": -107.07318910019967
}
},
{
"id": "OpenAIModel-k39HS",
"type": "genericNode",
"position": {
"x": 634.8148772766217,
"y": 27.035057029045305
},
"data": {
"type": "OpenAIModel",
"node": {
"template": {
"input_value": {
"type": "str",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Input",
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"code": {
"type": "code",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional\n\nfrom langchain_openai import ChatOpenAI\n\nfrom langflow.base.constants import STREAM_INFO_TEXT\nfrom langflow.base.models.model import LCModelComponent\nfrom langflow.field_typing import NestedDict, Text\n\n\nclass OpenAIModelComponent(LCModelComponent):\n display_name = \"OpenAI\"\n description = \"Generates text using OpenAI LLMs.\"\n icon = \"OpenAI\"\n\n field_order = [\n \"max_tokens\",\n \"model_kwargs\",\n \"model_name\",\n \"openai_api_base\",\n \"openai_api_key\",\n \"temperature\",\n \"input_value\",\n \"system_message\",\n \"stream\",\n ]\n\n def build_config(self):\n return {\n \"input_value\": {\"display_name\": \"Input\"},\n \"max_tokens\": {\n \"display_name\": \"Max Tokens\",\n \"advanced\": True,\n },\n \"model_kwargs\": {\n \"display_name\": \"Model Kwargs\",\n \"advanced\": True,\n },\n \"model_name\": {\n \"display_name\": \"Model Name\",\n \"advanced\": False,\n \"options\": [\n \"gpt-4-turbo-preview\",\n \"gpt-3.5-turbo\",\n \"gpt-4-0125-preview\",\n \"gpt-4-1106-preview\",\n \"gpt-4-vision-preview\",\n \"gpt-3.5-turbo-0125\",\n \"gpt-3.5-turbo-1106\",\n ],\n \"value\": \"gpt-4-turbo-preview\",\n },\n \"openai_api_base\": {\n \"display_name\": \"OpenAI API Base\",\n \"advanced\": True,\n \"info\": (\n \"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\\n\\n\"\n \"You can change this to use other APIs like JinaChat, LocalAI and Prem.\"\n ),\n },\n \"openai_api_key\": {\n \"display_name\": \"OpenAI API Key\",\n \"info\": \"The OpenAI API Key to use for the OpenAI model.\",\n \"advanced\": False,\n \"password\": True,\n },\n \"temperature\": {\n \"display_name\": \"Temperature\",\n \"advanced\": False,\n \"value\": 0.1,\n },\n \"stream\": {\n \"display_name\": \"Stream\",\n \"info\": STREAM_INFO_TEXT,\n \"advanced\": True,\n },\n \"system_message\": {\n \"display_name\": \"System Message\",\n \"info\": \"System message to pass to the model.\",\n \"advanced\": True,\n },\n }\n\n def build(\n self,\n input_value: Text,\n openai_api_key: str,\n temperature: float,\n model_name: str,\n max_tokens: Optional[int] = 256,\n model_kwargs: NestedDict = {},\n openai_api_base: Optional[str] = None,\n stream: bool = False,\n system_message: Optional[str] = None,\n ) -> Text:\n if not openai_api_base:\n openai_api_base = \"https://api.openai.com/v1\"\n output = ChatOpenAI(\n max_tokens=max_tokens,\n model_kwargs=model_kwargs,\n model=model_name,\n base_url=openai_api_base,\n api_key=openai_api_key,\n temperature=temperature,\n )\n\n return self.get_chat_result(output, stream, input_value, system_message)\n",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "code",
"advanced": true,
"dynamic": true,
"info": "",
"load_from_db": false,
"title_case": false
},
"max_tokens": {
"type": "int",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": 256,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "max_tokens",
"display_name": "Max Tokens",
"advanced": true,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
},
"model_kwargs": {
"type": "NestedDict",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": {},
"fileTypes": [],
"file_path": "",
"password": false,
"name": "model_kwargs",
"display_name": "Model Kwargs",
"advanced": true,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
},
"model_name": {
"type": "str",
"required": true,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "gpt-3.5-turbo",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"gpt-4-turbo-preview",
"gpt-3.5-turbo",
"gpt-4-0125-preview",
"gpt-4-1106-preview",
"gpt-4-vision-preview",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-1106"
],
"name": "model_name",
"display_name": "Model Name",
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"openai_api_base": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "openai_api_base",
"display_name": "OpenAI API Base",
"advanced": true,
"dynamic": false,
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"openai_api_key": {
"type": "str",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"fileTypes": [],
"file_path": "",
"password": true,
"name": "openai_api_key",
"display_name": "OpenAI API Key",
"advanced": false,
"dynamic": false,
"info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": true,
"title_case": false,
"input_types": [
"Text"
],
"value": ""
},
"stream": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": true,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "stream",
"display_name": "Stream",
"advanced": true,
"dynamic": false,
"info": "Stream the response from the model. Streaming works only in Chat.",
"load_from_db": false,
"title_case": false
},
"system_message": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "system_message",
"display_name": "System Message",
"advanced": true,
"dynamic": false,
"info": "System message to pass to the model.",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"temperature": {
"type": "float",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": 0.1,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "temperature",
"display_name": "Temperature",
"advanced": false,
"dynamic": false,
"info": "",
"rangeSpec": {
"step_type": "float",
"min": -1,
"max": 1,
"step": 0.1
},
"load_from_db": false,
"title_case": false
},
"_type": "CustomComponent"
},
"description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI",
"base_classes": [
"object",
"Text",
"str"
],
"display_name": "OpenAI",
"documentation": "",
"custom_fields": {
"input_value": null,
"openai_api_key": null,
"temperature": null,
"model_name": null,
"max_tokens": null,
"model_kwargs": null,
"openai_api_base": null,
"stream": null,
"system_message": null
},
"output_types": [
"Text"
],
"field_formatters": {},
"frozen": false,
"field_order": [
"max_tokens",
"model_kwargs",
"model_name",
"openai_api_base",
"openai_api_key",
"temperature",
"input_value",
"system_message",
"stream"
],
"beta": false
},
"id": "OpenAIModel-k39HS",
"description": "Generates text using OpenAI LLMs.",
"display_name": "OpenAI"
},
"selected": false,
"width": 384,
"height": 563,
"positionAbsolute": {
"x": 634.8148772766217,
"y": 27.035057029045305
},
"dragging": false
},
{
"id": "ChatOutput-njtka",
"type": "genericNode",
"position": {
"x": 1193.250417197867,
"y": 71.88476890163852
},
"data": {
"type": "ChatOutput",
"node": {
"template": {
"code": {
"type": "code",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatOutput(ChatComponent):\n display_name = \"Chat Output\"\n description = \"Display a chat message in the Interaction Panel.\"\n icon = \"ChatOutput\"\n\n def build(\n self,\n sender: Optional[str] = \"Machine\",\n sender_name: Optional[str] = \"AI\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n record_template: Optional[str] = \"{text}\",\n ) -> Union[Text, Record]:\n return super().build(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n record_template=record_template,\n )\n",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "code",
"advanced": true,
"dynamic": true,
"info": "",
"load_from_db": false,
"title_case": false
},
"input_value": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [
"Text"
],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false
},
"record_template": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "{text}",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "record_template",
"display_name": "Record Template",
"advanced": true,
"dynamic": false,
"info": "In case of Message being a Record, this template will be used to convert it to text.",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"return_record": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "Machine",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"sender_name": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": "AI",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "sender_name",
"display_name": "Sender Name",
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"session_id": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
},
"description": "Display a chat message in the Interaction Panel.",
"icon": "ChatOutput",
"base_classes": [
"Record",
"Text",
"str",
"object"
],
"display_name": "Chat Output",
"documentation": "",
"custom_fields": {
"sender": null,
"sender_name": null,
"input_value": null,
"session_id": null,
"return_record": null,
"record_template": null
},
"output_types": [
"Text",
"Record"
],
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
},
"id": "ChatOutput-njtka"
},
"selected": false,
"width": 384,
"height": 383,
"positionAbsolute": {
"x": 1193.250417197867,
"y": 71.88476890163852
},
"dragging": false
},
{
"id": "ChatInput-P3fgL",
"type": "genericNode",
"position": {
"x": -495.2223093083827,
"y": -232.56998443685862
},
"data": {
"type": "ChatInput",
"node": {
"template": {
"code": {
"type": "code",
"required": true,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"value": "from typing import Optional, Union\n\nfrom langflow.base.io.chat import ChatComponent\nfrom langflow.field_typing import Text\nfrom langflow.schema import Record\n\n\nclass ChatInput(ChatComponent):\n display_name = \"Chat Input\"\n description = \"Get chat inputs from the Interaction Panel.\"\n icon = \"ChatInput\"\n\n def build_config(self):\n build_config = super().build_config()\n build_config[\"input_value\"] = {\n \"input_types\": [],\n \"display_name\": \"Message\",\n \"multiline\": True,\n }\n\n return build_config\n\n def build(\n self,\n sender: Optional[str] = \"User\",\n sender_name: Optional[str] = \"User\",\n input_value: Optional[str] = None,\n session_id: Optional[str] = None,\n return_record: Optional[bool] = False,\n ) -> Union[Text, Record]:\n return super().build(\n sender=sender,\n sender_name=sender_name,\n input_value=input_value,\n session_id=session_id,\n return_record=return_record,\n )\n",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "code",
"advanced": true,
"dynamic": true,
"info": "",
"load_from_db": false,
"title_case": false
},
"input_value": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": true,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "input_value",
"display_name": "Message",
"advanced": false,
"input_types": [],
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"value": "hi"
},
"return_record": {
"type": "bool",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "return_record",
"display_name": "Return Record",
"advanced": true,
"dynamic": false,
"info": "Return the message as a record containing the sender, sender_name, and session_id.",
"load_from_db": false,
"title_case": false
},
"sender": {
"type": "str",
"required": false,
"placeholder": "",
"list": true,
"show": true,
"multiline": false,
"value": "User",
"fileTypes": [],
"file_path": "",
"password": false,
"options": [
"Machine",
"User"
],
"name": "sender",
"display_name": "Sender Type",
"advanced": true,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"sender_name": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"value": "User",
"fileTypes": [],
"file_path": "",
"password": false,
"name": "sender_name",
"display_name": "Sender Name",
"advanced": false,
"dynamic": false,
"info": "",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"session_id": {
"type": "str",
"required": false,
"placeholder": "",
"list": false,
"show": true,
"multiline": false,
"fileTypes": [],
"file_path": "",
"password": false,
"name": "session_id",
"display_name": "Session ID",
"advanced": true,
"dynamic": false,
"info": "If provided, the message will be stored in the memory.",
"load_from_db": false,
"title_case": false,
"input_types": [
"Text"
]
},
"_type": "CustomComponent"
},
"description": "Get chat inputs from the Interaction Panel.",
"icon": "ChatInput",
"base_classes": [
"object",
"Record",
"str",
"Text"
],
"display_name": "Chat Input",
"documentation": "",
"custom_fields": {
"sender": null,
"sender_name": null,
"input_value": null,
"session_id": null,
"return_record": null
},
"output_types": [
"Text",
"Record"
],
"field_formatters": {},
"frozen": false,
"field_order": [],
"beta": false
},
"id": "ChatInput-P3fgL"
},
"selected": false,
"width": 384,
"height": 375,
"positionAbsolute": {
"x": -495.2223093083827,
"y": -232.56998443685862
},
"dragging": false
}
],
"edges": [
{
"source": "OpenAIModel-k39HS",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}",
"target": "ChatOutput-njtka",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
"targetHandle": {
"fieldName": "input_value",
"id": "ChatOutput-njtka",
"inputTypes": [
"Text"
],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Text",
"str"
],
"dataType": "OpenAIModel",
"id": "OpenAIModel-k39HS"
}
},
"style": {
"stroke": "#555"
},
"className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-OpenAIModel-k39HS{œbaseClassesœ:[œobjectœ,œTextœ,œstrœ],œdataTypeœ:œOpenAIModelœ,œidœ:œOpenAIModel-k39HSœ}-ChatOutput-njtka{œfieldNameœ:œinput_valueœ,œidœ:œChatOutput-njtkaœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
},
{
"source": "Prompt-uxBqP",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}",
"target": "OpenAIModel-k39HS",
"targetHandle": "{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}",
"data": {
"targetHandle": {
"fieldName": "input_value",
"id": "OpenAIModel-k39HS",
"inputTypes": [
"Text"
],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"str",
"Text"
],
"dataType": "Prompt",
"id": "Prompt-uxBqP"
}
},
"style": {
"stroke": "#555"
},
"className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-Prompt-uxBqP{œbaseClassesœ:[œobjectœ,œstrœ,œTextœ],œdataTypeœ:œPromptœ,œidœ:œPrompt-uxBqPœ}-OpenAIModel-k39HS{œfieldNameœ:œinput_valueœ,œidœ:œOpenAIModel-k39HSœ,œinputTypesœ:[œTextœ],œtypeœ:œstrœ}"
},
{
"source": "ChatInput-P3fgL",
"sourceHandle": "{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}",
"target": "Prompt-uxBqP",
"targetHandle": "{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}",
"data": {
"targetHandle": {
"fieldName": "user_input",
"id": "Prompt-uxBqP",
"inputTypes": [
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"object",
"Record",
"str",
"Text"
],
"dataType": "ChatInput",
"id": "ChatInput-P3fgL"
}
},
"style": {
"stroke": "#555"
},
"className": "stroke-gray-900 stroke-connection",
"id": "reactflow__edge-ChatInput-P3fgL{œbaseClassesœ:[œobjectœ,œRecordœ,œstrœ,œTextœ],œdataTypeœ:œChatInputœ,œidœ:œChatInput-P3fgLœ}-Prompt-uxBqP{œfieldNameœ:œuser_inputœ,œidœ:œPrompt-uxBqPœ,œinputTypesœ:[œDocumentœ,œBaseOutputParserœ,œRecordœ,œTextœ],œtypeœ:œstrœ}"
}
],
"viewport": {
"x": 260.58251815500563,
"y": 318.2261172111936,
"zoom": 0.43514115784696294
}
},
"description": "This flow will get you experimenting with the basics of the UI, the Chat and the Prompt component. \n\nTry changing the Template in it to see how the model behaves. \nYou can change it to this and a Text Input into the `type_of_person` variable : \"Answer the user as if you were a pirate.\n\nUser: {user_input}\n\nAnswer: \" ",
"name": "Basic Prompting (Ahoy World!)",
"last_tested_version": "1.0.0a4",
"is_component": false
}

View file

@ -1,3 +1,4 @@
from datetime import datetime
import time
from datetime import datetime
from pathlib import Path

View file

@ -18,7 +18,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 2 : undefined,
workers: 3,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
timeout: 120 * 1000,
// reporter: [

View file

@ -252,7 +252,12 @@ export default function ParameterComponent({
nodeIconsLucide[item.family] ?? nodeIconsLucide["unknown"];
return (
<div key={index}>
<div
key={index}
data-testid={`available-${left ? "input" : "output"}-${
item.family
}`}
>
{index === 0 && (
<span>{left ? INPUT_HANDLER_HOVER : OUTPUT_HANDLER_HOVER}</span>
)}
@ -276,10 +281,16 @@ export default function ParameterComponent({
}}
/>
</div>
<span className="ps-2 text-xs text-foreground">
<span
className="ps-2 text-xs text-foreground"
data-testid={`tooltip-${nodeNames[item.family] ?? "Other"}`}
>
{nodeNames[item.family] ?? "Other"}{" "}
{item?.display_name && item?.display_name?.length > 0 ? (
<span className="text-xs">
<span
className="text-xs"
data-testid={`tooltip-${item?.display_name}`}
>
{" "}
{item.display_name === "" ? "" : " - "}
{item.display_name.split(", ").length > 2
@ -296,7 +307,10 @@ export default function ParameterComponent({
: item.display_name}
</span>
) : (
<span className="text-xs">
<span
className="text-xs"
data-testid={`tooltip-${item?.type}`}
>
{" "}
{item.type === "" ? "" : " - "}
{item.type.split(", ").length > 2
@ -319,7 +333,9 @@ export default function ParameterComponent({
});
} else {
//@ts-ignore
refHtml.current = <span>{TOOLTIP_EMPTY}</span>;
refHtml.current = (
<span data-testid={`empty-tooltip-filter`}>{TOOLTIP_EMPTY}</span>
);
}
}
// If optionalHandle is an empty list, then it is not an optional handle
@ -343,6 +359,9 @@ export default function ParameterComponent({
side={left ? "left" : "right"}
>
<Handle
data-test-id={`handle-${title.toLowerCase()}-${
left ? "target" : "source"
}`}
type={left ? "target" : "source"}
position={left ? Position.Left : Position.Right}
key={
@ -437,6 +456,9 @@ export default function ParameterComponent({
side={left ? "left" : "right"}
>
<Handle
data-test-id={`handle-${title.toLowerCase()}-${
left ? "left" : "right"
}`}
type={left ? "target" : "source"}
position={left ? Position.Left : Position.Right}
key={
@ -482,6 +504,7 @@ export default function ParameterComponent({
}
>
<InputListComponent
componentName={name}
disabled={disabled}
value={
!data.node.template[name].value ||

View file

@ -444,6 +444,7 @@ export default function GenericNode({
onChange={setNodeName}
password={false}
blurOnEnter={true}
id={`input-title-${data.node?.display_name}`}
/>
</div>
) : (

View file

@ -163,20 +163,26 @@ export default function CollectionCardComponent({
<ShadTooltip content="Components">
<span className="flex items-center gap-1.5 text-xs text-muted-foreground">
<IconComponent name="ToyBrick" className="h-4 w-4" />
{data?.metadata?.total ?? 0}
<span data-testid={`total-${data.name}`}>
{data?.metadata?.total ?? 0}
</span>
</span>
</ShadTooltip>
)}
<ShadTooltip content="Likes">
<span className="flex items-center gap-1.5 text-xs text-muted-foreground">
<IconComponent name="Heart" className={cn("h-4 w-4 ")} />
{likes_count ?? 0}
<span data-testid={`likes-${data.name}`}>
{likes_count ?? 0}
</span>
</span>
</ShadTooltip>
<ShadTooltip content="Downloads">
<span className="flex items-center gap-1.5 text-xs text-muted-foreground">
<IconComponent name="DownloadCloud" className="h-4 w-4" />
{downloads_count ?? 0}
<span data-testid={`downloads-${data.name}`}>
{downloads_count ?? 0}
</span>
</span>
</ShadTooltip>
</div>
@ -286,6 +292,7 @@ export default function CollectionCardComponent({
}
handleLike();
}}
data-testid={`like-${data.name}`}
>
<IconComponent
name="Heart"
@ -324,6 +331,7 @@ export default function CollectionCardComponent({
}
handleInstall();
}}
data-testid={`install-${data.name}`}
>
<IconComponent
name={loading ? "Loader2" : isStore ? "Download" : "Plus"}

View file

@ -269,6 +269,9 @@ export default function CodeTabsComponent({
templateField
].list ? (
<InputListComponent
componentName={
templateField
}
editNode={true}
disabled={false}
value={
@ -739,6 +742,11 @@ export default function CodeTabsComponent({
]
);
}}
isList={
node.data.node!.template[
templateField
].list ?? false
}
/>
</div>
) : node.data.node.template[

View file

@ -43,7 +43,7 @@ export default function Dropdown({
role="combobox"
ref={refButton}
aria-expanded={open}
data-test={`${id ?? ""}`}
data-testid={`${id ?? ""}`}
className={cn(
editNode
? "dropdown-component-outline"
@ -52,11 +52,14 @@ export default function Dropdown({
editNode ? "input-edit-node" : "py-2"
)}
>
{value &&
value !== "" &&
options.find((option) => option === value)
? options.find((option) => option === value)
: "Choose an option..."}
<span data-testid={`value-dropdown-` + id}>
{value &&
value !== "" &&
options.find((option) => option === value)
? options.find((option) => option === value)
: "Choose an option..."}
</span>
<ForwardedIconComponent
name="ChevronsUpDown"
className="ml-2 h-4 w-4 shrink-0 opacity-50"

View file

@ -103,6 +103,7 @@ export default function Header(): JSX.Element {
onClick={() => {
checkForChanges(nodes);
}}
data-testid="button-store"
>
<IconComponent name="Store" className="h-4 w-4" />
<div className="flex-1">Store</div>

View file

@ -11,6 +11,7 @@ export default function InputListComponent({
onChange,
disabled,
editNode = false,
componentName,
}: InputListComponentType): JSX.Element {
useEffect(() => {
if (disabled && value.length > 0 && value[0] !== "") {
@ -46,6 +47,10 @@ export default function InputListComponent({
newInputList[idx] = event.target.value;
onChange(newInputList);
}}
data-testid={
`input-list-input${editNode ? "-edit" : ""}_${componentName}-` +
idx
}
/>
{idx === value.length - 1 ? (
<button
@ -54,6 +59,11 @@ export default function InputListComponent({
newInputList.push("");
onChange(newInputList);
}}
data-testid={
`input-list-plus-btn${
editNode ? "-edit" : ""
}_${componentName}-` + idx
}
>
<IconComponent
name="Plus"
@ -62,6 +72,11 @@ export default function InputListComponent({
</button>
) : (
<button
data-testid={
`input-list-minus-btn${
editNode ? "-edit" : ""
}_${componentName}-` + idx
}
onClick={() => {
let newInputList = _.cloneDeep(value);
newInputList.splice(idx, 1);

View file

@ -28,6 +28,7 @@ export default function SidebarNav({
>
{items.map((item) => (
<Link
data-testid={`sidebar-nav-${item.title}`}
key={item.href}
to={item.href}
className={cn(

View file

@ -88,6 +88,7 @@ export function TagsSelector({
updateTags(tag.name);
}}
key={idx}
data-testid={`tag-selector-${tag.name}`}
>
<Badge
key={idx}

View file

@ -46,10 +46,11 @@ export default function TextAreaComponent({
>
{!editNode && (
<IconComponent
strokeWidth={1.5}
id={id}
name="ExternalLink"
className={
"icons-parameters-comp" +
"icons-parameters-comp w-[1.35rem]" +
(disabled ? " text-ring" : " hover:text-accent-foreground")
}
/>

View file

@ -8,6 +8,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
data-testid=""
type={type}
className={cn(
"nopan nodelete nodrag noundo nocopy primary-input",

View file

@ -205,6 +205,7 @@ const EditNodeModal = forwardRef(
{myData.node.template[templateParam]
.list ? (
<InputListComponent
componentName={templateParam}
editNode={true}
disabled={disabled}
value={
@ -342,6 +343,10 @@ const EditNodeModal = forwardRef(
templateParam
);
}}
isList={
data.node?.template[templateParam]
.list ?? false
}
/>
</div>
) : myData.node?.template[templateParam]
@ -559,6 +564,7 @@ const EditNodeModal = forwardRef(
<BaseModal.Footer>
<Button
data-test-id="saveChangesBtn"
id={"saveChangesBtn"}
className="mt-3"
onClick={() => {

View file

@ -129,6 +129,7 @@ export default function StoreApiKeyModal({
<Form.Submit asChild>
<Button
data-testid="api-key-save-button-store"
className="mt-8"
onClick={() => {
handleSaveKey();

View file

@ -19,6 +19,7 @@ export default function DisclosureComponent({
? "components-disclosure-arrangement-child"
: "components-disclosure-arrangement"
}
data-testid={`disclosure-${title.toLocaleLowerCase()}`}
>
<div className={"flex gap-4" + (isChild ? " pl-2" : "")}>
{/* BUG ON THIS ICON */}

View file

@ -6,13 +6,17 @@ export default function ParentDisclosureComponent({
button: { title, Icon, buttons = [] },
children,
openDisc,
testId,
}: DisclosureComponentType): JSX.Element {
return (
<Disclosure as="div" defaultOpen={openDisc} key={title}>
{({ open }) => (
<>
<div>
<Disclosure.Button className="parent-disclosure-arrangement">
<Disclosure.Button
className="parent-disclosure-arrangement"
data-testid={testId}
>
<div className="flex gap-4">
<span className="parent-disclosure-title ">{title}</span>
</div>

View file

@ -369,6 +369,7 @@ export default function ExtraSidebar(): JSX.Element {
title: "Extended",
Icon: nodeIconsLucide.unknown,
}}
testId="extended-disclosure"
>
{Object.keys(dataFilter)
.sort(sortKeys)

View file

@ -410,7 +410,7 @@ export default function NodeToolbarComponent({
<ShadTooltip content={"Duplicate"} side="top">
<button
data-testid="save-button-modal"
data-testid="duplicate-button-modal"
className={classNames(
"relative -ml-px inline-flex items-center bg-background px-2 py-2 text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10"
)}

View file

@ -181,6 +181,7 @@ export default function StorePage(): JSX.Element {
{StoreApiKeyModal && (
<StoreApiKeyModal disabled={loading}>
<Button
data-testid="api-key-button-store"
disabled={loading}
className={cn(
`${!validApiKey ? "animate-pulse border-error" : ""}`,
@ -201,6 +202,7 @@ export default function StorePage(): JSX.Element {
<div className="flex items-end gap-4">
<div className="relative h-12 w-[40%]">
<Input
data-testid="search-store-input"
disabled={loading}
placeholder="Search Flows and Components"
className="absolute h-12 pl-5 pr-12"
@ -220,6 +222,7 @@ export default function StorePage(): JSX.Element {
onClick={() => {
setSearchNow(uniqueId());
}}
data-testid="search-store-button"
>
<IconComponent
name={loading ? "Loader2" : "Search"}
@ -229,6 +232,7 @@ export default function StorePage(): JSX.Element {
</div>
<div className="ml-4 flex w-full gap-2 border-b border-border">
<button
data-testid="all-button-store"
disabled={loading}
onClick={() => {
setTabActive("All");
@ -243,6 +247,7 @@ export default function StorePage(): JSX.Element {
All
</button>
<button
data-testid="flows-button-store"
disabled={loading}
onClick={() => {
resetPagination();
@ -258,6 +263,7 @@ export default function StorePage(): JSX.Element {
Flows
</button>
<button
data-testid="components-button-store"
disabled={loading}
onClick={() => {
resetPagination();
@ -344,7 +350,7 @@ export default function StorePage(): JSX.Element {
setPageOrder(e);
}}
>
<SelectTrigger>
<SelectTrigger data-testid="select-order-store">
<SelectValue placeholder="Popular" />
</SelectTrigger>
<SelectContent>

View file

@ -68,6 +68,16 @@ export type InputListComponentType = {
onChange: (value: string[]) => void;
disabled: boolean;
editNode?: boolean;
componentName?: string;
};
export type InputGlobalComponentType = {
disabled: boolean;
onChange: (value: string) => void;
setDb: (value: boolean) => void;
name: string;
data: NodeDataType;
editNode?: boolean;
};
export type InputGlobalComponentType = {
@ -159,6 +169,7 @@ export type DisclosureComponentType = {
onClick: (event?: React.MouseEvent) => void;
}[];
};
testId?: string;
};
export type RangeSpecType = {

View file

@ -1,16 +1,13 @@
import { test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(16000);
// test.setTimeout(140000);
});
test.describe("Auto_login tests", () => {
test("auto_login sign in", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
});
test("auto_login block_admin", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(5000);

View file

@ -1,9 +1,6 @@
import { test } from "@playwright/test";
import { readFileSync } from "fs";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(20000);
// test.setTimeout(120000);
});
test("chat_io_teste", async ({ page }) => {
await page.goto("/");
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
@ -13,6 +10,14 @@ test("chat_io_teste", async ({ page }) => {
"utf-8"
);
await page.waitForTimeout(3000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
// Create the DataTransfer and File
const dataTransfer = await page.evaluateHandle((data) => {
const dt = new DataTransfer();
@ -24,12 +29,6 @@ test("chat_io_teste", async ({ page }) => {
return dt;
}, jsonContent);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
// Now dispatch
await page.dispatchEvent(
'//*[@id="react-flow-id"]/div[1]/div[1]/div',

View file

@ -1,29 +1,36 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
await page.waitForTimeout(2000);
test.setTimeout(120000);
});
test("CodeAreaModalComponent", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("pythonfunctiontool");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("toolsPythonFunctionTool")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("div-generic-node").click();
await page.getByTestId("code-button-modal").click();
@ -50,6 +57,8 @@ test("CodeAreaModalComponent", async ({ page }) => {
await page.locator("textarea").fill(wCode);
await page.locator("textarea").fill(code);
await page.locator('//*[@id="checkAndSaveBtn"]').click();
await page.waitForTimeout(1000);
expect(await page.getByText("Code is ready to run").isVisible()).toBeTruthy();
await page.getByTestId("code-button-modal").click();
expect(await page.locator('//*[@id="codeValue"]').inputValue()).toBe(

View file

@ -1,10 +1,10 @@
import { expect, test } from "@playwright/test";
test("curl_api_generation", async ({ page, context }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
await page.getByRole("heading", { name: "Data Ingestion" }).click();
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.waitForTimeout(2000);
await page.getByText("API", { exact: true }).click();
await page.getByRole("tab", { name: "cURL" }).click();

View file

@ -1,13 +1,10 @@
import { expect, test } from "@playwright/test";
import { readFileSync } from "fs";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(3000);
// test.setTimeout(120000);
});
test.describe("drag and drop test", () => {
/// <reference lib="dom"/>
test("drop collection", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator("span").filter({ hasText: "My Collection" }).isVisible();
// Read your file into a buffer.
const jsonContent = readFileSync(
@ -36,7 +33,7 @@ test.describe("drag and drop test", () => {
);
await page.getByText("Edit Flow").first().click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
const genericNoda = page.getByTestId("div-generic-node");
const elementCount = await genericNoda.count();

View file

@ -1,51 +1,65 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(4000);
// test.setTimeout(120000);
});
test("dropDownComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("amazon");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("model_specsAmazon Bedrock")
.getByTestId("modelsAmazon Bedrock")
.first()
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("dropdown-model_id-display").click();
await page.getByTestId("ai21.j2-grande-instruct-0-option").click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
let value = await page.getByTestId("dropdown-model_id-display").innerText();
if (value !== "ai21.j2-grande-instruct") {
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("title-Amazon Bedrock").click();
await page.getByTestId("dropdown-model_id").click();
await page.getByTestId("ai21.j2-mid-v1-10-option").click();
let value = await page
.getByTestId("value-dropdown-dropdown-model_id")
.first()
.innerText();
if (value !== "ai21.j2-mid-v1") {
expect(false).toBeTruthy();
}
await page.getByTestId("dropdown-model_id-display").click();
await page.getByTestId("ai21.j2-jumbo-instruct-1-option").click();
await page.getByTestId("dropdown-model_id").click();
await page.getByTestId("anthropic.claude-v2:1-6-option").click();
value = await page.getByTestId("dropdown-model_id-display").innerText();
if (value !== "ai21.j2-jumbo-instruct") {
value = await page.getByTestId("dropdown-model_id").innerText();
if (value !== "anthropic.claude-v2:1") {
expect(false).toBeTruthy();
}
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
value = await page.getByTestId("dropdown-edit-model_id-display").innerText();
if (value !== "ai21.j2-jumbo-instruct") {
value = await page.getByTestId("dropdown-edit-model_id").innerText();
if (value !== "anthropic.claude-v2:1") {
expect(false).toBeTruthy();
}
@ -75,16 +89,6 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showendpoint_url"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showregion_name"]').click();
expect(
await page.locator('//*[@id="showregion_name"]').isChecked()
@ -95,16 +99,6 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showregion_name"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showstreaming"]').click();
expect(
await page.locator('//*[@id="showstreaming"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showstreaming"]').click();
expect(
await page.locator('//*[@id="showstreaming"]').isChecked()
).toBeTruthy();
// showmodel_id
await page.locator('//*[@id="showmodel_id"]').click();
expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy();
@ -141,16 +135,6 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showendpoint_url"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showregion_name"]').click();
expect(
await page.locator('//*[@id="showregion_name"]').isChecked()
@ -161,16 +145,6 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showregion_name"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showstreaming"]').click();
expect(
await page.locator('//*[@id="showstreaming"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showstreaming"]').click();
expect(
await page.locator('//*[@id="showstreaming"]').isChecked()
).toBeTruthy();
// showmodel_id
await page.locator('//*[@id="showmodel_id"]').click();
expect(await page.locator('//*[@id="showmodel_id"]').isChecked()).toBeFalsy();
@ -181,18 +155,18 @@ test("dropDownComponent", async ({ page }) => {
await page.locator('//*[@id="showmodel_id"]').isChecked()
).toBeTruthy();
await page.getByTestId("dropdown-edit-model_id-display").click();
await page.getByTestId("ai21.j2-ultra-v1-5-option").click();
await page.getByTestId("dropdown-edit-model_id").click();
await page.getByTestId("ai21.j2-mid-v1-10-option").click();
value = await page.getByTestId("dropdown-edit-model_id-display").innerText();
if (value !== "ai21.j2-ultra-v1") {
value = await page.getByTestId("dropdown-edit-model_id").innerText();
if (value !== "ai21.j2-mid-v1") {
expect(false).toBeTruthy();
}
await page.locator('//*[@id="saveChangesBtn"]').click();
value = await page.getByTestId("dropdown-model_id-display").innerText();
if (value !== "ai21.j2-ultra-v1") {
value = await page.getByTestId("dropdown-model_id").innerText();
if (value !== "ai21.j2-mid-v1") {
expect(false).toBeTruthy();
}
await page.getByTestId("code-button-modal").click();

View file

@ -0,0 +1,241 @@
import { expect, test } from "@playwright/test";
test("LLMChain - Tooltip", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("llmchain");
await page.waitForTimeout(1000);
await page
.getByTestId("chainsLLMChain")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTitle("fit view").click();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[3]/div/button/div/div'
)
.hover()
.then(async () => {
await expect(
page.getByTestId("available-input-model_specs").first()
).toBeVisible();
await expect(page.getByTestId("tooltip-Models").first()).toBeVisible();
await expect(
page.getByTestId("tooltip-AzureOpenAIModel").first()
).toBeVisible();
await expect(
page.getByTestId("tooltip-Model Specs").first()
).toBeVisible();
await page.getByTestId("icon-X").click();
await page.waitForTimeout(500);
});
await page.getByTitle("fit view").click();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[4]/div/button/div/div'
)
.hover()
.then(async () => {
await expect(
page.getByTestId("available-input-memories").first()
).toBeVisible();
await expect(page.getByTestId("tooltip-Memories").first()).toBeVisible();
await expect(
page
.getByTestId(
"tooltip-ConversationBufferMemory, ConversationBufferWindowMemory, ConversationEntityMemory, ConversationKGMemory, ConversationSummaryMemory, MotorheadMemory, VectorStoreRetrieverMemory"
)
.first()
).toBeVisible();
await page.getByTestId("icon-Search").click();
await page.waitForTimeout(500);
});
await page.getByTitle("fit view").click();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[5]/div/button/div/div'
)
.hover()
.then(async () => {
await expect(
page.getByTestId("empty-tooltip-filter").first()
).toBeVisible();
});
});
test("LLMChain - Filter", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("llmchain");
await page.waitForTimeout(1000);
await page
.getByTestId("chainsLLMChain")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTitle("fit view").click();
await page.waitForTimeout(500);
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[3]/div/button/div/div'
)
.click();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[3]/div/button/div/div'
)
.click();
await page.getByTestId("icon-Search").click();
await expect(page.getByTestId("disclosure-models")).toBeVisible();
await expect(page.getByTestId("disclosure-model specs")).toBeVisible();
await expect(page.getByTestId("modelsAzure OpenAI")).toBeVisible();
await expect(page.getByTestId("model_specsAmazon Bedrock")).toBeVisible();
await expect(page.getByTestId("model_specsAnthropic")).toBeVisible();
await expect(page.getByTestId("model_specsAnthropicLLM")).toBeVisible();
await expect(page.getByTestId("model_specsAzureChatOpenAI")).toBeVisible();
await expect(page.getByTestId("model_specsChatAnthropic")).toBeVisible();
await expect(page.getByTestId("model_specsChatLiteLLM")).toBeVisible();
await expect(page.getByTestId("model_specsChatOllama")).toBeVisible();
await expect(page.getByTestId("model_specsChatOpenAI")).toBeVisible();
await expect(page.getByTestId("model_specsChatVertexAI")).toBeVisible();
await expect(page.getByTestId("model_specsCohere")).toBeVisible();
await expect(
page.getByTestId("model_specsGoogle Generative AI")
).toBeVisible();
await expect(
page.getByTestId("model_specsHugging Face Inference API")
).toBeVisible();
await expect(page.getByTestId("model_specsOllama")).toBeVisible();
await expect(
page.getByTestId("model_specsQianfanChatEndpoint")
).toBeVisible();
await expect(page.getByTestId("model_specsQianfanLLMEndpoint")).toBeVisible();
await expect(page.getByTestId("model_specsVertexAI")).toBeVisible();
await page.getByPlaceholder("Search").click();
await expect(page.getByTestId("model_specsVertexAI")).not.toBeVisible();
await expect(page.getByTestId("model_specsCTransformers")).not.toBeVisible();
await expect(page.getByTestId("model_specsAmazon Bedrock")).not.toBeVisible();
await expect(page.getByTestId("modelsAzure OpenAI")).not.toBeVisible();
await expect(page.getByTestId("model_specsAnthropic")).not.toBeVisible();
await expect(page.getByTestId("model_specsAnthropicLLM")).not.toBeVisible();
await expect(
page.getByTestId("model_specsAzureChatOpenAI")
).not.toBeVisible();
await expect(page.getByTestId("model_specsChatAnthropic")).not.toBeVisible();
await expect(page.getByTestId("model_specsChatLiteLLM")).not.toBeVisible();
await expect(page.getByTestId("model_specsChatOllama")).not.toBeVisible();
await expect(page.getByTestId("model_specsChatOpenAI")).not.toBeVisible();
await expect(page.getByTestId("model_specsChatVertexAI")).not.toBeVisible();
await expect(page.getByTestId("model_specsCohere")).not.toBeVisible();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[4]/div/button/div/div'
)
.click();
await page
.locator(
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[2]/div[4]/div/button/div/div'
)
.click();
await expect(page.getByTestId("disclosure-memories")).toBeVisible();
await expect(
page.getByTestId("memoriesConversationBufferMemory")
).toBeVisible();
await expect(
page.getByTestId("memoriesConversationBufferWindowMemory")
).toBeVisible();
await expect(
page.getByTestId("memoriesConversationEntityMemory")
).toBeVisible();
await expect(page.getByTestId("memoriesConversationKGMemory")).toBeVisible();
await expect(page.getByTestId("memoriesConversationKGMemory")).toBeVisible();
await expect(
page.getByTestId("memoriesConversationSummaryMemory")
).toBeVisible();
await expect(
page.getByTestId("memoriesVectorStoreRetrieverMemory")
).toBeVisible();
await page.getByTestId("rf__wrapper").click();
await expect(
page.getByTestId("memoriesConversationBufferMemory")
).toBeVisible();
await expect(
page.getByTestId("memoriesConversationBufferWindowMemory")
).toBeVisible();
await expect(
page.getByTestId("memoriesConversationEntityMemory")
).toBeVisible();
await expect(page.getByTestId("memoriesConversationKGMemory")).toBeVisible();
await expect(page.getByTestId("memoriesConversationKGMemory")).toBeVisible();
await expect(
page.getByTestId("memoriesConversationSummaryMemory")
).toBeVisible();
await expect(
page.getByTestId("memoriesVectorStoreRetrieverMemory")
).toBeVisible();
});

View file

@ -1,28 +1,47 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(5000);
// test.setTimeout(120000);
});
test("FloatComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("llamacpp");
await page.getByPlaceholder("Search").fill("ollama");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.locator('//*[@id="model_specsLlamaCpp"]')
.getByTestId("modelsOllama")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.locator('//*[@id="float-input"]').click();
await page.locator('//*[@id="float-input"]').fill("3");
@ -48,309 +67,79 @@ test("FloatComponent", async ({ page }) => {
await page.locator('//*[@id="showcache"]').click();
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy();
// showecho
await page.locator('//*[@id="showecho"]').click();
expect(await page.locator('//*[@id="showecho"]').isChecked()).toBeTruthy();
// showf16_kv
await page.locator('//*[@id="showf16_kv"]').click();
expect(await page.locator('//*[@id="showf16_kv"]').isChecked()).toBeTruthy();
// showgrammar_path
await page.locator('//*[@id="showgrammar_path"]').click();
expect(
await page.locator('//*[@id="showgrammar_path"]').isChecked()
).toBeTruthy();
// showlast_n_tokens_size
await page.locator('//*[@id="showlast_n_tokens_size"]').click();
expect(
await page.locator('//*[@id="showlast_n_tokens_size"]').isChecked()
).toBeTruthy();
// showlogits_all
await page.locator('//*[@id="showlogits_all"]').click();
expect(
await page.locator('//*[@id="showlogits_all"]').isChecked()
).toBeTruthy();
// showlogprobs
await page.locator('//*[@id="showlogprobs"]').click();
expect(
await page.locator('//*[@id="showlogprobs"]').isChecked()
).toBeTruthy();
// showlora_base
await page.locator('//*[@id="showlora_base"]').click();
expect(
await page.locator('//*[@id="showlora_base"]').isChecked()
).toBeTruthy();
// showlora_path
await page.locator('//*[@id="showlora_path"]').click();
expect(
await page.locator('//*[@id="showlora_path"]').isChecked()
).toBeTruthy();
// showmax_tokens
await page.locator('//*[@id="showmax_tokens"]').click();
expect(
await page.locator('//*[@id="showmax_tokens"]').isChecked()
).toBeTruthy();
// showmodel_path
await page.locator('//*[@id="showmodel_path"]').click();
expect(
await page.locator('//*[@id="showmodel_path"]').isChecked()
).toBeFalsy();
// shown_batch
await page.locator('//*[@id="shown_batch"]').click();
expect(await page.locator('//*[@id="shown_batch"]').isChecked()).toBeTruthy();
// shown_ctx
await page.locator('//*[@id="shown_ctx"]').click();
expect(await page.locator('//*[@id="shown_ctx"]').isChecked()).toBeTruthy();
// shown_gpu_layers
await page.locator('//*[@id="shown_gpu_layers"]').click();
expect(
await page.locator('//*[@id="shown_gpu_layers"]').isChecked()
).toBeTruthy();
// shown_parts
await page.locator('//*[@id="shown_parts"]').click();
expect(await page.locator('//*[@id="shown_parts"]').isChecked()).toBeTruthy();
// shown_threads
await page.locator('//*[@id="shown_threads"]').click();
expect(
await page.locator('//*[@id="shown_threads"]').isChecked()
).toBeTruthy();
// showrepeat_penalty
await page.locator('//*[@id="showrepeat_penalty"]').click();
expect(
await page.locator('//*[@id="showrepeat_penalty"]').isChecked()
).toBeTruthy();
// showrope_freq_base
await page.locator('//*[@id="showrope_freq_base"]').click();
expect(
await page.locator('//*[@id="showrope_freq_base"]').isChecked()
).toBeTruthy();
// showrope_freq_scale
await page.locator('//*[@id="showrope_freq_scale"]').click();
expect(
await page.locator('//*[@id="showrope_freq_scale"]').isChecked()
).toBeTruthy();
// showseed
await page.locator('//*[@id="showseed"]').click();
expect(await page.locator('//*[@id="showseed"]').isChecked()).toBeTruthy();
// showstop
await page.locator('//*[@id="showstop"]').click();
expect(await page.locator('//*[@id="showstop"]').isChecked()).toBeTruthy();
// showstreaming
await page.locator('//*[@id="showstreaming"]').click();
expect(
await page.locator('//*[@id="showstreaming"]').isChecked()
).toBeTruthy();
// showsuffix
await page.locator('//*[@id="showsuffix"]').click();
expect(await page.locator('//*[@id="showsuffix"]').isChecked()).toBeTruthy();
// showtags
await page.locator('//*[@id="showtags"]').click();
expect(await page.locator('//*[@id="showtags"]').isChecked()).toBeTruthy();
// showtemperature
await page.locator('//*[@id="showtemperature"]').click();
expect(
await page.locator('//*[@id="showtemperature"]').isChecked()
).toBeFalsy();
// showtop_k
await page.locator('//*[@id="showtop_k"]').click();
expect(await page.locator('//*[@id="showtop_k"]').isChecked()).toBeTruthy();
// showtop_p
await page.locator('//*[@id="showtop_p"]').click();
expect(await page.locator('//*[@id="showtop_p"]').isChecked()).toBeTruthy();
// showuse_mlock
await page.locator('//*[@id="showuse_mlock"]').click();
expect(
await page.locator('//*[@id="showuse_mlock"]').isChecked()
).toBeTruthy();
// showuse_mmap
await page.locator('//*[@id="showuse_mmap"]').click();
expect(
await page.locator('//*[@id="showuse_mmap"]').isChecked()
).toBeTruthy();
// showverbose
await page.locator('//*[@id="showverbose"]').click();
expect(await page.locator('//*[@id="showverbose"]').isChecked()).toBeTruthy();
// showvocab_only
await page.locator('//*[@id="showvocab_only"]').click();
expect(
await page.locator('//*[@id="showvocab_only"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showcache"]').click();
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy();
// showecho
await page.locator('//*[@id="showecho"]').click();
expect(await page.locator('//*[@id="showecho"]').isChecked()).toBeFalsy();
await page.getByTestId("showformat").click();
expect(await page.locator('//*[@id="showformat"]').isChecked()).toBeTruthy();
// showf16_kv
await page.locator('//*[@id="showf16_kv"]').click();
expect(await page.locator('//*[@id="showf16_kv"]').isChecked()).toBeFalsy();
await page.getByTestId("showformat").click();
expect(await page.locator('//*[@id="showformat"]').isChecked()).toBeFalsy();
// showgrammar_path
await page.locator('//*[@id="showgrammar_path"]').click();
await page.getByTestId("showmirostat").click();
expect(
await page.locator('//*[@id="showgrammar_path"]').isChecked()
).toBeFalsy();
// showlast_n_tokens_size
await page.locator('//*[@id="showlast_n_tokens_size"]').click();
expect(
await page.locator('//*[@id="showlast_n_tokens_size"]').isChecked()
).toBeFalsy();
// showlogits_all
await page.locator('//*[@id="showlogits_all"]').click();
expect(
await page.locator('//*[@id="showlogits_all"]').isChecked()
).toBeFalsy();
// showlogprobs
await page.locator('//*[@id="showlogprobs"]').click();
expect(await page.locator('//*[@id="showlogprobs"]').isChecked()).toBeFalsy();
// showlora_base
await page.locator('//*[@id="showlora_base"]').click();
expect(
await page.locator('//*[@id="showlora_base"]').isChecked()
).toBeFalsy();
// showlora_path
await page.locator('//*[@id="showlora_path"]').click();
expect(
await page.locator('//*[@id="showlora_path"]').isChecked()
).toBeFalsy();
// showmax_tokens
await page.locator('//*[@id="showmax_tokens"]').click();
expect(
await page.locator('//*[@id="showmax_tokens"]').isChecked()
).toBeFalsy();
// showmodel_path
await page.locator('//*[@id="showmodel_path"]').click();
expect(
await page.locator('//*[@id="showmodel_path"]').isChecked()
await page.locator('//*[@id="showmirostat"]').isChecked()
).toBeTruthy();
// shown_batch
await page.locator('//*[@id="shown_batch"]').click();
expect(await page.locator('//*[@id="shown_batch"]').isChecked()).toBeFalsy();
await page.getByTestId("showmirostat").click();
expect(await page.locator('//*[@id="showmirostat"]').isChecked()).toBeFalsy();
// shown_ctx
await page.locator('//*[@id="shown_ctx"]').click();
expect(await page.locator('//*[@id="shown_ctx"]').isChecked()).toBeFalsy();
// shown_gpu_layers
await page.locator('//*[@id="shown_gpu_layers"]').click();
await page.getByTestId("showmirostat_eta").click();
expect(
await page.locator('//*[@id="shown_gpu_layers"]').isChecked()
await page.locator('//*[@id="showmirostat_eta"]').isChecked()
).toBeTruthy();
await page.getByTestId("showmirostat_eta").click();
expect(
await page.locator('//*[@id="showmirostat_eta"]').isChecked()
).toBeFalsy();
// shown_parts
await page.locator('//*[@id="shown_parts"]').click();
expect(await page.locator('//*[@id="shown_parts"]').isChecked()).toBeFalsy();
// shown_threads
await page.locator('//*[@id="shown_threads"]').click();
await page.getByTestId("showmirostat_tau").click();
expect(
await page.locator('//*[@id="shown_threads"]').isChecked()
await page.locator('//*[@id="showmirostat_tau"]').isChecked()
).toBeTruthy();
await page.getByTestId("showmirostat_tau").click();
expect(
await page.locator('//*[@id="showmirostat_tau"]').isChecked()
).toBeFalsy();
// showrepeat_penalty
await page.locator('//*[@id="showrepeat_penalty"]').click();
await page.getByTestId("showmodel").click();
expect(await page.locator('//*[@id="showmodel"]').isChecked()).toBeFalsy();
await page.getByTestId("showmodel").click();
expect(await page.locator('//*[@id="showmodel"]').isChecked()).toBeTruthy();
await page.getByTestId("shownum_ctx").click();
expect(await page.locator('//*[@id="shownum_ctx"]').isChecked()).toBeTruthy();
await page.getByTestId("shownum_ctx").click();
expect(await page.locator('//*[@id="shownum_ctx"]').isChecked()).toBeFalsy();
await page.getByTestId("shownum_gpu").click();
expect(await page.locator('//*[@id="shownum_gpu"]').isChecked()).toBeTruthy();
await page.getByTestId("shownum_gpu").click();
expect(await page.locator('//*[@id="shownum_gpu"]').isChecked()).toBeFalsy();
await page.getByTestId("shownum_thread").click();
expect(
await page.locator('//*[@id="showrepeat_penalty"]').isChecked()
await page.locator('//*[@id="shownum_thread"]').isChecked()
).toBeTruthy();
await page.getByTestId("shownum_thread").click();
expect(
await page.locator('//*[@id="shownum_thread"]').isChecked()
).toBeFalsy();
// showrope_freq_base
await page.locator('//*[@id="showrope_freq_base"]').click();
await page.getByTestId("showrepeat_last_n").click();
expect(
await page.locator('//*[@id="showrope_freq_base"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showrepeat_last_n"]').isChecked()
).toBeTruthy();
// showrope_freq_scale
await page.locator('//*[@id="showrope_freq_scale"]').click();
await page.getByTestId("showrepeat_last_n").click();
expect(
await page.locator('//*[@id="showrope_freq_scale"]').isChecked()
).toBeFalsy();
// showseed
await page.locator('//*[@id="showseed"]').click();
expect(await page.locator('//*[@id="showseed"]').isChecked()).toBeFalsy();
// showstop
await page.locator('//*[@id="showstop"]').click();
expect(await page.locator('//*[@id="showstop"]').isChecked()).toBeFalsy();
// showstreaming
await page.locator('//*[@id="showstreaming"]').click();
expect(
await page.locator('//*[@id="showstreaming"]').isChecked()
).toBeFalsy();
// showsuffix
await page.locator('//*[@id="showsuffix"]').click();
expect(await page.locator('//*[@id="showsuffix"]').isChecked()).toBeFalsy();
// showtags
await page.locator('//*[@id="showtags"]').click();
expect(await page.locator('//*[@id="showtags"]').isChecked()).toBeFalsy();
// showtop_k
await page.locator('//*[@id="showtop_k"]').click();
expect(await page.locator('//*[@id="showtop_k"]').isChecked()).toBeFalsy();
// showtop_p
await page.locator('//*[@id="showtop_p"]').click();
expect(await page.locator('//*[@id="showtop_p"]').isChecked()).toBeFalsy();
// showuse_mlock
await page.locator('//*[@id="showuse_mlock"]').click();
expect(
await page.locator('//*[@id="showuse_mlock"]').isChecked()
).toBeFalsy();
// showuse_mmap
await page.locator('//*[@id="showuse_mmap"]').click();
expect(await page.locator('//*[@id="showuse_mmap"]').isChecked()).toBeFalsy();
// showverbose
await page.locator('//*[@id="showverbose"]').click();
expect(await page.locator('//*[@id="showverbose"]').isChecked()).toBeFalsy();
// showvocab_only
await page.locator('//*[@id="showvocab_only"]').click();
expect(
await page.locator('//*[@id="showvocab_only"]').isChecked()
await page.locator('//*[@id="showrepeat_last_n"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="saveChangesBtn"]').click();

View file

@ -1,36 +1,42 @@
import { Page, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(6000);
// test.setTimeout(120000);
});
test.describe("Flow Page tests", () => {
async function goToFlowPage(page: Page) {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.getByRole("button", { name: "New Project" }).click();
}
test("save", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("custom");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.locator('//*[@id="helpersCustom Component"]')
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
// await page.getByTestId("icon-ExternalLink").click();
// await page.locator('//*[@id="checkAndSaveBtn"]').click();
});

View file

@ -1,4 +1,4 @@
import { expect, test } from "@playwright/test";
import { test } from "@playwright/test";
test.describe("group node test", () => {
/// <reference lib="dom"/>
@ -6,24 +6,22 @@ test.describe("group node test", () => {
await page.goto("/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByRole("heading", { name: "Data Ingestion" }).click();
await page
.getByRole("heading", { name: "Basic Prompting" })
.first()
.click();
await page.waitForTimeout(2000);
await page.getByLabel("fit view").click();
await page.keyboard.down("Control");
await page
.getByTestId("title-OpenAIEmbeddings")
.click({ modifiers: ["Control"] });
await page.getByTestId("title-URL").click({ modifiers: ["Control"] });
await page
.getByTestId("title-Recursive Character Text Splitter")
.click({ modifiers: ["Control"] });
await page.keyboard.up("Control");
await page.getByLabel("fit view").first().click();
await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] });
await page.getByTestId("title-Prompt").click({ modifiers: ["Control"] });
await page.getByTestId("title-OpenAI").click({ modifiers: ["Control"] });
await page.getByRole("button", { name: "Group" }).click();
await page.getByTestId(/input-collection_name_Chroma-.*/).click();
await page.getByTestId(/input-collection_name_Chroma-.*/).fill("test");
await page.getByTestId("title-Group").click();
await page.getByTestId("title-Group").dblclick();
await page.getByTestId("input-title-Group").first().fill("test");
await page.getByTestId("icon-Ungroup").first().click();
await page.keyboard.press("Control+g");
const value = await page.getByTestId("input-collection_name").inputValue();
expect(value).toBe("test");
await page.getByTestId("title-OpenAI").isVisible();
await page.getByTestId("title-Prompt").isVisible();
});
});

View file

@ -1,29 +1,36 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(8000);
// test.setTimeout(120000);
});
test("InputComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("Chroma");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("vectorstoresChroma")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("input-collection_name").click();
await page
.getByTestId("input-collection_name")

View file

@ -0,0 +1,190 @@
import { expect, test } from "@playwright/test";
test("InputListComponent", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("astradb search");
await page.waitForTimeout(1000);
await page
.getByTestId("vectorsearchAstraDB Search")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("div-generic-node").click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
expect(
await page.getByTestId("showmetadata_indexing_exclude").isChecked()
).toBeFalsy();
await page.getByTestId("showmetadata_indexing_exclude").click();
expect(
await page.getByTestId("showmetadata_indexing_exclude").isChecked()
).toBeTruthy();
expect(
await page.getByTestId("showmetadata_indexing_include").isChecked()
).toBeFalsy();
await page.getByTestId("showmetadata_indexing_include").click();
expect(
await page.getByTestId("showmetadata_indexing_include").isChecked()
).toBeTruthy();
await page
.getByTestId("input-list-input-edit_metadata_indexing_include-0")
.fill("test test test test");
await page
.getByTestId("input-list-plus-btn-edit_metadata_indexing_include-0")
.click();
await page
.getByTestId("input-list-input-edit_metadata_indexing_include-1")
.fill("test1 test1 test1 test1");
await page.locator('//*[@id="saveChangesBtn"]').click();
await page
.getByTestId("input-list-input_metadata_indexing_include-0")
.fill("test test test test");
const value0 = await page
.getByTestId("input-list-input_metadata_indexing_include-0")
.inputValue();
const value1 = await page
.getByTestId("input-list-input_metadata_indexing_include-1")
.inputValue();
if (
value0 !== "test test test test" ||
value1 !== "test1 test1 test1 test1"
) {
expect(false).toBeTruthy();
}
await page
.getByTestId("input-list-minus-btn_metadata_indexing_include-0")
.click();
const plusButtonLocator = page.getByTestId(
"input-list-plus-btn_metadata_indexing_include-1"
);
const elementCount = await plusButtonLocator.count();
if (elementCount > 0) {
expect(false).toBeTruthy();
}
await page
.getByTestId("input-list-plus-btn_metadata_indexing_include-0")
.click();
await page
.getByTestId("input-list-plus-btn_metadata_indexing_include-1")
.click();
await page
.getByTestId("input-list-plus-btn_metadata_indexing_include-2")
.click();
await page
.getByTestId("input-list-plus-btn_metadata_indexing_include-3")
.click();
await page
.getByTestId("input-list-input_metadata_indexing_include-0")
.fill("test test test test");
await page
.getByTestId("input-list-input_metadata_indexing_include-1")
.fill("test1 test1 test1 test1");
await page
.getByTestId("input-list-input_metadata_indexing_include-2")
.fill("test2 test2 test2 test2");
await page
.getByTestId("input-list-input_metadata_indexing_include-3")
.fill("test3 test3 test3 test3");
await page.getByTestId("div-generic-node").click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
const value0Edit = await page
.getByTestId("input-list-input-edit_metadata_indexing_include-0")
.inputValue();
const value1Edit = await page
.getByTestId("input-list-input-edit_metadata_indexing_include-1")
.inputValue();
const value2Edit = await page
.getByTestId("input-list-input-edit_metadata_indexing_include-2")
.inputValue();
const value3Edit = await page
.getByTestId("input-list-input-edit_metadata_indexing_include-3")
.inputValue();
if (
value0Edit !== "test test test test" ||
value1Edit !== "test1 test1 test1 test1" ||
value2Edit !== "test2 test2 test2 test2" ||
value3Edit !== "test3 test3 test3 test3"
) {
expect(false).toBeTruthy();
}
await page
.getByTestId("input-list-minus-btn-edit_metadata_indexing_include-0")
.click();
await page
.getByTestId("input-list-minus-btn-edit_metadata_indexing_include-1")
.click();
await page
.getByTestId("input-list-minus-btn-edit_metadata_indexing_include-1")
.click();
const plusButtonLocatorEdit0 = await page.getByTestId(
"input-list-plus-btn-edit_metadata_indexing_include-0"
);
const elementCountEdit0 = await plusButtonLocatorEdit0.count();
const plusButtonLocatorEdit2 = await page.getByTestId(
"input-list-plus-btn-edit_metadata_indexing_include-2"
);
const elementCountEdit2 = await plusButtonLocatorEdit2.count();
if (elementCountEdit0 > 0 || elementCountEdit2 > 0) {
expect(false).toBeTruthy();
}
const minusButtonLocatorEdit1 = await page.getByTestId(
"input-list-minus-btn-edit_metadata_indexing_include-1"
);
const elementCountMinusEdit1 = await minusButtonLocatorEdit1.count();
const minusButtonLocatorEdit2 = await page.getByTestId(
"input-list-minus-btn-edit_metadata_indexing_include-2"
);
const elementCountMinusEdit2 = await minusButtonLocatorEdit2.count();
if (elementCountMinusEdit1 > 0 || elementCountMinusEdit2 > 0) {
expect(false).toBeTruthy();
}
});

View file

@ -1,30 +1,37 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(9000);
// test.setTimeout(120000);
});
test("IntComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("openai");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("modelsOpenAI")
.getByTestId("model_specsChatOpenAI")
.first()
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("int-input-max_tokens").click();
await page
.getByTestId("int-input-max_tokens")
@ -45,6 +52,19 @@ test("IntComponent", async ({ page }) => {
expect(false).toBeTruthy();
}
await page.getByTestId("title-ChatOpenAI").click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("edit-button-modal").click();
@ -59,11 +79,6 @@ test("IntComponent", async ({ page }) => {
.getByTestId("edit-int-input-max_tokens")
.fill("123456789123456789123456789");
await page.locator('//*[@id="showinput_value"]').click();
expect(
await page.locator('//*[@id="showinput_value"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
@ -84,19 +99,11 @@ test("IntComponent", async ({ page }) => {
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showstream"]').click();
expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy();
await page.locator('//*[@id="showtemperature"]').click();
expect(
await page.locator('//*[@id="showtemperature"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showinput_value"]').click();
expect(
await page.locator('//*[@id="showinput_value"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
@ -117,19 +124,11 @@ test("IntComponent", async ({ page }) => {
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showstream"]').click();
expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeTruthy();
await page.locator('//*[@id="showtemperature"]').click();
expect(
await page.locator('//*[@id="showtemperature"]').isChecked()
).toBeTruthy();
await page.locator('//*[@id="showinput_value"]').click();
expect(
await page.locator('//*[@id="showinput_value"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showmodel_kwargs"]').click();
expect(
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
@ -150,9 +149,6 @@ test("IntComponent", async ({ page }) => {
await page.locator('//*[@id="showopenai_api_key"]').isChecked()
).toBeFalsy();
await page.locator('//*[@id="showstream"]').click();
expect(await page.locator('//*[@id="showstream"]').isChecked()).toBeFalsy();
await page.locator('//*[@id="showtemperature"]').click();
expect(
await page.locator('//*[@id="showtemperature"]').isChecked()

View file

@ -1,29 +1,36 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(20000);
// test.setTimeout(120000);
});
test("KeypairListComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("csv");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("documentloadersCSVLoader")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.locator('//*[@id="keypair0"]').click();
await page.locator('//*[@id="keypair0"]').fill("testtesttesttest");
await page.locator('//*[@id="keypair100"]').click();

View file

@ -1,9 +1,5 @@
import { expect, test } from "@playwright/test";
import uaParser from "ua-parser-js";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(11000);
// test.setTimeout(120000);
});
test("LangflowShortcuts", async ({ page }) => {
const getUA = await page.evaluate(() => navigator.userAgent);
const userAgentInfo = uaParser(getUA);
@ -13,7 +9,7 @@ test("LangflowShortcuts", async ({ page }) => {
control = "Meta";
}
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
@ -21,26 +17,38 @@ test("LangflowShortcuts", async ({ page }) => {
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("llamacpp");
await page.getByPlaceholder("Search").fill("ollama");
await page.waitForTimeout(1000);
await page
.locator('//*[@id="model_specsLlamaCpp"]')
.getByTestId("modelsOllama")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page.getByTestId("title-LlamaCpp").click();
await page.keyboard.press(`${control}+e`);
await page.locator('//*[@id="react-flow-id"]/div/div[2]/button[3]').click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("title-Ollama").click();
await page.keyboard.press(`${control}+Shift+A`);
await page.locator('//*[@id="saveChangesBtn"]').click();
await page.getByTestId("title-LlamaCpp").click();
await page.getByTestId("title-Ollama").click();
await page.keyboard.press(`${control}+d`);
let numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
let numberOfNodes = await page.getByTestId("title-Ollama").count();
if (numberOfNodes != 2) {
expect(false).toBeTruthy();
}
@ -52,18 +60,18 @@ test("LangflowShortcuts", async ({ page }) => {
.click();
await page.keyboard.press("Backspace");
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
numberOfNodes = await page.getByTestId("title-Ollama").count();
if (numberOfNodes != 1) {
expect(false).toBeTruthy();
}
await page.getByTestId("title-LlamaCpp").click();
await page.getByTestId("title-Ollama").click();
await page.keyboard.press(`${control}+c`);
await page.getByTestId("title-LlamaCpp").click();
await page.getByTestId("title-Ollama").click();
await page.keyboard.press(`${control}+v`);
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
numberOfNodes = await page.getByTestId("title-Ollama").count();
if (numberOfNodes != 2) {
expect(false).toBeTruthy();
}
@ -75,15 +83,15 @@ test("LangflowShortcuts", async ({ page }) => {
.click();
await page.keyboard.press("Backspace");
await page.getByTestId("title-LlamaCpp").click();
await page.getByTestId("title-Ollama").click();
await page.keyboard.press(`${control}+x`);
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
numberOfNodes = await page.getByTestId("title-Ollama").count();
if (numberOfNodes != 0) {
expect(false).toBeTruthy();
}
await page.keyboard.press(`${control}+v`);
numberOfNodes = await page.getByTestId("title-LlamaCpp").count();
numberOfNodes = await page.getByTestId("title-Ollama").count();
if (numberOfNodes != 1) {
expect(false).toBeTruthy();
}

View file

@ -1,22 +1,19 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(12000);
// test.setTimeout(120000);
});
test("NestedComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("pinecone");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("vectorstoresPinecone")

View file

@ -1,33 +1,38 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(13000);
// test.setTimeout(120000);
});
test("PromptTemplateComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("prompt");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.locator('//*[@id="inputsPrompt"]')
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("prompt-input-template").click();
// await page.getByTestId("edit-prompt-sanitized").click();
// await page.getByTestId("modal-title").click();
await page
.getByTestId("modal-prompt-input-template")
.fill("{prompt} example {prompt1}");
@ -63,7 +68,8 @@ test("PromptTemplateComponent", async ({ page }) => {
await page.getByTestId("save-button-modal").click();
const replace = await page.getByTestId("replace-button");
const replace = await page.getByTestId("replace-button").isVisible();
if (replace) {
await page.getByTestId("replace-button").click();
}

View file

@ -4,7 +4,7 @@ test("python_api_generation", async ({ page, context }) => {
await page.goto("/");
await page.locator('//*[@id="new-project-btn"]').click();
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
await page.getByRole("heading", { name: "Data Ingestion" }).click();
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.waitForTimeout(2000);
await page.getByText("API", { exact: true }).click();
await page.getByRole("tab", { name: "Python API" }).click();

View file

@ -1,9 +1,6 @@
import { Page, expect, test } from "@playwright/test";
import { readFileSync } from "fs";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(14000);
// test.setTimeout(120000);
});
test.describe("save component tests", () => {
async function saveComponent(page: Page, pattern: RegExp, n: number) {
for (let i = 0; i < n; i++) {
@ -14,11 +11,11 @@ test.describe("save component tests", () => {
/// <reference lib="dom"/>
test("save group component tests", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
// Read your file into a buffer.
const jsonContent = readFileSync(
@ -37,7 +34,7 @@ test.describe("save component tests", () => {
return dt;
}, jsonContent);
page.waitForTimeout(2000);
page.waitForTimeout(1000);
// Now dispatch
await page.dispatchEvent(
@ -85,15 +82,15 @@ test.describe("save component tests", () => {
await page.getByTestId("title-Group").click();
await page.getByTestId("icon-SaveAll").click();
const replaceButton = page.getByTestId("replace-button");
const replaceButton = await page.getByTestId("replace-button").isVisible();
if (replaceButton) {
await replaceButton.click();
await page.getByTestId("replace-button").click();
}
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("group");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("saved_componentsGroup")
@ -101,7 +98,17 @@ test.describe("save component tests", () => {
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
textArea = page.getByTestId("div-textarea-description");
elementCountText = await textArea.count();
if (elementCountText > 0) {

View file

@ -0,0 +1,218 @@
import { expect, test } from "@playwright/test";
test("should exists Store", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").isVisible();
await page.getByTestId("button-store").isEnabled();
});
test("should not have an API key", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(2000);
await page.getByText("API Key Error").isVisible();
});
test("should find a searched Component on Store", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("search-store-input").fill("File Loader");
await page.getByTestId("search-store-button").click();
await page.getByText("File Loader").isVisible();
await page.getByTestId("search-store-input").fill("Basic RAG");
await page.getByTestId("search-store-button").click();
await page.getByText("Basic RAG").isVisible();
await page.getByTestId("search-store-input").fill("YouTube QA");
await page.getByTestId("search-store-button").click();
await page.getByText("YouTube QA").isVisible();
});
test("should filter by tag", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("tag-selector-Agent").click();
await page.getByText("File Loader").isVisible();
await page.getByTestId("tag-selector-Agent").click();
await page.getByText("Album Cover Builder").isVisible();
await page.getByTestId("tag-selector-Memory").click();
await page.getByText("MP3 QA12").isVisible();
await page.getByTestId("tag-selector-Chain").click();
await page.getByText("There are no").isVisible();
await page.getByTestId("tag-selector-Chain").click();
await page.getByTestId("tag-selector-Vector Store").click();
await page.getByText("MP3 QA12").isVisible();
await page.getByTestId("tag-selector-Vector Store").click();
await page.getByTestId("tag-selector-Memory").click();
await page.getByText("Basic RAG").isVisible();
});
test("should order the visualization", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByText("Basic RAG").isVisible();
await page.getByTestId("select-order-store").click();
await page.getByText("Alphabetical").click();
await page.getByText("Album Cover Builder").isVisible();
await page.getByTestId("select-order-store").click();
await page.getByText("Popular").click();
await page.getByText("Basic RAG").isVisible();
});
test("should filter by type", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByText("Website Content QA").isVisible();
await page.getByTestId("flows-button-store").click();
await page.waitForTimeout(3000);
let iconGroup = await page.getByTestId("icon-Group").count();
expect(iconGroup).not.toBe(0);
await page.getByText("icon-ToyBrick").isHidden();
await page.getByTestId("components-button-store").click();
await page.waitForTimeout(3000);
await page.getByTestId("icon-Group").isHidden();
let toyBrick = await page.getByTestId("icon-ToyBrick").count();
expect(toyBrick).not.toBe(0);
await page.getByTestId("all-button-store").click();
await page.waitForTimeout(3000);
iconGroup = await page.getByTestId("icon-Group").count();
toyBrick = await page.getByTestId("icon-ToyBrick").count();
if (iconGroup === 0 || toyBrick === 0) {
expect(false).toBe(true);
}
});
test("should add API-KEY", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("testtesttesttesttesttest");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page.waitForTimeout(2000);
await page.getByText("API Key Error").isVisible();
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("x1fOKU0v2e5zL5d-BZW6CxZBZvoyuFgF");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page.waitForTimeout(2000);
await page.getByText("API Key Error").isHidden();
});
test("should like and add components and flows", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.getByTestId("button-store").click();
await page.waitForTimeout(1000);
await page.getByTestId("api-key-button-store").click();
await page
.getByPlaceholder("Insert your API Key")
.fill("x1fOKU0v2e5zL5d-BZW6CxZBZvoyuFgF");
await page.getByTestId("api-key-save-button-store").click();
await page.waitForTimeout(2000);
await page.getByText("Success! Your API Key has been saved.").isVisible();
await page.waitForTimeout(2000);
await page.getByText("API Key Error").isHidden();
const likedValue = await page
.getByTestId("likes-Website Content QA")
.innerText();
await page.getByTestId("like-Website Content QA").click();
await page.waitForTimeout(5000);
const likedValueAfter = await page
.getByTestId("likes-Website Content QA")
.innerText();
if (Number(likedValue) === Number(likedValueAfter)) {
expect(false).toBe(true);
}
const downloadValue = await page
.getByTestId("downloads-Website Content QA")
.innerText();
await page.getByTestId("install-Website Content QA").click();
await page.waitForTimeout(2000);
await page.getByText("Flow Installed Successfully").isVisible();
await page.waitForTimeout(5000);
const downloadValueAfter = await page
.getByTestId("downloads-Website Content QA")
.innerText();
if (Number(downloadValue) === Number(downloadValueAfter)) {
expect(false).toBe(true);
}
await page.getByTestId("install-Basic RAG").click();
await page.waitForTimeout(2000);
await page.getByText("Component Installed Successfully").isVisible();
await page.waitForTimeout(5000);
await page.getByText("My Collection").click();
await page.getByText("Website Content QA").first().isVisible();
await page.getByTestId("sidebar-nav-Components").click();
await page.getByText("Basic RAG").first().isVisible();
});

View file

@ -0,0 +1,74 @@
import { expect, test } from "@playwright/test";
test("TextAreaModalComponent", async ({ page }) => {
await page.goto("http://localhost:3000/");
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(1000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("prompt");
await page.waitForTimeout(1000);
await page
.locator('//*[@id="inputsPrompt"]')
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("prompt-input-template").click();
await page.getByTestId("modal-prompt-input-template").fill("{text}");
let valueBadgeOne = await page.locator('//*[@id="badge0"]').innerText();
if (valueBadgeOne != "text") {
expect(false).toBeTruthy();
}
await page.getByTestId("genericModalBtnSave").click();
await page
.getByTestId("textarea-text")
.fill(
"test test test test test test test test test test test !@#%*)( 123456789101010101010101111111111 !!!!!!!!!!"
);
await page.getByTestId("textarea-text-ExternalLink").click();
await page.waitForTimeout(500);
const value = await page.getByTestId("text-area-modal").inputValue();
if (
value !=
"test test test test test test test test test test test !@#%*)( 123456789101010101010101111111111 !!!!!!!!!!"
) {
expect(false).toBeTruthy();
}
await page.getByTestId("text-area-modal").fill("test123123");
await page.getByTestId("genericModalBtnSave").click();
const valueTextArea = await page.getByTestId("textarea-text").inputValue();
if (valueTextArea != "test123123") {
expect(false).toBeTruthy();
}
});

View file

@ -1,27 +1,37 @@
import { expect, test } from "@playwright/test";
test.beforeEach(async ({ page }) => {
// await page.waitForTimeout(15000);
// test.setTimeout(120000);
});
test("ToggleComponent", async ({ page }) => {
await page.goto("/");
await page.goto("http:localhost:3000/");
await page.waitForTimeout(2000);
await page.locator('//*[@id="new-project-btn"]').click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page.getByTestId("extended-disclosure").click();
await page.getByPlaceholder("Search").click();
await page.getByPlaceholder("Search").fill("directoryLoader");
await page.waitForTimeout(2000);
await page.waitForTimeout(1000);
await page
.getByTestId("documentloadersDirectoryLoader")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[2]')
.click();
await page.getByTestId("div-generic-node").click();
await page.getByTestId("more-options-modal").click();

View file

@ -4,7 +4,7 @@ test("curl_api_generation", async ({ page, context }) => {
await page.goto("/");
await page.locator('//*[@id="new-project-btn"]').click();
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
await page.getByRole("heading", { name: "Data Ingestion" }).click();
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.waitForTimeout(2000);
await page.getByText("API", { exact: true }).click();
await page.getByRole("tab", { name: "cURL" }).click();
@ -17,15 +17,22 @@ test("curl_api_generation", async ({ page, context }) => {
expect(clipboardContent.length).toBeGreaterThan(0);
await page.getByRole("tab", { name: "Tweaks" }).click();
await page
.getByRole("heading", { name: "URL" })
.getByRole("heading", { name: "OpenAi" })
.locator("div")
.first()
.click();
await page.getByRole("textbox", { name: "Type something..." }).click();
await page
.getByRole("textbox", { name: "Type something..." })
.first()
.click();
await page
.getByRole("textbox", { name: "Type something..." })
.first()
.press("Control+a");
await page.getByRole("textbox", { name: "Type something..." }).fill("teste");
await page
.getByRole("textbox", { name: "Type something..." })
.first()
.fill("teste");
await page.getByRole("tab", { name: "cURL" }).click();
await page.getByRole("button", { name: "Copy Code" }).click();
const handle2 = await page.evaluateHandle(() =>

View file

@ -22,6 +22,9 @@ from langflow.services.database.models.flow.model import Flow, FlowCreate
from langflow.services.database.models.user.model import User, UserCreate
from langflow.services.database.utils import session_getter
from langflow.services.deps import get_db_service
from sqlmodel import Session, SQLModel, create_engine, select
from sqlmodel.pool import StaticPool
from typer.testing import CliRunner
if TYPE_CHECKING:
from langflow.services.database.service import DatabaseService