Merge branch 'cz/mergeAll' of https://github.com/langflow-ai/langflow into cz/mergeAll

This commit is contained in:
cristhianzl 2024-06-07 11:24:57 -03:00
commit dc29bb4b3d
130 changed files with 1287 additions and 1917 deletions

View file

@ -4,12 +4,12 @@ Langflow's Command Line Interface (CLI) is a powerful tool that allows you to in
The available commands are below. Navigate to their individual sections of this page to see the parameters. The available commands are below. Navigate to their individual sections of this page to see the parameters.
* [langflow](#overview) - [langflow](#overview)
* [langflow api-key](#langflow-api-key) - [langflow api-key](#langflow-api-key)
* [langflow copy-db](#langflow-copy-db) - [langflow copy-db](#langflow-copy-db)
* [langflow migration](#langflow-migration) - [langflow migration](#langflow-migration)
* [langflow run](#langflow-run) - [langflow run](#langflow-run)
* [langflow superuser](#langflow-superuser) - [langflow superuser](#langflow-superuser)
## Overview ## Overview
@ -24,7 +24,7 @@ python -m langflow
``` ```
| Command | Description | | Command | Description |
| ------- | ----------- | | ----------- | ---------------------------------------------------------------------- |
| `api-key` | Creates an API key for the default superuser if AUTO_LOGIN is enabled. | | `api-key` | Creates an API key for the default superuser if AUTO_LOGIN is enabled. |
| `copy-db` | Copy the database files to the current directory (`which langflow`). | | `copy-db` | Copy the database files to the current directory (`which langflow`). |
| `migration` | Run or test migrations. | | `migration` | Run or test migrations. |
@ -34,7 +34,7 @@ python -m langflow
### Options ### Options
| Option | Description | | Option | Description |
| ------ | ----------- | | ---------------------- | -------------------------------------------------------------------------------- |
| `--install-completion` | Install completion for the current shell. | | `--install-completion` | Install completion for the current shell. |
| `--show-completion` | Show completion for the current shell, to copy it or customize the installation. | | `--show-completion` | Show completion for the current shell, to copy it or customize the installation. |
| `--help` | Show this message and exit. | | `--help` | Show this message and exit. |
@ -62,7 +62,7 @@ python -m langflow api-key
### Options ### Options
| Option | Type | Description | | Option | Type | Description |
|------------------|------|-------------------------------------------------------------| | ----------- | ---- | ------------------------------------------------------------- |
| --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] | | --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
| --help | | Show this message and exit. | | --help | | Show this message and exit. |
@ -87,13 +87,13 @@ python -m langflow migration
``` ```
### Options ### Options
| Option | Description | | Option | Description |
|-----------------|-------------------------------------------------------------| | ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `--test, --no-test` | Run migrations in test mode. [default: test] | | `--test, --no-test` | Run migrations in test mode. [default: test] |
| `--fix, --no-fix` | Fix migrations. This is a destructive operation, and should only be used if you know what you are doing. [default: no-fix] | | `--fix, --no-fix` | Fix migrations. This is a destructive operation, and should only be used if you know what you are doing. [default: no-fix] |
| `--help` | Show this message and exit. | | `--help` | Show this message and exit. |
## langflow run ## langflow run
Run Langflow. Run Langflow.
@ -107,7 +107,7 @@ python -m langflow run
### Options ### Options
| Option | Description | | Option | Description |
|-------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--help` | Displays all available options. | | `--help` | Displays all available options. |
| `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. | | `--host` | Defines the host to bind the server to. Can be set using the `LANGFLOW_HOST` environment variable. The default is `127.0.0.1`. |
| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. | | `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. |
@ -120,11 +120,11 @@ python -m langflow run
| `--cache` | Select the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`. | | `--cache` | Select the type of cache to use. Options are `InMemoryCache` and `SQLiteCache`. Can be set using the `LANGFLOW_LANGCHAIN_CACHE` environment variable. The default is `SQLiteCache`. |
| `--dev`/`--no-dev` | Toggles the development mode. The default is `no-dev`. | | `--dev`/`--no-dev` | Toggles the development mode. The default is `no-dev`. |
| `--path` | Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable. | | `--path` | Specifies the path to the frontend directory containing build files. This option is for development purposes only. Can be set using the `LANGFLOW_FRONTEND_PATH` environment variable. |
| `--open-browser`/`--no-open-browser`| Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`. | | `--open-browser`/`--no-open-browser` | Toggles the option to open the browser after starting the server. Can be set using the `LANGFLOW_OPEN_BROWSER` environment variable. The default is `open-browser`. |
| `--remove-api-keys`/`--no-remove-api-keys`| Toggles the option to remove API keys from the projects saved in the database. Can be set using the `LANGFLOW_REMOVE_API_KEYS` environment variable. The default is `no-remove-api-keys`. | | `--remove-api-keys`/`--no-remove-api-keys` | Toggles the option to remove API keys from the projects saved in the database. Can be set using the `LANGFLOW_REMOVE_API_KEYS` environment variable. The default is `no-remove-api-keys`. |
| `--install-completion [bash\|zsh\|fish\|powershell\|pwsh]`| Installs completion for the specified shell. | | `--install-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Installs completion for the specified shell. |
| `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. | | `--show-completion [bash\|zsh\|fish\|powershell\|pwsh]` | Shows completion for the specified shell, allowing you to copy it or customize the installation. |
| `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. For more, see [Backend-only](../deployment/backend-only.md).| | `--backend-only` | This parameter, with a default value of `False`, allows running only the backend server without the frontend. It can also be set using the `LANGFLOW_BACKEND_ONLY` environment variable. For more, see [Backend-only](../deployment/backend-only.md). |
| `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. | | `--store` | This parameter, with a default value of `True`, enables the store features, use `--no-store` to deactivate it. It can be configured using the `LANGFLOW_STORE` environment variable. |
#### Environment Variables #### Environment Variables
@ -146,9 +146,8 @@ python -m langflow superuser
### Options ### Options
| Option | Type | Description | | Option | Type | Description |
|----------------|-------|-------------------------------------------------------------| | ------------- | ---- | ------------------------------------------------------------- |
| `--username` | TEXT | Username for the superuser. [default: None] [required] | | `--username` | TEXT | Username for the superuser. [default: None] [required] |
| `--password` | TEXT | Password for the superuser. [default: None] [required] | | `--password` | TEXT | Password for the superuser. [default: None] [required] |
| `--log-level` | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] | | `--log-level` | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
| `--help` | | Show this message and exit. | | `--help` | | Show this message and exit. |

View file

@ -1,4 +1,5 @@
# Backend-only # Backend-only
You can run Langflow in `--backend-only` mode to expose your Langflow app as an API, without running the frontend UI. You can run Langflow in `--backend-only` mode to expose your Langflow app as an API, without running the frontend UI.
Start langflow in backend-only mode with `python3 -m langflow run --backend-only`. Start langflow in backend-only mode with `python3 -m langflow run --backend-only`.
@ -8,17 +9,18 @@ Langflow will now serve requests to its API without the frontend running.
## Prerequisites ## Prerequisites
* [Langflow installed](../getting-started/install-langflow.mdx) - [Langflow installed](../getting-started/install-langflow.mdx)
* [OpenAI API key](https://platform.openai.com) - [OpenAI API key](https://platform.openai.com)
* [A Langflow flow created](../starter-projects/basic-prompting.mdx) - [A Langflow flow created](../starter-projects/basic-prompting.mdx)
## Download your flow's curl call ## Download your flow's curl call
1. Click API. 1. Click API.
2. Click **curl** > **Copy code** and save the code to your local machine. 2. Click **curl** > **Copy code** and save the code to your local machine.
It will look something like this: It will look something like this:
```curl ```curl
curl -X POST \ curl -X POST \
"http://127.0.0.1:7864/api/v1/run/ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef?stream=false" \ "http://127.0.0.1:7864/api/v1/run/ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef?stream=false" \
@ -33,19 +35,22 @@ curl -X POST \
"ChatInput-xXC4F": {} "ChatInput-xXC4F": {}
}}' }}'
``` ```
Note the flow ID of `ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef`. You can find this ID in the UI as well to ensure you're querying the right flow. Note the flow ID of `ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef`. You can find this ID in the UI as well to ensure you're querying the right flow.
## Start Langflow in backend-only mode ## Start Langflow in backend-only mode
1. Stop Langflow with Ctrl+C. 1. Stop Langflow with Ctrl+C.
2. Start langflow in backend-only mode with `python3 -m langflow run --backend-only`. 2. Start langflow in backend-only mode with `python3 -m langflow run --backend-only`.
The terminal prints ` Welcome to ⛓ Langflow `, and a blank window opens at `http://127.0.0.1:7864/all`. The terminal prints ` Welcome to ⛓ Langflow `, and a blank window opens at `http://127.0.0.1:7864/all`.
Langflow will now serve requests to its API. Langflow will now serve requests to its API.
3. Run the curl code you copied from the UI. 3. Run the curl code you copied from the UI.
You should get a result like this: You should get a result like this:
```bash ```bash
{"session_id":"ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef:bf81d898868ac87e1b4edbd96c131c5dee801ea2971122cc91352d144a45b880","outputs":[{"inputs":{"input_value":"hi, are you there?"},"outputs":[{"results":{"result":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?"},"artifacts":{"message":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?","sender":"Machine","sender_name":"AI"},"messages":[{"message":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?","sender":"Machine","sender_name":"AI","component_id":"ChatOutput-ktwdw"}],"component_display_name":"Chat Output","component_id":"ChatOutput-ktwdw","used_frozen_result":false}]}]}% {"session_id":"ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef:bf81d898868ac87e1b4edbd96c131c5dee801ea2971122cc91352d144a45b880","outputs":[{"inputs":{"input_value":"hi, are you there?"},"outputs":[{"results":{"result":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?"},"artifacts":{"message":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?","sender":"Machine","sender_name":"AI"},"messages":[{"message":"Arrr, ahoy matey! Aye, I be here. What be ye needin', me hearty?","sender":"Machine","sender_name":"AI","component_id":"ChatOutput-ktwdw"}],"component_display_name":"Chat Output","component_id":"ChatOutput-ktwdw","used_frozen_result":false}]}]}%
``` ```
Again, note that the flow ID matches. Again, note that the flow ID matches.
Langflow is receiving your POST request, running the flow, and returning the result, all without running the frontend. Cool! Langflow is receiving your POST request, running the flow, and returning the result, all without running the frontend. Cool!
@ -55,7 +60,8 @@ Instead of using curl, you can download your flow as a Python API call instead.
1. Click API. 1. Click API.
2. Click **Python API** > **Copy code** and save the code to your local machine. 2. Click **Python API** > **Copy code** and save the code to your local machine.
The code will look something like this: The code will look something like this:
```python ```python
import requests import requests
from typing import Optional from typing import Optional
@ -99,15 +105,19 @@ message = "message"
print(run_flow(message=message, flow_id=FLOW_ID)) print(run_flow(message=message, flow_id=FLOW_ID))
``` ```
3. Run your Python app: 3. Run your Python app:
```python ```python
python3 app.py python3 app.py
``` ```
The result is similar to the curl call: The result is similar to the curl call:
```bash ```bash
{'session_id': 'ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef:bf81d898868ac87e1b4edbd96c131c5dee801ea2971122cc91352d144a45b880', 'outputs': [{'inputs': {'input_value': 'message'}, 'outputs': [{'results': {'result': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!"}, 'artifacts': {'message': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!", 'sender': 'Machine', 'sender_name': 'AI'}, 'messages': [{'message': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!", 'sender': 'Machine', 'sender_name': 'AI', 'component_id': 'ChatOutput-ktwdw'}], 'component_display_name': 'Chat Output', 'component_id': 'ChatOutput-ktwdw', 'used_frozen_result': False}]}]} {'session_id': 'ef7e0554-69e5-4e3e-ab29-ee83bcd8d9ef:bf81d898868ac87e1b4edbd96c131c5dee801ea2971122cc91352d144a45b880', 'outputs': [{'inputs': {'input_value': 'message'}, 'outputs': [{'results': {'result': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!"}, 'artifacts': {'message': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!", 'sender': 'Machine', 'sender_name': 'AI'}, 'messages': [{'message': "Arrr matey! What be yer message for this ol' pirate? Speak up or walk the plank!", 'sender': 'Machine', 'sender_name': 'AI', 'component_id': 'ChatOutput-ktwdw'}], 'component_display_name': 'Chat Output', 'component_id': 'ChatOutput-ktwdw', 'used_frozen_result': False}]}]}
``` ```
Your Python app POSTs to your Langflow server, and the server runs the flow and returns the result. Your Python app POSTs to your Langflow server, and the server runs the flow and returns the result.
See [API](../administration/api.mdx) for more ways to interact with your headless Langflow server. See [API](../administration/api.mdx) for more ways to interact with your headless Langflow server.

View file

@ -113,7 +113,8 @@ module.exports = {
type: "category", type: "category",
label: "Deployment", label: "Deployment",
collapsed: true, collapsed: true,
items: ["deployment/docker", items: [
"deployment/docker",
"deployment/backend-only", "deployment/backend-only",
"deployment/gcp-deployment", "deployment/gcp-deployment",
], ],

View file

@ -45,9 +45,7 @@
"name": "template", "name": "template",
"display_name": "Template", "display_name": "Template",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -86,22 +84,14 @@
"is_input": null, "is_input": null,
"is_output": null, "is_output": null,
"is_composition": null, "is_composition": null,
"base_classes": [ "base_classes": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"name": "", "name": "",
"display_name": "Prompt", "display_name": "Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"template": [ "template": ["user_input"]
"user_input"
]
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"full_path": null, "full_path": null,
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
@ -150,9 +140,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"code": { "code": {
"type": "code", "type": "code",
@ -235,9 +223,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_base": { "openai_api_base": {
"type": "str", "type": "str",
@ -256,9 +242,7 @@
"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.", "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, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_key": { "openai_api_key": {
"type": "str", "type": "str",
@ -277,9 +261,7 @@
"info": "The OpenAI API Key to use for the OpenAI model.", "info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": true, "load_from_db": true,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "OPENAI_API_KEY" "value": "OPENAI_API_KEY"
}, },
"stream": { "stream": {
@ -318,9 +300,7 @@
"info": "System message to pass to the model.", "info": "System message to pass to the model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"temperature": { "temperature": {
"type": "float", "type": "float",
@ -351,11 +331,7 @@
}, },
"description": "Generates text using OpenAI LLMs.", "description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI", "icon": "OpenAI",
"base_classes": [ "base_classes": ["object", "Text", "str"],
"object",
"Text",
"str"
],
"display_name": "OpenAI", "display_name": "OpenAI",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -369,9 +345,7 @@
"stream": null, "stream": null,
"system_message": null "system_message": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [ "field_order": [
@ -442,9 +416,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Message", "display_name": "Message",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -468,9 +440,7 @@
"info": "In case of Message being a Record, this template will be used to convert it to text.", "info": "In case of Message being a Record, this template will be used to convert it to text.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"return_record": { "return_record": {
"type": "bool", "type": "bool",
@ -502,10 +472,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -513,9 +480,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -535,9 +500,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -556,20 +519,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a chat message in the Playground.", "description": "Display a chat message in the Playground.",
"icon": "ChatOutput", "icon": "ChatOutput",
"base_classes": [ "base_classes": ["Record", "Text", "str", "object"],
"Record",
"Text",
"str",
"object"
],
"display_name": "Chat Output", "display_name": "Chat Output",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -580,10 +536,7 @@
"return_record": null, "return_record": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -679,10 +632,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -690,9 +640,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -712,9 +660,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -733,20 +679,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Get chat inputs from the Playground.", "description": "Get chat inputs from the Playground.",
"icon": "ChatInput", "icon": "ChatInput",
"base_classes": [ "base_classes": ["object", "Record", "str", "Text"],
"object",
"Record",
"str",
"Text"
],
"display_name": "Chat Input", "display_name": "Chat Input",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -756,10 +695,7 @@
"session_id": null, "session_id": null,
"return_record": null "return_record": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -787,17 +723,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-njtka", "id": "ChatOutput-njtka",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "Text", "str"],
"object",
"Text",
"str"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-k39HS" "id": "OpenAIModel-k39HS"
} }
@ -817,17 +747,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-k39HS", "id": "OpenAIModel-k39HS",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-uxBqP" "id": "Prompt-uxBqP"
} }
@ -847,21 +771,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "user_input", "fieldName": "user_input",
"id": "Prompt-uxBqP", "id": "Prompt-uxBqP",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "Record", "str", "Text"],
"object",
"Record",
"str",
"Text"
],
"dataType": "ChatInput", "dataType": "ChatInput",
"id": "ChatInput-P3fgL" "id": "ChatInput-P3fgL"
} }

View file

@ -45,9 +45,7 @@
"name": "template", "name": "template",
"display_name": "Template", "display_name": "Template",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -138,24 +136,14 @@
"is_input": null, "is_input": null,
"is_output": null, "is_output": null,
"is_composition": null, "is_composition": null,
"base_classes": [ "base_classes": ["object", "Text", "str"],
"object",
"Text",
"str"
],
"name": "", "name": "",
"display_name": "Prompt", "display_name": "Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"template": [ "template": ["reference_1", "reference_2", "instructions"]
"reference_1",
"reference_2",
"instructions"
]
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"full_path": null, "full_path": null,
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
@ -222,9 +210,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": [ "value": [
"https://www.promptingguide.ai/techniques/prompt_chaining" "https://www.promptingguide.ai/techniques/prompt_chaining"
] ]
@ -233,17 +219,13 @@
}, },
"description": "Fetch content from one or more URLs.", "description": "Fetch content from one or more URLs.",
"icon": "layout-template", "icon": "layout-template",
"base_classes": [ "base_classes": ["Record"],
"Record"
],
"display_name": "URL", "display_name": "URL",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"urls": null "urls": null
}, },
"output_types": [ "output_types": ["Record"],
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -302,9 +284,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Message", "display_name": "Message",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -328,9 +308,7 @@
"info": "In case of Message being a Record, this template will be used to convert it to text.", "info": "In case of Message being a Record, this template will be used to convert it to text.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"return_record": { "return_record": {
"type": "bool", "type": "bool",
@ -362,10 +340,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -373,9 +348,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -395,9 +368,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -416,20 +387,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a chat message in the Playground.", "description": "Display a chat message in the Playground.",
"icon": "ChatOutput", "icon": "ChatOutput",
"base_classes": [ "base_classes": ["Text", "Record", "object", "str"],
"Text",
"Record",
"object",
"str"
],
"display_name": "Chat Output", "display_name": "Chat Output",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -440,10 +404,7 @@
"return_record": null, "return_record": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -483,9 +444,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"code": { "code": {
"type": "code", "type": "code",
@ -568,9 +527,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_base": { "openai_api_base": {
"type": "str", "type": "str",
@ -589,9 +546,7 @@
"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.", "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, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_key": { "openai_api_key": {
"type": "str", "type": "str",
@ -610,9 +565,7 @@
"info": "The OpenAI API Key to use for the OpenAI model.", "info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "OPENAI_API_KEY" "value": "OPENAI_API_KEY"
}, },
"stream": { "stream": {
@ -651,9 +604,7 @@
"info": "System message to pass to the model.", "info": "System message to pass to the model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"temperature": { "temperature": {
"type": "float", "type": "float",
@ -684,11 +635,7 @@
}, },
"description": "Generates text using OpenAI LLMs.", "description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI", "icon": "OpenAI",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "OpenAI", "display_name": "OpenAI",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -702,9 +649,7 @@
"stream": null, "stream": null,
"system_message": null "system_message": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [ "field_order": [
@ -777,28 +722,20 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text" "value": ["https://www.promptingguide.ai/introduction/basics"]
],
"value": [
"https://www.promptingguide.ai/introduction/basics"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Fetch content from one or more URLs.", "description": "Fetch content from one or more URLs.",
"icon": "layout-template", "icon": "layout-template",
"base_classes": [ "base_classes": ["Record"],
"Record"
],
"display_name": "URL", "display_name": "URL",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"urls": null "urls": null
}, },
"output_types": [ "output_types": ["Record"],
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -858,10 +795,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Value", "display_name": "Value",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Record", "Text"],
"Record",
"Text"
],
"dynamic": false, "dynamic": false,
"info": "Text or Record to be passed as input.", "info": "Text or Record to be passed as input.",
"load_from_db": false, "load_from_db": false,
@ -885,28 +819,20 @@
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Get text inputs from the Playground.", "description": "Get text inputs from the Playground.",
"icon": "type", "icon": "type",
"base_classes": [ "base_classes": ["object", "Text", "str"],
"object",
"Text",
"str"
],
"display_name": "Instructions", "display_name": "Instructions",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"input_value": null, "input_value": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -935,18 +861,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "reference_2", "fieldName": "reference_2",
"id": "Prompt-Rse03", "id": "Prompt-Rse03",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["Record"],
"Record"
],
"dataType": "URL", "dataType": "URL",
"id": "URL-HYPkR" "id": "URL-HYPkR"
} }
@ -966,17 +885,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-JPlxl", "id": "ChatOutput-JPlxl",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-gi29P" "id": "OpenAIModel-gi29P"
} }
@ -996,18 +909,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "reference_1", "fieldName": "reference_1",
"id": "Prompt-Rse03", "id": "Prompt-Rse03",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["Record"],
"Record"
],
"dataType": "URL", "dataType": "URL",
"id": "URL-2cX90" "id": "URL-2cX90"
} }
@ -1027,20 +933,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "instructions", "fieldName": "instructions",
"id": "Prompt-Rse03", "id": "Prompt-Rse03",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "Text", "str"],
"object",
"Text",
"str"
],
"dataType": "TextInput", "dataType": "TextInput",
"id": "TextInput-og8Or" "id": "TextInput-og8Or"
} }
@ -1060,17 +957,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-gi29P", "id": "OpenAIModel-gi29P",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "Text", "str"],
"object",
"Text",
"str"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-Rse03" "id": "Prompt-Rse03"
} }

View file

@ -45,9 +45,7 @@
"name": "template", "name": "template",
"display_name": "Template", "display_name": "Template",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -112,23 +110,14 @@
"is_input": null, "is_input": null,
"is_output": null, "is_output": null,
"is_composition": null, "is_composition": null,
"base_classes": [ "base_classes": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"name": "", "name": "",
"display_name": "Prompt", "display_name": "Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"template": [ "template": ["Document", "Question"]
"Document",
"Question"
]
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"full_path": null, "full_path": null,
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
@ -231,18 +220,14 @@
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "A generic file loader.", "description": "A generic file loader.",
"base_classes": [ "base_classes": ["Record"],
"Record"
],
"display_name": "Files", "display_name": "Files",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"path": null, "path": null,
"silent_errors": null "silent_errors": null
}, },
"output_types": [ "output_types": ["Record"],
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -338,10 +323,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -349,9 +331,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -371,9 +351,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -392,20 +370,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Get chat inputs from the Playground.", "description": "Get chat inputs from the Playground.",
"icon": "ChatInput", "icon": "ChatInput",
"base_classes": [ "base_classes": ["str", "Record", "Text", "object"],
"str",
"Record",
"Text",
"object"
],
"display_name": "Chat Input", "display_name": "Chat Input",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -415,10 +386,7 @@
"session_id": null, "session_id": null,
"return_record": null "return_record": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -477,9 +445,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Message", "display_name": "Message",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -515,10 +481,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -526,9 +489,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -548,9 +509,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -569,20 +528,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a chat message in the Playground.", "description": "Display a chat message in the Playground.",
"icon": "ChatOutput", "icon": "ChatOutput",
"base_classes": [ "base_classes": ["str", "Record", "Text", "object"],
"str",
"Record",
"Text",
"object"
],
"display_name": "Chat Output", "display_name": "Chat Output",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -592,10 +544,7 @@
"session_id": null, "session_id": null,
"return_record": null "return_record": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -640,9 +589,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"code": { "code": {
"type": "code", "type": "code",
@ -725,9 +672,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_base": { "openai_api_base": {
"type": "str", "type": "str",
@ -746,9 +691,7 @@
"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.", "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, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_key": { "openai_api_key": {
"type": "str", "type": "str",
@ -767,9 +710,7 @@
"info": "The OpenAI API Key to use for the OpenAI model.", "info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "OPENAI_API_KEY" "value": "OPENAI_API_KEY"
}, },
"stream": { "stream": {
@ -808,9 +749,7 @@
"info": "System message to pass to the model.", "info": "System message to pass to the model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"temperature": { "temperature": {
"type": "float", "type": "float",
@ -841,11 +780,7 @@
}, },
"description": "Generates text using OpenAI LLMs.", "description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI", "icon": "OpenAI",
"base_classes": [ "base_classes": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"display_name": "OpenAI", "display_name": "OpenAI",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -859,9 +794,7 @@
"stream": null, "stream": null,
"system_message": null "system_message": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [ "field_order": [
@ -899,21 +832,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "Question", "fieldName": "Question",
"id": "Prompt-tHwPf", "id": "Prompt-tHwPf",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Record", "Text", "object"],
"str",
"Record",
"Text",
"object"
],
"dataType": "ChatInput", "dataType": "ChatInput",
"id": "ChatInput-MsSJ9" "id": "ChatInput-MsSJ9"
} }
@ -933,18 +856,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "Document", "fieldName": "Document",
"id": "Prompt-tHwPf", "id": "Prompt-tHwPf",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["Record"],
"Record"
],
"dataType": "File", "dataType": "File",
"id": "File-6TEsD" "id": "File-6TEsD"
} }
@ -964,17 +880,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-Bt067", "id": "OpenAIModel-Bt067",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-tHwPf" "id": "Prompt-tHwPf"
} }
@ -994,17 +904,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-F5Awj", "id": "ChatOutput-F5Awj",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-Bt067" "id": "OpenAIModel-Bt067"
} }

View file

@ -83,10 +83,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -94,9 +91,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -116,9 +111,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -137,21 +130,14 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "MySessionID" "value": "MySessionID"
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Get chat inputs from the Playground.", "description": "Get chat inputs from the Playground.",
"icon": "ChatInput", "icon": "ChatInput",
"base_classes": [ "base_classes": ["Text", "object", "Record", "str"],
"Text",
"object",
"Record",
"str"
],
"display_name": "Chat Input", "display_name": "Chat Input",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -161,10 +147,7 @@
"session_id": null, "session_id": null,
"return_record": null "return_record": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -223,9 +206,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Message", "display_name": "Message",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -261,10 +242,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -272,9 +250,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -294,9 +270,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -315,21 +289,14 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "MySessionID" "value": "MySessionID"
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a chat message in the Playground.", "description": "Display a chat message in the Playground.",
"icon": "ChatOutput", "icon": "ChatOutput",
"base_classes": [ "base_classes": ["Text", "object", "Record", "str"],
"Text",
"object",
"Record",
"str"
],
"display_name": "Chat Output", "display_name": "Chat Output",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -339,10 +306,7 @@
"session_id": null, "session_id": null,
"return_record": null "return_record": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -418,10 +382,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Ascending", "Descending"],
"Ascending",
"Descending"
],
"name": "order", "name": "order",
"display_name": "Order", "display_name": "Order",
"advanced": true, "advanced": true,
@ -429,9 +390,7 @@
"info": "Order of the messages.", "info": "Order of the messages.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"record_template": { "record_template": {
"type": "str", "type": "str",
@ -451,9 +410,7 @@
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender": { "sender": {
"type": "str", "type": "str",
@ -466,11 +423,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User", "Machine and User"],
"Machine",
"User",
"Machine and User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": false, "advanced": false,
@ -478,9 +431,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -499,9 +450,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -516,9 +465,7 @@
"name": "session_id", "name": "session_id",
"display_name": "Session ID", "display_name": "Session ID",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "Session ID of the chat history.", "info": "Session ID of the chat history.",
"load_from_db": false, "load_from_db": false,
@ -529,11 +476,7 @@
}, },
"description": "Retrieves stored chat messages given a specific Session ID.", "description": "Retrieves stored chat messages given a specific Session ID.",
"icon": "history", "icon": "history",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "Chat Memory", "display_name": "Chat Memory",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -544,9 +487,7 @@
"order": null, "order": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -608,9 +549,7 @@
"name": "template", "name": "template",
"display_name": "Template", "display_name": "Template",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -675,23 +614,14 @@
"is_input": null, "is_input": null,
"is_output": null, "is_output": null,
"is_composition": null, "is_composition": null,
"base_classes": [ "base_classes": ["Text", "str", "object"],
"Text",
"str",
"object"
],
"name": "", "name": "",
"display_name": "Prompt", "display_name": "Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"template": [ "template": ["context", "user_message"]
"context",
"user_message"
]
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"full_path": null, "full_path": null,
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
@ -740,9 +670,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"code": { "code": {
"type": "code", "type": "code",
@ -825,9 +753,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_base": { "openai_api_base": {
"type": "str", "type": "str",
@ -846,9 +772,7 @@
"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.", "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, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_key": { "openai_api_key": {
"type": "str", "type": "str",
@ -867,9 +791,7 @@
"info": "The OpenAI API Key to use for the OpenAI model.", "info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "OPENAI_API_KEY" "value": "OPENAI_API_KEY"
}, },
"stream": { "stream": {
@ -908,9 +830,7 @@
"info": "System message to pass to the model.", "info": "System message to pass to the model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"temperature": { "temperature": {
"type": "float", "type": "float",
@ -941,11 +861,7 @@
}, },
"description": "Generates text using OpenAI LLMs.", "description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI", "icon": "OpenAI",
"base_classes": [ "base_classes": ["str", "object", "Text"],
"str",
"object",
"Text"
],
"display_name": "OpenAI", "display_name": "OpenAI",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -959,9 +875,7 @@
"stream": null, "stream": null,
"system_message": null "system_message": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [ "field_order": [
@ -1013,10 +927,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Value", "display_name": "Value",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Record", "Text"],
"Record",
"Text"
],
"dynamic": false, "dynamic": false,
"info": "Text or Record to be passed as output.", "info": "Text or Record to be passed as output.",
"load_from_db": false, "load_from_db": false,
@ -1058,28 +969,20 @@
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a text output in the Playground.", "description": "Display a text output in the Playground.",
"icon": "type", "icon": "type",
"base_classes": [ "base_classes": ["str", "object", "Text"],
"str",
"object",
"Text"
],
"display_name": "Inspect Memory", "display_name": "Inspect Memory",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"input_value": null, "input_value": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -1108,19 +1011,10 @@
"fieldName": "context", "fieldName": "context",
"type": "str", "type": "str",
"id": "Prompt-ODkUx", "id": "Prompt-ODkUx",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"]
"Document",
"BaseOutputParser",
"Record",
"Text"
]
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "MemoryComponent", "dataType": "MemoryComponent",
"id": "MemoryComponent-cdA1J" "id": "MemoryComponent-cdA1J"
} }
@ -1142,20 +1036,10 @@
"fieldName": "user_message", "fieldName": "user_message",
"type": "str", "type": "str",
"id": "Prompt-ODkUx", "id": "Prompt-ODkUx",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"]
"Document",
"BaseOutputParser",
"Record",
"Text"
]
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["Text", "object", "Record", "str"],
"Text",
"object",
"Record",
"str"
],
"dataType": "ChatInput", "dataType": "ChatInput",
"id": "ChatInput-t7F8v" "id": "ChatInput-t7F8v"
} }
@ -1176,17 +1060,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-9RykF", "id": "OpenAIModel-9RykF",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["Text", "str", "object"],
"Text",
"str",
"object"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-ODkUx" "id": "Prompt-ODkUx"
} }
@ -1206,17 +1084,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-P1jEe", "id": "ChatOutput-P1jEe",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "object", "Text"],
"str",
"object",
"Text"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-9RykF" "id": "OpenAIModel-9RykF"
} }
@ -1236,18 +1108,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "TextOutput-vrs6T", "id": "TextOutput-vrs6T",
"inputTypes": [ "inputTypes": ["Record", "Text"],
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "MemoryComponent", "dataType": "MemoryComponent",
"id": "MemoryComponent-cdA1J" "id": "MemoryComponent-cdA1J"
} }

View file

@ -45,9 +45,7 @@
"name": "template", "name": "template",
"display_name": "Template", "display_name": "Template",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -86,22 +84,14 @@
"is_input": null, "is_input": null,
"is_output": null, "is_output": null,
"is_composition": null, "is_composition": null,
"base_classes": [ "base_classes": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"name": "", "name": "",
"display_name": "Prompt", "display_name": "Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"template": [ "template": ["document"]
"document"
]
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"full_path": null, "full_path": null,
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
@ -165,9 +155,7 @@
"name": "template", "name": "template",
"display_name": "Template", "display_name": "Template",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -206,22 +194,14 @@
"is_input": null, "is_input": null,
"is_output": null, "is_output": null,
"is_composition": null, "is_composition": null,
"base_classes": [ "base_classes": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"name": "", "name": "",
"display_name": "Prompt", "display_name": "Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"template": [ "template": ["summary"]
"summary"
]
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"full_path": null, "full_path": null,
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
@ -280,9 +260,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Message", "display_name": "Message",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -306,9 +284,7 @@
"info": "In case of Message being a Record, this template will be used to convert it to text.", "info": "In case of Message being a Record, this template will be used to convert it to text.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"return_record": { "return_record": {
"type": "bool", "type": "bool",
@ -340,10 +316,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -351,9 +324,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -373,9 +344,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -394,20 +363,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a chat message in the Playground.", "description": "Display a chat message in the Playground.",
"icon": "ChatOutput", "icon": "ChatOutput",
"base_classes": [ "base_classes": ["object", "Record", "Text", "str"],
"object",
"Record",
"Text",
"str"
],
"display_name": "Chat Output", "display_name": "Chat Output",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -418,10 +380,7 @@
"return_record": null, "return_record": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -476,9 +435,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Message", "display_name": "Message",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"dynamic": false, "dynamic": false,
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
@ -502,9 +459,7 @@
"info": "In case of Message being a Record, this template will be used to convert it to text.", "info": "In case of Message being a Record, this template will be used to convert it to text.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"return_record": { "return_record": {
"type": "bool", "type": "bool",
@ -536,10 +491,7 @@
"fileTypes": [], "fileTypes": [],
"file_path": "", "file_path": "",
"password": false, "password": false,
"options": [ "options": ["Machine", "User"],
"Machine",
"User"
],
"name": "sender", "name": "sender",
"display_name": "Sender Type", "display_name": "Sender Type",
"advanced": true, "advanced": true,
@ -547,9 +499,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"sender_name": { "sender_name": {
"type": "str", "type": "str",
@ -569,9 +519,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"session_id": { "session_id": {
"type": "str", "type": "str",
@ -590,20 +538,13 @@
"info": "If provided, the message will be stored in the memory.", "info": "If provided, the message will be stored in the memory.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a chat message in the Playground.", "description": "Display a chat message in the Playground.",
"icon": "ChatOutput", "icon": "ChatOutput",
"base_classes": [ "base_classes": ["object", "Record", "Text", "str"],
"object",
"Record",
"Text",
"str"
],
"display_name": "Chat Output", "display_name": "Chat Output",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -614,10 +555,7 @@
"return_record": null, "return_record": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text", "Record"],
"Text",
"Record"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -672,10 +610,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Value", "display_name": "Value",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Record", "Text"],
"Record",
"Text"
],
"dynamic": false, "dynamic": false,
"info": "Text or Record to be passed as input.", "info": "Text or Record to be passed as input.",
"load_from_db": false, "load_from_db": false,
@ -699,28 +634,20 @@
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Get text inputs from the Playground.", "description": "Get text inputs from the Playground.",
"icon": "type", "icon": "type",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "Text Input", "display_name": "Text Input",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"input_value": null, "input_value": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -762,10 +689,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Value", "display_name": "Value",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Record", "Text"],
"Record",
"Text"
],
"dynamic": false, "dynamic": false,
"info": "Text or Record to be passed as output.", "info": "Text or Record to be passed as output.",
"load_from_db": false, "load_from_db": false,
@ -807,28 +731,20 @@
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a text output in the Playground.", "description": "Display a text output in the Playground.",
"icon": "type", "icon": "type",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "First Prompt", "display_name": "First Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"input_value": null, "input_value": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -873,9 +789,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"code": { "code": {
"type": "code", "type": "code",
@ -958,9 +872,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_base": { "openai_api_base": {
"type": "str", "type": "str",
@ -979,9 +891,7 @@
"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.", "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, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_key": { "openai_api_key": {
"type": "str", "type": "str",
@ -1000,9 +910,7 @@
"info": "The OpenAI API Key to use for the OpenAI model.", "info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "OPENAI_API_KEY" "value": "OPENAI_API_KEY"
}, },
"stream": { "stream": {
@ -1041,9 +949,7 @@
"info": "System message to pass to the model.", "info": "System message to pass to the model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"temperature": { "temperature": {
"type": "float", "type": "float",
@ -1074,11 +980,7 @@
}, },
"description": "Generates text using OpenAI LLMs.", "description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI", "icon": "OpenAI",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "OpenAI", "display_name": "OpenAI",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -1092,9 +994,7 @@
"stream": null, "stream": null,
"system_message": null "system_message": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [ "field_order": [
@ -1146,10 +1046,7 @@
"name": "input_value", "name": "input_value",
"display_name": "Value", "display_name": "Value",
"advanced": false, "advanced": false,
"input_types": [ "input_types": ["Record", "Text"],
"Record",
"Text"
],
"dynamic": false, "dynamic": false,
"info": "Text or Record to be passed as output.", "info": "Text or Record to be passed as output.",
"load_from_db": false, "load_from_db": false,
@ -1191,28 +1088,20 @@
"info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.", "info": "Template to convert Record to Text. If left empty, it will be dynamically set to the Record's text key.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"_type": "CustomComponent" "_type": "CustomComponent"
}, },
"description": "Display a text output in the Playground.", "description": "Display a text output in the Playground.",
"icon": "type", "icon": "type",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "Second Prompt", "display_name": "Second Prompt",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
"input_value": null, "input_value": null,
"record_template": null "record_template": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [], "field_order": [],
@ -1257,9 +1146,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"code": { "code": {
"type": "code", "type": "code",
@ -1342,9 +1229,7 @@
"info": "", "info": "",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_base": { "openai_api_base": {
"type": "str", "type": "str",
@ -1363,9 +1248,7 @@
"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.", "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, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"openai_api_key": { "openai_api_key": {
"type": "str", "type": "str",
@ -1384,9 +1267,7 @@
"info": "The OpenAI API Key to use for the OpenAI model.", "info": "The OpenAI API Key to use for the OpenAI model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"],
"Text"
],
"value": "" "value": ""
}, },
"stream": { "stream": {
@ -1425,9 +1306,7 @@
"info": "System message to pass to the model.", "info": "System message to pass to the model.",
"load_from_db": false, "load_from_db": false,
"title_case": false, "title_case": false,
"input_types": [ "input_types": ["Text"]
"Text"
]
}, },
"temperature": { "temperature": {
"type": "float", "type": "float",
@ -1458,11 +1337,7 @@
}, },
"description": "Generates text using OpenAI LLMs.", "description": "Generates text using OpenAI LLMs.",
"icon": "OpenAI", "icon": "OpenAI",
"base_classes": [ "base_classes": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"display_name": "OpenAI", "display_name": "OpenAI",
"documentation": "", "documentation": "",
"custom_fields": { "custom_fields": {
@ -1476,9 +1351,7 @@
"stream": null, "stream": null,
"system_message": null "system_message": null
}, },
"output_types": [ "output_types": ["Text"],
"Text"
],
"field_formatters": {}, "field_formatters": {},
"frozen": false, "frozen": false,
"field_order": [ "field_order": [
@ -1516,20 +1389,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "document", "fieldName": "document",
"id": "Prompt-amqBu", "id": "Prompt-amqBu",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "TextInput", "dataType": "TextInput",
"id": "TextInput-sptaH" "id": "TextInput-sptaH"
} }
@ -1549,18 +1413,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "TextOutput-2MS4a", "id": "TextOutput-2MS4a",
"inputTypes": [ "inputTypes": ["Record", "Text"],
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-amqBu" "id": "Prompt-amqBu"
} }
@ -1580,17 +1437,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-uYXZJ", "id": "OpenAIModel-uYXZJ",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-amqBu" "id": "Prompt-amqBu"
} }
@ -1610,20 +1461,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "summary", "fieldName": "summary",
"id": "Prompt-gTNiz", "id": "Prompt-gTNiz",
"inputTypes": [ "inputTypes": ["Document", "BaseOutputParser", "Record", "Text"],
"Document",
"BaseOutputParser",
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-uYXZJ" "id": "OpenAIModel-uYXZJ"
} }
@ -1643,17 +1485,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-EJkG3", "id": "ChatOutput-EJkG3",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-uYXZJ" "id": "OpenAIModel-uYXZJ"
} }
@ -1673,18 +1509,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "TextOutput-MUDOR", "id": "TextOutput-MUDOR",
"inputTypes": [ "inputTypes": ["Record", "Text"],
"Record",
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-gTNiz" "id": "Prompt-gTNiz"
} }
@ -1704,17 +1533,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "OpenAIModel-XawYB", "id": "OpenAIModel-XawYB",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["object", "str", "Text"],
"object",
"str",
"Text"
],
"dataType": "Prompt", "dataType": "Prompt",
"id": "Prompt-gTNiz" "id": "Prompt-gTNiz"
} }
@ -1734,17 +1557,11 @@
"targetHandle": { "targetHandle": {
"fieldName": "input_value", "fieldName": "input_value",
"id": "ChatOutput-DNmvg", "id": "ChatOutput-DNmvg",
"inputTypes": [ "inputTypes": ["Text"],
"Text"
],
"type": "str" "type": "str"
}, },
"sourceHandle": { "sourceHandle": {
"baseClasses": [ "baseClasses": ["str", "Text", "object"],
"str",
"Text",
"object"
],
"dataType": "OpenAIModel", "dataType": "OpenAIModel",
"id": "OpenAIModel-XawYB" "id": "OpenAIModel-XawYB"
} }

View file

@ -29,10 +29,10 @@ export default function App() {
useTrackLastVisitedPath(); useTrackLastVisitedPath();
const removeFromTempNotificationList = useAlertStore( const removeFromTempNotificationList = useAlertStore(
(state) => state.removeFromTempNotificationList (state) => state.removeFromTempNotificationList,
); );
const tempNotificationList = useAlertStore( const tempNotificationList = useAlertStore(
(state) => state.tempNotificationList (state) => state.tempNotificationList,
); );
const [fetchError, setFetchError] = useState(false); const [fetchError, setFetchError] = useState(false);
const isLoading = useFlowsManagerStore((state) => state.isLoading); const isLoading = useFlowsManagerStore((state) => state.isLoading);
@ -50,7 +50,7 @@ export default function App() {
const refreshVersion = useDarkStore((state) => state.refreshVersion); const refreshVersion = useDarkStore((state) => state.refreshVersion);
const refreshStars = useDarkStore((state) => state.refreshStars); const refreshStars = useDarkStore((state) => state.refreshStars);
const setGlobalVariables = useGlobalVariablesStore( const setGlobalVariables = useGlobalVariablesStore(
(state) => state.setGlobalVariables (state) => state.setGlobalVariables,
); );
const checkHasStore = useStoreStore((state) => state.checkHasStore); const checkHasStore = useStoreStore((state) => state.checkHasStore);
const navigate = useNavigate(); const navigate = useNavigate();

View file

@ -98,7 +98,7 @@ export default function ParameterComponent({
debouncedHandleUpdateValues, debouncedHandleUpdateValues,
setNode, setNode,
renderTooltips, renderTooltips,
setIsLoading setIsLoading,
); );
const { handleNodeClass: handleNodeClassHook } = useHandleNodeClass( const { handleNodeClass: handleNodeClassHook } = useHandleNodeClass(
@ -107,7 +107,7 @@ export default function ParameterComponent({
takeSnapshot, takeSnapshot,
setNode, setNode,
updateNodeInternals, updateNodeInternals,
renderTooltips renderTooltips,
); );
const { handleRefreshButtonPress: handleRefreshButtonPressHook } = const { handleRefreshButtonPress: handleRefreshButtonPressHook } =
@ -116,7 +116,7 @@ export default function ParameterComponent({
let disabled = let disabled =
edges.some( edges.some(
(edge) => (edge) =>
edge.targetHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id) edge.targetHandle === scapedJSONStringfy(proxy ? { ...id, proxy } : id),
) ?? false; ) ?? false;
const handleRefreshButtonPress = async (name, data) => { const handleRefreshButtonPress = async (name, data) => {
@ -129,12 +129,12 @@ export default function ParameterComponent({
handleUpdateValues, handleUpdateValues,
setNode, setNode,
renderTooltips, renderTooltips,
setIsLoading setIsLoading,
); );
const handleOnNewValue = async ( const handleOnNewValue = async (
newValue: string | string[] | boolean | Object[], newValue: string | string[] | boolean | Object[],
skipSnapshot: boolean | undefined = false skipSnapshot: boolean | undefined = false,
): Promise<void> => { ): Promise<void> => {
handleOnNewValueHook(newValue, skipSnapshot); handleOnNewValueHook(newValue, skipSnapshot);
}; };
@ -216,7 +216,7 @@ export default function ParameterComponent({
className={classNames( className={classNames(
left ? "my-12 -ml-0.5 " : " my-12 -mr-0.5 ", left ? "my-12 -ml-0.5 " : " my-12 -mr-0.5 ",
"h-3 w-3 rounded-full border-2 bg-background", "h-3 w-3 rounded-full border-2 bg-background",
!showNode ? "mt-0" : "" !showNode ? "mt-0" : "",
)} )}
style={{ style={{
borderColor: color ?? nodeColors.unknown, borderColor: color ?? nodeColors.unknown,
@ -284,7 +284,7 @@ export default function ParameterComponent({
"h-5 w-5 rounded-md", "h-5 w-5 rounded-md",
displayOutputPreview && !unknownOutput displayOutputPreview && !unknownOutput
? " hover:bg-secondary-foreground/5 hover:text-medium-indigo" ? " hover:bg-secondary-foreground/5 hover:text-medium-indigo"
: " cursor-not-allowed text-muted-foreground" : " cursor-not-allowed text-muted-foreground",
)} )}
name={"ScanEye"} name={"ScanEye"}
/> />
@ -334,7 +334,7 @@ export default function ParameterComponent({
} }
className={classNames( className={classNames(
left ? "-ml-0.5" : "-mr-0.5", left ? "-ml-0.5" : "-mr-0.5",
"h-3 w-3 rounded-full border-2 bg-background" "h-3 w-3 rounded-full border-2 bg-background",
)} )}
style={{ borderColor: color ?? nodeColors.unknown }} style={{ borderColor: color ?? nodeColors.unknown }}
onClick={() => setFilterEdge(groupedEdge.current)} onClick={() => setFilterEdge(groupedEdge.current)}

View file

@ -24,7 +24,7 @@ const TooltipRenderComponent = ({ item, index, left }) => {
<span <span
key={index} key={index}
className={classNames( className={classNames(
index > 0 ? "mt-2 flex items-center" : "mt-3 flex items-center" index > 0 ? "mt-2 flex items-center" : "mt-3 flex items-center",
)} )}
> >
<div <div

View file

@ -6,7 +6,7 @@ const useCheckCodeValidity = (
data: NodeDataType, data: NodeDataType,
templates: { [key: string]: any }, templates: { [key: string]: any },
setIsOutdated: (value: boolean) => void, setIsOutdated: (value: boolean) => void,
types types,
) => { ) => {
useEffect(() => { useEffect(() => {
// This one should run only once // This one should run only once

View file

@ -9,7 +9,7 @@ const useFetchDataOnMount = (
handleUpdateValues, handleUpdateValues,
setNode, setNode,
renderTooltips, renderTooltips,
setIsLoading setIsLoading,
) => { ) => {
const setErrorData = useAlertStore((state) => state.setErrorData); const setErrorData = useAlertStore((state) => state.setErrorData);

View file

@ -10,7 +10,7 @@ const useHandleOnNewValue = (
debouncedHandleUpdateValues, debouncedHandleUpdateValues,
setNode, setNode,
renderTooltips, renderTooltips,
setIsLoading setIsLoading,
) => { ) => {
const setErrorData = useAlertStore((state) => state.setErrorData); const setErrorData = useAlertStore((state) => state.setErrorData);

View file

@ -6,7 +6,7 @@ const useHandleNodeClass = (
takeSnapshot, takeSnapshot,
setNode, setNode,
updateNodeInternals, updateNodeInternals,
renderTooltips renderTooltips,
) => { ) => {
const handleNodeClass = (newNodeClass, code) => { const handleNodeClass = (newNodeClass, code) => {
if (!data.node) return; if (!data.node) return;

View file

@ -12,8 +12,8 @@ const useIconNodeRender = (
checkNodeIconFragment: ( checkNodeIconFragment: (
iconColor: string, iconColor: string,
iconName: string, iconName: string,
iconClassName: string iconClassName: string,
) => JSX.Element ) => JSX.Element,
) => { ) => {
const iconNodeRender = useCallback(() => { const iconNodeRender = useCallback(() => {
const iconElement = data?.node?.icon; const iconElement = data?.node?.icon;

View file

@ -7,7 +7,7 @@ import { VertexBuildTypeAPI } from "../../types/api";
const useIconStatus = ( const useIconStatus = (
buildStatus: BuildStatus | undefined, buildStatus: BuildStatus | undefined,
validationStatus: VertexBuildTypeAPI | null validationStatus: VertexBuildTypeAPI | null,
) => { ) => {
const renderIconStatus = () => { const renderIconStatus = () => {
if (buildStatus === BuildStatus.BUILDING) { if (buildStatus === BuildStatus.BUILDING) {

View file

@ -7,7 +7,7 @@ const useUpdateNodeCode = (
dataNode: APIClassType, // Define YourNodeType according to your data structure dataNode: APIClassType, // Define YourNodeType according to your data structure
setNode: (id: string, callback: (oldNode) => any) => void, setNode: (id: string, callback: (oldNode) => any) => void,
setIsOutdated: (value: boolean) => void, setIsOutdated: (value: boolean) => void,
updateNodeInternals: (id: string) => void updateNodeInternals: (id: string) => void,
) => { ) => {
const updateNodeCode = useCallback( const updateNodeCode = useCallback(
(newNodeClass: APIClassType, code: string, name: string) => { (newNodeClass: APIClassType, code: string, name: string) => {
@ -29,7 +29,7 @@ const useUpdateNodeCode = (
updateNodeInternals(dataId); updateNodeInternals(dataId);
}, },
[dataId, dataNode, setNode, setIsOutdated, updateNodeInternals] [dataId, dataNode, setNode, setIsOutdated, updateNodeInternals],
); );
return updateNodeCode; return updateNodeCode;

View file

@ -2,7 +2,7 @@ import { APITemplateType } from "../../types/api";
export default function getFieldTitle( export default function getFieldTitle(
template: APITemplateType, template: APITemplateType,
templateField: string templateField: string,
): string { ): string {
return template[templateField].display_name return template[templateField].display_name
? template[templateField].display_name! ? template[templateField].display_name!

View file

@ -16,13 +16,13 @@ export default function AlertDropdown({
}: AlertDropdownType): JSX.Element { }: AlertDropdownType): JSX.Element {
const notificationList = useAlertStore((state) => state.notificationList); const notificationList = useAlertStore((state) => state.notificationList);
const clearNotificationList = useAlertStore( const clearNotificationList = useAlertStore(
(state) => state.clearNotificationList (state) => state.clearNotificationList,
); );
const removeFromNotificationList = useAlertStore( const removeFromNotificationList = useAlertStore(
(state) => state.removeFromNotificationList (state) => state.removeFromNotificationList,
); );
const setNotificationCenter = useAlertStore( const setNotificationCenter = useAlertStore(
(state) => state.setNotificationCenter (state) => state.setNotificationCenter,
); );
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);

View file

@ -31,14 +31,14 @@ export default function ImageViewer({ image }) {
const fullPageButton = document.getElementById("full-page-button"); const fullPageButton = document.getElementById("full-page-button");
zoomInButton!.addEventListener("click", () => zoomInButton!.addEventListener("click", () =>
viewer.viewport.zoomBy(1.2) viewer.viewport.zoomBy(1.2),
); );
zoomOutButton!.addEventListener("click", () => zoomOutButton!.addEventListener("click", () =>
viewer.viewport.zoomBy(0.8) viewer.viewport.zoomBy(0.8),
); );
homeButton!.addEventListener("click", () => viewer.viewport.goHome()); homeButton!.addEventListener("click", () => viewer.viewport.goHome());
fullPageButton!.addEventListener("click", () => fullPageButton!.addEventListener("click", () =>
viewer.setFullScreen(true) viewer.setFullScreen(true),
); );
// Optionally, you can set additional viewer options here // Optionally, you can set additional viewer options here
@ -47,16 +47,16 @@ export default function ImageViewer({ image }) {
return () => { return () => {
viewer.destroy(); viewer.destroy();
zoomInButton!.removeEventListener("click", () => zoomInButton!.removeEventListener("click", () =>
viewer.viewport.zoomBy(1.2) viewer.viewport.zoomBy(1.2),
); );
zoomOutButton!.removeEventListener("click", () => zoomOutButton!.removeEventListener("click", () =>
viewer.viewport.zoomBy(0.8) viewer.viewport.zoomBy(0.8),
); );
homeButton!.removeEventListener("click", () => homeButton!.removeEventListener("click", () =>
viewer.viewport.goHome() viewer.viewport.goHome(),
); );
fullPageButton!.removeEventListener("click", () => fullPageButton!.removeEventListener("click", () =>
viewer.setFullScreen(true) viewer.setFullScreen(true),
); );
}; };
} }

View file

@ -15,7 +15,7 @@ export default function FolderAccordionComponent({
options, options,
}: AccordionComponentType): JSX.Element { }: AccordionComponentType): JSX.Element {
const [value, setValue] = useState( const [value, setValue] = useState(
open.length === 0 ? "" : getOpenAccordion() open.length === 0 ? "" : getOpenAccordion(),
); );
function getOpenAccordion(): string { function getOpenAccordion(): string {

View file

@ -17,7 +17,7 @@ export default function AccordionComponent({
sideBar, sideBar,
}: AccordionComponentType): JSX.Element { }: AccordionComponentType): JSX.Element {
const [value, setValue] = useState( const [value, setValue] = useState(
open.length === 0 ? "" : getOpenAccordion() open.length === 0 ? "" : getOpenAccordion(),
); );
function getOpenAccordion(): string { function getOpenAccordion(): string {
@ -52,7 +52,7 @@ export default function AccordionComponent({
disabled={disabled} disabled={disabled}
className={cn( className={cn(
sideBar ? "w-full bg-muted px-[0.75rem] py-[0.5rem]" : "ml-3", sideBar ? "w-full bg-muted px-[0.75rem] py-[0.5rem]" : "ml-3",
disabled ? "cursor-not-allowed" : "cursor-pointer" disabled ? "cursor-not-allowed" : "cursor-pointer",
)} )}
> >
{trigger} {trigger}

View file

@ -23,19 +23,19 @@ export default function AddNewVariableButton({ children }): JSX.Element {
const setErrorData = useAlertStore((state) => state.setErrorData); const setErrorData = useAlertStore((state) => state.setErrorData);
const componentFields = useTypesStore((state) => state.ComponentFields); const componentFields = useTypesStore((state) => state.ComponentFields);
const unavaliableFields = new Set( const unavaliableFields = new Set(
Object.keys(useGlobalVariablesStore((state) => state.unavaliableFields)) Object.keys(useGlobalVariablesStore((state) => state.unavaliableFields)),
); );
const availableFields = () => { const availableFields = () => {
const fields = Array.from(componentFields).filter( const fields = Array.from(componentFields).filter(
(field) => !unavaliableFields.has(field) (field) => !unavaliableFields.has(field),
); );
return sortByName(fields); return sortByName(fields);
}; };
const addGlobalVariable = useGlobalVariablesStore( const addGlobalVariable = useGlobalVariablesStore(
(state) => state.addGlobalVariable (state) => state.addGlobalVariable,
); );
function handleSaveVariable() { function handleSaveVariable() {

View file

@ -10,7 +10,7 @@ export default function DragCardComponent({ data }: { data: storeComponent }) {
draggable draggable
//TODO check color schema //TODO check color schema
className={cn( className={cn(
"group relative flex flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]" "group relative flex flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]",
)} )}
> >
<div> <div>
@ -22,7 +22,7 @@ export default function DragCardComponent({ data }: { data: storeComponent }) {
"visible flex-shrink-0", "visible flex-shrink-0",
data.is_component data.is_component
? "mx-0.5 h-6 w-6 text-component-icon" ? "mx-0.5 h-6 w-6 text-component-icon"
: "h-7 w-7 flex-shrink-0 text-flow-icon" : "h-7 w-7 flex-shrink-0 text-flow-icon",
)} )}
name={data.is_component ? "ToyBrick" : "Group"} name={data.is_component ? "ToyBrick" : "Group"}
/> />

View file

@ -60,11 +60,11 @@ export default function CollectionCardComponent({
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [loadingLike, setLoadingLike] = useState(false); const [loadingLike, setLoadingLike] = useState(false);
const [liked_by_user, setLiked_by_user] = useState( const [liked_by_user, setLiked_by_user] = useState(
data?.liked_by_user ?? false data?.liked_by_user ?? false,
); );
const [likes_count, setLikes_count] = useState(data?.liked_by_count ?? 0); const [likes_count, setLikes_count] = useState(data?.liked_by_count ?? 0);
const [downloads_count, setDownloads_count] = useState( const [downloads_count, setDownloads_count] = useState(
data?.downloads_count ?? 0 data?.downloads_count ?? 0,
); );
const currentFlow = useFlowsManagerStore((state) => state.currentFlow); const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow); const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
@ -75,12 +75,12 @@ export default function CollectionCardComponent({
const [openPlayground, setOpenPlayground] = useState(false); const [openPlayground, setOpenPlayground] = useState(false);
const [openDelete, setOpenDelete] = useState(false); const [openDelete, setOpenDelete] = useState(false);
const setCurrentFlowId = useFlowsManagerStore( const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId (state) => state.setCurrentFlowId,
); );
const [loadingPlayground, setLoadingPlayground] = useState(false); const [loadingPlayground, setLoadingPlayground] = useState(false);
const selectedFlowsComponentsCards = useFlowsManagerStore( const selectedFlowsComponentsCards = useFlowsManagerStore(
(state) => state.selectedFlowsComponentsCards (state) => state.selectedFlowsComponentsCards,
); );
const name = data.is_component ? "Component" : "Flow"; const name = data.is_component ? "Component" : "Flow";
@ -220,7 +220,7 @@ export default function CollectionCardComponent({
"group relative flex min-h-[11rem] flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]", "group relative flex min-h-[11rem] flex-col justify-between overflow-hidden transition-all hover:bg-muted/50 hover:shadow-md hover:dark:bg-[#ffffff10]",
disabled ? "pointer-events-none opacity-50" : "", disabled ? "pointer-events-none opacity-50" : "",
onClick ? "cursor-pointer" : "", onClick ? "cursor-pointer" : "",
isSelectedCard ? "border border-selected" : "" isSelectedCard ? "border border-selected" : "",
)} )}
onClick={onClick} onClick={onClick}
> >
@ -233,7 +233,7 @@ export default function CollectionCardComponent({
"visible flex-shrink-0", "visible flex-shrink-0",
data.is_component data.is_component
? "mx-0.5 h-6 w-6 text-component-icon" ? "mx-0.5 h-6 w-6 text-component-icon"
: "h-7 w-7 flex-shrink-0 text-flow-icon" : "h-7 w-7 flex-shrink-0 text-flow-icon",
)} )}
name={data.is_component ? "ToyBrick" : "Group"} name={data.is_component ? "ToyBrick" : "Group"}
/> />
@ -428,7 +428,7 @@ export default function CollectionCardComponent({
name="Trash2" name="Trash2"
className={cn( className={cn(
"h-5 w-5", "h-5 w-5",
!authorized ? " text-ring" : "" !authorized ? " text-ring" : "",
)} )}
/> />
</Button> </Button>
@ -463,7 +463,7 @@ export default function CollectionCardComponent({
liked_by_user liked_by_user
? "fill-destructive stroke-destructive" ? "fill-destructive stroke-destructive"
: "", : "",
!authorized ? " text-ring" : "" !authorized ? " text-ring" : "",
)} )}
/> />
</Button> </Button>
@ -501,7 +501,7 @@ export default function CollectionCardComponent({
} }
className={cn( className={cn(
loading ? "h-5 w-5 animate-spin" : "h-5 w-5", loading ? "h-5 w-5 animate-spin" : "h-5 w-5",
!authorized ? " text-ring" : "" !authorized ? " text-ring" : "",
)} )}
/> />
</Button> </Button>

View file

@ -65,7 +65,7 @@ export default function CardsWrapComponent({
"h-full w-full", "h-full w-full",
isDragging isDragging
? "mb-36 flex flex-col items-center justify-center gap-4 text-2xl font-light" ? "mb-36 flex flex-col items-center justify-center gap-4 text-2xl font-light"
: "" : "",
)} )}
> >
{isDragging ? ( {isDragging ? (

View file

@ -50,7 +50,7 @@ export default function FlowToolbar(): JSX.Element {
"relative inline-flex h-full w-full items-center justify-center gap-[4px] bg-muted px-5 py-3 text-sm font-semibold text-foreground transition-all duration-150 ease-in-out hover:bg-background hover:bg-hover ", "relative inline-flex h-full w-full items-center justify-center gap-[4px] bg-muted px-5 py-3 text-sm font-semibold text-foreground transition-all duration-150 ease-in-out hover:bg-background hover:bg-hover ",
!hasApiKey || !validApiKey || !hasStore !hasApiKey || !validApiKey || !hasStore
? " button-disable text-muted-foreground " ? " button-disable text-muted-foreground "
: "" : "",
)} )}
> >
<ForwardedIconComponent <ForwardedIconComponent
@ -59,14 +59,14 @@ export default function FlowToolbar(): JSX.Element {
"-m-0.5 -ml-1 h-6 w-6", "-m-0.5 -ml-1 h-6 w-6",
!hasApiKey || !validApiKey || !hasStore !hasApiKey || !validApiKey || !hasStore
? "extra-side-bar-save-disable" ? "extra-side-bar-save-disable"
: "" : "",
)} )}
/> />
Share Share
</button> </button>
</ShareModal> </ShareModal>
), ),
[hasApiKey, validApiKey, currentFlow, hasStore] [hasApiKey, validApiKey, currentFlow, hasStore],
); );
return ( return (
@ -118,7 +118,7 @@ export default function FlowToolbar(): JSX.Element {
<ApiModal flow={currentFlow}> <ApiModal flow={currentFlow}>
<div <div
className={classNames( className={classNames(
"relative inline-flex w-full items-center justify-center gap-1 px-5 py-3 text-sm font-semibold text-foreground transition-all duration-150 ease-in-out hover:bg-hover" "relative inline-flex w-full items-center justify-center gap-1 px-5 py-3 text-sm font-semibold text-foreground transition-all duration-150 ease-in-out hover:bg-hover",
)} )}
> >
<ForwardedIconComponent <ForwardedIconComponent

View file

@ -18,7 +18,7 @@ export default function CodeAreaComponent({
setOpen, setOpen,
}: CodeAreaComponentType) { }: CodeAreaComponentType) {
const [myValue, setMyValue] = useState( const [myValue, setMyValue] = useState(
typeof value == "string" ? value : JSON.stringify(value) typeof value == "string" ? value : JSON.stringify(value),
); );
useEffect(() => { useEffect(() => {
if (disabled && myValue !== "") { if (disabled && myValue !== "") {

View file

@ -236,7 +236,7 @@ export default function CodeTabsComponent({
<div className="api-modal-according-display"> <div className="api-modal-according-display">
<div <div
className={classNames( className={classNames(
"h-[70vh] w-full overflow-y-auto overflow-x-hidden rounded-lg bg-muted custom-scroll" "h-[70vh] w-full overflow-y-auto overflow-x-hidden rounded-lg bg-muted custom-scroll",
)} )}
> >
{data?.map((node: any, i) => ( {data?.map((node: any, i) => (
@ -275,8 +275,8 @@ export default function CodeTabsComponent({
.show && .show &&
LANGFLOW_SUPPORTED_TYPES.has( LANGFLOW_SUPPORTED_TYPES.has(
node.data.node.template[templateField] node.data.node.template[templateField]
.type .type,
) ),
) )
.map((templateField, indx) => { .map((templateField, indx) => {
return ( return (
@ -334,7 +334,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -380,7 +380,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -433,7 +433,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -470,7 +470,7 @@ export default function CodeTabsComponent({
e, e,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
size="small" size="small"
@ -501,7 +501,7 @@ export default function CodeTabsComponent({
].fileTypes ].fileTypes
} }
onFileChange={( onFileChange={(
value: any value: any,
) => { ) => {
node.data.node.template[ node.data.node.template[
templateField templateField
@ -554,7 +554,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -594,7 +594,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
value={ value={
@ -656,7 +656,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -702,7 +702,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -748,7 +748,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />
@ -780,8 +780,8 @@ export default function CodeTabsComponent({
].value, ].value,
type( type(
node, node,
templateField templateField,
) ),
) )
} }
duplicateKey={ duplicateKey={
@ -790,15 +790,15 @@ export default function CodeTabsComponent({
onChange={(target) => { onChange={(target) => {
const valueToNumbers = const valueToNumbers =
convertValuesToNumbers( convertValuesToNumbers(
target target,
); );
node.data.node!.template[ node.data.node!.template[
templateField templateField
].value = valueToNumbers; ].value = valueToNumbers;
setErrorDuplicateKey( setErrorDuplicateKey(
hasDuplicateKeys( hasDuplicateKeys(
valueToNumbers valueToNumbers,
) ),
); );
setData((old) => { setData((old) => {
let newInputList = let newInputList =
@ -815,7 +815,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
isList={ isList={
@ -863,7 +863,7 @@ export default function CodeTabsComponent({
target, target,
node.data.node.template[ node.data.node.template[
templateField templateField
] ],
); );
}} }}
/> />

View file

@ -67,7 +67,7 @@ function CsvOutputComponent({
if (file) { if (file) {
const { rowData: data, colDefs: columns } = convertCSVToData( const { rowData: data, colDefs: columns } = convertCSVToData(
file, file,
separator separator,
); );
setRowData(data); setRowData(data);
setColDefs(columns); setColDefs(columns);

View file

@ -29,7 +29,7 @@ export default function DictComponent({
<div <div
className={classNames( className={classNames(
value.length > 1 && editNode ? "my-1" : "", value.length > 1 && editNode ? "my-1" : "",
"flex flex-col gap-3" "flex flex-col gap-3",
)} )}
> >
{ {

View file

@ -58,7 +58,7 @@ export default function Dropdown({
? "dropdown-component-outline" ? "dropdown-component-outline"
: "dropdown-component-false-outline", : "dropdown-component-false-outline",
"w-full justify-between font-normal", "w-full justify-between font-normal",
editNode ? "input-edit-node" : "py-2" editNode ? "input-edit-node" : "py-2",
)} )}
> >
<span data-testid={`value-dropdown-` + id}> <span data-testid={`value-dropdown-` + id}>
@ -106,7 +106,7 @@ export default function Dropdown({
name="Check" name="Check"
className={cn( className={cn(
"ml-auto h-4 w-4 text-primary", "ml-auto h-4 w-4 text-primary",
value === option ? "opacity-100" : "opacity-0" value === option ? "opacity-100" : "opacity-0",
)} )}
/> />
</CommandItem> </CommandItem>

View file

@ -99,7 +99,7 @@ export const EditFlowSettings: React.FC<InputProps> = ({
<span <span
className={cn( className={cn(
"font-normal text-muted-foreground word-break-break-word", "font-normal text-muted-foreground word-break-break-word",
description === "" ? "font-light italic" : "" description === "" ? "font-light italic" : "",
)} )}
> >
{description === "" ? "No description" : description} {description === "" ? "No description" : description}

View file

@ -18,7 +18,7 @@ export const ForwardedIconComponent = memo(
strokeWidth, strokeWidth,
id = "", id = "",
}: IconComponentProps, }: IconComponentProps,
ref ref,
) => { ) => {
const [showFallback, setShowFallback] = useState(false); const [showFallback, setShowFallback] = useState(false);
@ -65,8 +65,8 @@ export const ForwardedIconComponent = memo(
/> />
</Suspense> </Suspense>
); );
} },
) ),
); );
export default ForwardedIconComponent; export default ForwardedIconComponent;

View file

@ -113,7 +113,7 @@ export const MenuBar = ({}: {}): JSX.Element => {
title: UPLOAD_ERROR_ALERT, title: UPLOAD_ERROR_ALERT,
list: [error], list: [error],
}); });
} },
); );
}} }}
> >
@ -195,7 +195,7 @@ export const MenuBar = ({}: {}): JSX.Element => {
name={isBuilding || saveLoading ? "Loader2" : "CheckCircle2"} name={isBuilding || saveLoading ? "Loader2" : "CheckCircle2"}
className={cn( className={cn(
"h-4 w-4", "h-4 w-4",
isBuilding || saveLoading ? "animate-spin" : "animate-wiggle" isBuilding || saveLoading ? "animate-spin" : "animate-wiggle",
)} )}
/> />
{printByBuildStatus()} {printByBuildStatus()}

View file

@ -32,11 +32,11 @@ export default function HorizontalScrollFadeComponent({
fadeContainerRef.current.classList.toggle( fadeContainerRef.current.classList.toggle(
"fade-left", "fade-left",
isScrollable && !atStart isScrollable && !atStart,
); );
fadeContainerRef.current.classList.toggle( fadeContainerRef.current.classList.toggle(
"fade-right", "fade-right",
isScrollable && !atEnd isScrollable && !atEnd,
); );
}; };

View file

@ -103,7 +103,7 @@ const CustomInputPopover = ({
(password && !(setSelectedOption || setSelectedOptions)) (password && !(setSelectedOption || setSelectedOptions))
? "pr-8" ? "pr-8"
: "", : "",
className! className!,
)} )}
placeholder={password && editNode ? "Key" : placeholder} placeholder={password && editNode ? "Key" : placeholder}
onChange={handleInputChange} onChange={handleInputChange}
@ -141,15 +141,15 @@ const CustomInputPopover = ({
onSelect={(currentValue) => { onSelect={(currentValue) => {
setSelectedOption && setSelectedOption &&
setSelectedOption( setSelectedOption(
currentValue === selectedOption ? "" : currentValue currentValue === selectedOption ? "" : currentValue,
); );
setSelectedOptions && setSelectedOptions &&
setSelectedOptions( setSelectedOptions(
selectedOptions?.includes(currentValue) selectedOptions?.includes(currentValue)
? selectedOptions.filter( ? selectedOptions.filter(
(item) => item !== currentValue (item) => item !== currentValue,
) )
: [...selectedOptions, currentValue] : [...selectedOptions, currentValue],
); );
!setSelectedOptions && setShowOptions(false); !setSelectedOptions && setShowOptions(false);
}} }}
@ -162,7 +162,7 @@ const CustomInputPopover = ({
selectedOption === option || selectedOption === option ||
selectedOptions?.includes(option) selectedOptions?.includes(option)
? "opacity-100" ? "opacity-100"
: "opacity-0" : "opacity-0",
)} )}
> >
<div className="absolute opacity-100 transition-all group-hover:opacity-0"> <div className="absolute opacity-100 transition-all group-hover:opacity-0">

View file

@ -64,7 +64,7 @@ const CustomInputPopoverObject = ({
? selectedOptions ? selectedOptions
.map( .map(
(optionId) => (optionId) =>
options.find((option) => option.id === optionId)?.name options.find((option) => option.id === optionId)?.name,
) )
.join(", ") .join(", ")
: value : value
@ -115,15 +115,15 @@ const CustomInputPopoverObject = ({
onSelect={(currentValue) => { onSelect={(currentValue) => {
setSelectedOption && setSelectedOption &&
setSelectedOption( setSelectedOption(
currentValue === selectedOption ? "" : currentValue currentValue === selectedOption ? "" : currentValue,
); );
setSelectedOptions && setSelectedOptions &&
setSelectedOptions( setSelectedOptions(
selectedOptions?.includes(currentValue) selectedOptions?.includes(currentValue)
? selectedOptions.filter( ? selectedOptions.filter(
(item) => item !== currentValue (item) => item !== currentValue,
) )
: [...selectedOptions, currentValue] : [...selectedOptions, currentValue],
); );
!setSelectedOptions && setShowOptions(false); !setSelectedOptions && setShowOptions(false);
}} }}
@ -136,7 +136,7 @@ const CustomInputPopoverObject = ({
selectedOption === option.id || selectedOption === option.id ||
selectedOptions?.includes(option.id) selectedOptions?.includes(option.id)
? "opacity-100" ? "opacity-100"
: "opacity-0" : "opacity-0",
)} )}
> >
<div className="absolute opacity-100 transition-all group-hover:opacity-0"> <div className="absolute opacity-100 transition-all group-hover:opacity-0">

View file

@ -71,7 +71,7 @@ export default function InputComponent({
editNode ? " input-edit-node " : "", editNode ? " input-edit-node " : "",
password && editNode ? "pr-8" : "", password && editNode ? "pr-8" : "",
password && !editNode ? "pr-10" : "", password && !editNode ? "pr-10" : "",
className! className!,
)} )}
placeholder={password && editNode ? "Key" : placeholder} placeholder={password && editNode ? "Key" : placeholder}
onChange={(e) => { onChange={(e) => {
@ -154,7 +154,7 @@ export default function InputComponent({
<span <span
className={cn( className={cn(
password && selectedOption === "" ? "right-8" : "right-0", password && selectedOption === "" ? "right-8" : "right-0",
"absolute inset-y-0 flex items-center pr-2.5" "absolute inset-y-0 flex items-center pr-2.5",
)} )}
> >
<button <button
@ -167,7 +167,7 @@ export default function InputComponent({
selectedOption !== "" selectedOption !== ""
? "text-medium-indigo" ? "text-medium-indigo"
: "text-muted-foreground", : "text-muted-foreground",
"hover:text-accent-foreground" "hover:text-accent-foreground",
)} )}
> >
<ForwardedIconComponent <ForwardedIconComponent
@ -187,7 +187,7 @@ export default function InputComponent({
"mb-px", "mb-px",
editNode editNode
? "input-component-true-button" ? "input-component-true-button"
: "input-component-false-button" : "input-component-false-button",
)} )}
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();
@ -204,7 +204,7 @@ export default function InputComponent({
className={classNames( className={classNames(
editNode editNode
? "input-component-true-svg" ? "input-component-true-svg"
: "input-component-false-svg" : "input-component-false-svg",
)} )}
> >
<path <path
@ -223,7 +223,7 @@ export default function InputComponent({
className={classNames( className={classNames(
editNode editNode
? "input-component-true-svg" ? "input-component-true-svg"
: "input-component-false-svg" : "input-component-false-svg",
)} )}
> >
<path <path

View file

@ -19,15 +19,15 @@ export default function InputGlobalComponent({
editNode = false, editNode = false,
}: InputGlobalComponentType): JSX.Element { }: InputGlobalComponentType): JSX.Element {
const globalVariablesEntries = useGlobalVariablesStore( const globalVariablesEntries = useGlobalVariablesStore(
(state) => state.globalVariablesEntries (state) => state.globalVariablesEntries,
); );
const getVariableId = useGlobalVariablesStore((state) => state.getVariableId); const getVariableId = useGlobalVariablesStore((state) => state.getVariableId);
const unavaliableFields = useGlobalVariablesStore( const unavaliableFields = useGlobalVariablesStore(
(state) => state.unavaliableFields (state) => state.unavaliableFields,
); );
const removeGlobalVariable = useGlobalVariablesStore( const removeGlobalVariable = useGlobalVariablesStore(
(state) => state.removeGlobalVariable (state) => state.removeGlobalVariable,
); );
const setErrorData = useAlertStore((state) => state.setErrorData); const setErrorData = useAlertStore((state) => state.setErrorData);
@ -121,7 +121,7 @@ export default function InputGlobalComponent({
<ForwardedIconComponent <ForwardedIconComponent
name="Trash2" name="Trash2"
className={cn( className={cn(
"h-4 w-4 text-primary opacity-0 hover:text-status-red group-hover:opacity-100" "h-4 w-4 text-primary opacity-0 hover:text-status-red group-hover:opacity-100",
)} )}
aria-hidden="true" aria-hidden="true"
/> />

View file

@ -31,7 +31,7 @@ export default function InputListComponent({
<div <div
className={classNames( className={classNames(
value.length > 1 && editNode ? "my-1" : "", value.length > 1 && editNode ? "my-1" : "",
"flex flex-col gap-3" "flex flex-col gap-3",
)} )}
> >
{value.map((singleValue, idx) => { {value.map((singleValue, idx) => {

View file

@ -27,7 +27,7 @@ const SideBarButtonsComponent = ({
pathname === item.href pathname === item.href
? "border border-border bg-muted hover:bg-muted" ? "border border-border bg-muted hover:bg-muted"
: "border border-transparent hover:border-border hover:bg-transparent", : "border border-transparent hover:border-border hover:bg-transparent",
"flex w-full shrink-0 justify-start gap-4" "flex w-full shrink-0 justify-start gap-4",
)} )}
> >
{item.icon} {item.icon}

View file

@ -12,7 +12,7 @@ import { addVersionToDuplicates } from "../../../utils/reactflowUtils";
const useFileDrop = (folderId, folderChangeCallback) => { const useFileDrop = (folderId, folderChangeCallback) => {
const setFolderDragging = useFolderStore((state) => state.setFolderDragging); const setFolderDragging = useFolderStore((state) => state.setFolderDragging);
const setFolderIdDragging = useFolderStore( const setFolderIdDragging = useFolderStore(
(state) => state.setFolderIdDragging (state) => state.setFolderIdDragging,
); );
const setErrorData = useAlertStore((state) => state.setErrorData); const setErrorData = useAlertStore((state) => state.setErrorData);
@ -45,7 +45,7 @@ const useFileDrop = (folderId, folderChangeCallback) => {
| React.DragEvent<HTMLDivElement> | React.DragEvent<HTMLDivElement>
| React.DragEvent<HTMLButtonElement> | React.DragEvent<HTMLButtonElement>
| React.DragEvent<HTMLAnchorElement>, | React.DragEvent<HTMLAnchorElement>,
folderId: string folderId: string,
) => { ) => {
e.preventDefault(); e.preventDefault();
@ -60,7 +60,7 @@ const useFileDrop = (folderId, folderChangeCallback) => {
| React.DragEvent<HTMLDivElement> | React.DragEvent<HTMLDivElement>
| React.DragEvent<HTMLButtonElement> | React.DragEvent<HTMLButtonElement>
| React.DragEvent<HTMLAnchorElement>, | React.DragEvent<HTMLAnchorElement>,
folderId: string folderId: string,
) => { ) => {
if (e.dataTransfer.types.some((types) => types === "Files")) { if (e.dataTransfer.types.some((types) => types === "Files")) {
setFolderDragging(true); setFolderDragging(true);
@ -73,7 +73,7 @@ const useFileDrop = (folderId, folderChangeCallback) => {
e: e:
| React.DragEvent<HTMLDivElement> | React.DragEvent<HTMLDivElement>
| React.DragEvent<HTMLButtonElement> | React.DragEvent<HTMLButtonElement>
| React.DragEvent<HTMLAnchorElement> | React.DragEvent<HTMLAnchorElement>,
) => { ) => {
e.preventDefault(); e.preventDefault();
if (e.target === e.currentTarget) { if (e.target === e.currentTarget) {
@ -87,7 +87,7 @@ const useFileDrop = (folderId, folderChangeCallback) => {
| React.DragEvent<HTMLDivElement> | React.DragEvent<HTMLDivElement>
| React.DragEvent<HTMLButtonElement> | React.DragEvent<HTMLButtonElement>
| React.DragEvent<HTMLAnchorElement>, | React.DragEvent<HTMLAnchorElement>,
folderId: string folderId: string,
) => { ) => {
if (e?.dataTransfer?.getData("flow")) { if (e?.dataTransfer?.getData("flow")) {
const data = JSON.parse(e?.dataTransfer?.getData("flow")); const data = JSON.parse(e?.dataTransfer?.getData("flow"));

View file

@ -34,7 +34,7 @@ export default function TableAutoCellRender({
variant="outline" variant="outline"
size="sq" size="sq"
className={cn( className={cn(
"min-w-min bg-success-background text-success-foreground hover:bg-success-background" "min-w-min bg-success-background text-success-foreground hover:bg-success-background",
)} )}
> >
{value} {value}

View file

@ -63,8 +63,8 @@ export default function TableNodeCellRender({
...id, ...id,
proxy: templateData.proxy, proxy: templateData.proxy,
} }
: id : id,
) ),
) ?? false; ) ?? false;
function getCellType() { function getCellType() {
switch (templateData.type) { switch (templateData.type) {
@ -135,7 +135,7 @@ export default function TableNodeCellRender({
<div <div
className={classNames( className={classNames(
"max-h-48 w-full overflow-auto custom-scroll", "max-h-48 w-full overflow-auto custom-scroll",
templateValue?.length > 1 ? "my-3" : "" templateValue?.length > 1 ? "my-3" : "",
)} )}
> >
<KeypairListComponent <KeypairListComponent

View file

@ -20,6 +20,8 @@ interface TableComponentProps extends AgGridReactProps {
alertTitle?: string; alertTitle?: string;
alertDescription?: string; alertDescription?: string;
editable?: boolean | string[]; editable?: boolean | string[];
onDelete?: (selectedRows: any) => void;
onDuplicate?: (selectedRows: any) => void;
} }
const TableComponent = forwardRef< const TableComponent = forwardRef<
@ -32,7 +34,7 @@ const TableComponent = forwardRef<
alertDescription = DEFAULT_TABLE_ALERT_MSG, alertDescription = DEFAULT_TABLE_ALERT_MSG,
...props ...props
}, },
ref ref,
) => { ) => {
let colDef = props.columnDefs.map((col, index) => { let colDef = props.columnDefs.map((col, index) => {
let newCol = { let newCol = {
@ -89,7 +91,7 @@ const TableComponent = forwardRef<
const onColumnMoved = (params) => { const onColumnMoved = (params) => {
const updatedColumnDefs = makeLastColumnNonResizable( const updatedColumnDefs = makeLastColumnNonResizable(
params.columnApi.getAllGridColumns().map((col) => col.getColDef()) params.columnApi.getAllGridColumns().map((col) => col.getColDef()),
); );
params.api.setGridOption("columnDefs", updatedColumnDefs); params.api.setGridOption("columnDefs", updatedColumnDefs);
if (props.onColumnMoved) props.onColumnMoved(params); if (props.onColumnMoved) props.onColumnMoved(params);
@ -114,7 +116,7 @@ const TableComponent = forwardRef<
className={cn( className={cn(
dark ? "ag-theme-quartz-dark" : "ag-theme-quartz", dark ? "ag-theme-quartz-dark" : "ag-theme-quartz",
"ag-theme-shadcn flex h-full flex-col", "ag-theme-shadcn flex h-full flex-col",
"relative" "relative",
)} // applying the grid theme )} // applying the grid theme
> >
<AgGridReact <AgGridReact
@ -133,7 +135,7 @@ const TableComponent = forwardRef<
<ResetColumns resetGrid={() => resetGrid(realRef, initialColumnDefs)} /> <ResetColumns resetGrid={() => resetGrid(realRef, initialColumnDefs)} />
</div> </div>
); );
} },
); );
export default TableComponent; export default TableComponent;

View file

@ -48,7 +48,7 @@ export function TagsSelector({
className={cn( className={cn(
selectedTags.some((category) => category === tag.name) selectedTags.some((category) => category === tag.name)
? "min-w-min bg-beta-foreground text-background hover:bg-beta-foreground" ? "min-w-min bg-beta-foreground text-background hover:bg-beta-foreground"
: "" : "",
)} )}
> >
{tag.name} {tag.name}

View file

@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef<
<div <div
className={cn( className={cn(
"flex flex-1 cursor-pointer items-center justify-between py-4 text-sm font-medium transition-all [&[data-state=open]>svg]:rotate-180", "flex flex-1 cursor-pointer items-center justify-between py-4 text-sm font-medium transition-all [&[data-state=open]>svg]:rotate-180",
className className,
)} )}
> >
{children} {children}
@ -46,7 +46,7 @@ const AccordionTrigger = React.forwardRef<
<ChevronDownIcon <ChevronDownIcon
className={cn( className={cn(
"h-4 w-4 font-bold transition-transform duration-200", "h-4 w-4 font-bold transition-transform duration-200",
disabled ? "text-muted-foreground" : "text-primary" disabled ? "text-muted-foreground" : "text-primary",
)} )}
/> />
</ShadTooltip> </ShadTooltip>
@ -64,7 +64,7 @@ const AccordionContent = React.forwardRef<
ref={ref} ref={ref}
className={cn( className={cn(
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
className className,
)} )}
{...props} {...props}
> >

View file

@ -15,7 +15,7 @@ const alertVariants = cva(
defaultVariants: { defaultVariants: {
variant: "default", variant: "default",
}, },
} },
); );
const Alert = React.forwardRef< const Alert = React.forwardRef<

View file

@ -35,7 +35,7 @@ const buttonVariants = cva(
variant: "default", variant: "default",
size: "default", size: "default",
}, },
} },
); );
export interface ButtonProps export interface ButtonProps
@ -65,7 +65,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
children, children,
...props ...props
}, },
ref ref,
) => { ) => {
const Comp = asChild ? Slot : "button"; const Comp = asChild ? Slot : "button";
let newChildren = children; let newChildren = children;
@ -97,7 +97,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
</Comp> </Comp>
</> </>
); );
} },
); );
Button.displayName = "Button"; Button.displayName = "Button";

View file

@ -9,7 +9,7 @@ const Card = React.forwardRef<
ref={ref} ref={ref}
className={cn( className={cn(
"flex flex-col justify-between rounded-lg border bg-muted text-card-foreground shadow-sm transition-all", "flex flex-col justify-between rounded-lg border bg-muted text-card-foreground shadow-sm transition-all",
className className,
)} )}
{...props} {...props}
/> />
@ -36,7 +36,7 @@ const CardTitle = React.forwardRef<
ref={ref} ref={ref}
className={cn( className={cn(
"text-base font-semibold leading-tight tracking-tight", "text-base font-semibold leading-tight tracking-tight",
className className,
)} )}
{...props} {...props}
/> />

View file

@ -13,7 +13,7 @@ const Checkbox = React.forwardRef<
ref={ref} ref={ref}
className={cn( className={cn(
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
className className,
)} )}
{...props} {...props}
> >
@ -37,7 +37,7 @@ const CheckBoxDiv = ({
className={cn( className={cn(
className, className,
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
checked ? "bg-primary text-primary-foreground" : "" checked ? "bg-primary text-primary-foreground" : "",
)} )}
> >
{checked && ( {checked && (

View file

@ -24,7 +24,7 @@ const AccordionTrigger = React.forwardRef<
<div <div
className={cn( className={cn(
" flex flex-1 cursor-pointer items-center justify-between border-[1px] py-2 text-sm font-medium data-[state=closed]:rounded-md data-[state=open]:rounded-t-md data-[state=open]:border-b-0 data-[state=open]:bg-muted [&[data-state=open]>svg]:rotate-180", " flex flex-1 cursor-pointer items-center justify-between border-[1px] py-2 text-sm font-medium data-[state=closed]:rounded-md data-[state=open]:rounded-t-md data-[state=open]:border-b-0 data-[state=open]:bg-muted [&[data-state=open]>svg]:rotate-180",
className className,
)} )}
> >
{children} {children}
@ -43,7 +43,7 @@ const AccordionContent = React.forwardRef<
ref={ref} ref={ref}
className={cn( className={cn(
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden border-[1px] text-sm data-[state=open]:rounded-b-md data-[state=open]:border-t-0 data-[state=open]:bg-muted", "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden border-[1px] text-sm data-[state=open]:rounded-b-md data-[state=open]:border-t-0 data-[state=open]:bg-muted",
className className,
)} )}
{...props} {...props}
> >

View file

@ -16,18 +16,18 @@ const Form = FormProvider;
type FormFieldContextValue< type FormFieldContextValue<
TFieldValues extends FieldValues = FieldValues, TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues> TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
> = { > = {
name: TName; name: TName;
}; };
const FormFieldContext = React.createContext<FormFieldContextValue>( const FormFieldContext = React.createContext<FormFieldContextValue>(
{} as FormFieldContextValue {} as FormFieldContextValue,
); );
const FormField = < const FormField = <
TFieldValues extends FieldValues = FieldValues, TFieldValues extends FieldValues = FieldValues,
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues> TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
>({ >({
...props ...props
}: ControllerProps<TFieldValues, TName>) => { }: ControllerProps<TFieldValues, TName>) => {
@ -66,7 +66,7 @@ type FormItemContextValue = {
}; };
const FormItemContext = React.createContext<FormItemContextValue>( const FormItemContext = React.createContext<FormItemContextValue>(
{} as FormItemContextValue {} as FormItemContextValue,
); );
const FormItem = React.forwardRef< const FormItem = React.forwardRef<

View file

@ -25,7 +25,7 @@ const toggleVariants = cva(
variant: "default", variant: "default",
size: "default", size: "default",
}, },
} },
); );
const Toggle = React.forwardRef< const Toggle = React.forwardRef<

View file

@ -20,7 +20,7 @@ const TooltipContent = React.forwardRef<
sideOffset={sideOffset} sideOffset={sideOffset}
className={cn( className={cn(
"z-45 overflow-y-auto rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1", "z-45 overflow-y-auto rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
className className,
)} )}
{...props} {...props}
/> />
@ -37,7 +37,7 @@ const TooltipContentWithoutPortal = React.forwardRef<
sideOffset={sideOffset} sideOffset={sideOffset}
className={cn( className={cn(
"z-45 overflow-y-auto rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1", "z-45 overflow-y-auto rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-50 data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1",
className className,
)} )}
{...props} {...props}
/> />

View file

@ -48,7 +48,7 @@ function ApiInterceptor() {
} }
await clearBuildVerticesState(error); await clearBuildVerticesState(error);
return Promise.reject(error); return Promise.reject(error);
} },
); );
const isAuthorizedURL = (url) => { const isAuthorizedURL = (url) => {
@ -65,10 +65,10 @@ function ApiInterceptor() {
const parsedURL = new URL(url); const parsedURL = new URL(url);
const isDomainAllowed = authorizedDomains.some( const isDomainAllowed = authorizedDomains.some(
(domain) => parsedURL.origin === new URL(domain).origin (domain) => parsedURL.origin === new URL(domain).origin,
); );
const isEndpointAllowed = authorizedEndpoints.some((endpoint) => const isEndpointAllowed = authorizedEndpoints.some((endpoint) =>
parsedURL.pathname.includes(endpoint) parsedURL.pathname.includes(endpoint),
); );
return isDomainAllowed || isEndpointAllowed; return isDomainAllowed || isEndpointAllowed;
@ -96,7 +96,7 @@ function ApiInterceptor() {
}, },
(error) => { (error) => {
return Promise.reject(error); return Promise.reject(error);
} },
); );
return () => { return () => {
@ -128,7 +128,7 @@ function ApiInterceptor() {
if (error?.config?.headers) { if (error?.config?.headers) {
delete error.config.headers["Authorization"]; delete error.config.headers["Authorization"];
error.config.headers["Authorization"] = `Bearer ${cookies.get( error.config.headers["Authorization"] = `Bearer ${cookies.get(
"access_token_lf" "access_token_lf",
)}`; )}`;
const response = await axios.request(error.config); const response = await axios.request(error.config);
return response; return response;

View file

@ -8,7 +8,7 @@ export function checkDuplicateRequestAndStoreRequest(config) {
const currentTime = Date.now(); const currentTime = Date.now();
const isContained = AUTHORIZED_DUPLICATE_REQUESTS.some((request) => const isContained = AUTHORIZED_DUPLICATE_REQUESTS.some((request) =>
config?.url!.includes(request) config?.url!.includes(request),
); );
if ( if (

View file

@ -62,7 +62,7 @@ export async function sendAll(data: sendAllProps) {
} }
export async function postValidateCode( export async function postValidateCode(
code: string code: string,
): Promise<AxiosResponse<errorsTypeAPI>> { ): Promise<AxiosResponse<errorsTypeAPI>> {
return await api.post(`${BASE_URL_API}validate/code`, { code }); return await api.post(`${BASE_URL_API}validate/code`, { code });
} }
@ -77,7 +77,7 @@ export async function postValidateCode(
export async function postValidatePrompt( export async function postValidatePrompt(
name: string, name: string,
template: string, template: string,
frontend_node: APIClassType frontend_node: APIClassType,
): Promise<AxiosResponse<PromptTypeAPI>> { ): Promise<AxiosResponse<PromptTypeAPI>> {
return api.post(`${BASE_URL_API}validate/prompt`, { return api.post(`${BASE_URL_API}validate/prompt`, {
name, name,
@ -150,7 +150,7 @@ export async function saveFlowToDatabase(newFlow: {
* @throws Will throw an error if the update fails. * @throws Will throw an error if the update fails.
*/ */
export async function updateFlowInDatabase( export async function updateFlowInDatabase(
updatedFlow: FlowType updatedFlow: FlowType,
): Promise<FlowType> { ): Promise<FlowType> {
try { try {
const response = await api.patch(`${BASE_URL_API}flows/${updatedFlow.id}`, { const response = await api.patch(`${BASE_URL_API}flows/${updatedFlow.id}`, {
@ -328,7 +328,7 @@ export async function getHealth() {
* *
*/ */
export async function getBuildStatus( export async function getBuildStatus(
flowId: string flowId: string,
): Promise<AxiosResponse<BuildStatusTypeAPI>> { ): Promise<AxiosResponse<BuildStatusTypeAPI>> {
return await api.get(`${BASE_URL_API}build/${flowId}/status`); return await api.get(`${BASE_URL_API}build/${flowId}/status`);
} }
@ -341,7 +341,7 @@ export async function getBuildStatus(
* *
*/ */
export async function postBuildInit( export async function postBuildInit(
flow: FlowType flow: FlowType,
): Promise<AxiosResponse<InitTypeAPI>> { ): Promise<AxiosResponse<InitTypeAPI>> {
return await api.post(`${BASE_URL_API}build/init/${flow.id}`, flow); return await api.post(`${BASE_URL_API}build/init/${flow.id}`, flow);
} }
@ -357,7 +357,7 @@ export async function postBuildInit(
*/ */
export async function uploadFile( export async function uploadFile(
file: File, file: File,
id: string id: string,
): Promise<AxiosResponse<UploadFileTypeAPI>> { ): Promise<AxiosResponse<UploadFileTypeAPI>> {
const formData = new FormData(); const formData = new FormData();
formData.append("file", file); formData.append("file", file);
@ -366,7 +366,7 @@ export async function uploadFile(
export async function postCustomComponent( export async function postCustomComponent(
code: string, code: string,
apiClass: APIClassType apiClass: APIClassType,
): Promise<AxiosResponse<APIClassType>> { ): Promise<AxiosResponse<APIClassType>> {
// let template = apiClass.template; // let template = apiClass.template;
return await api.post(`${BASE_URL_API}custom_component`, { return await api.post(`${BASE_URL_API}custom_component`, {
@ -379,7 +379,7 @@ export async function postCustomComponentUpdate(
code: string, code: string,
template: APITemplateType, template: APITemplateType,
field: string, field: string,
field_value: any field_value: any,
): Promise<AxiosResponse<APIClassType>> { ): Promise<AxiosResponse<APIClassType>> {
return await api.post(`${BASE_URL_API}custom_component/update`, { return await api.post(`${BASE_URL_API}custom_component/update`, {
code, code,
@ -401,7 +401,7 @@ export async function onLogin(user: LoginType) {
headers: { headers: {
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded",
}, },
} },
); );
if (response.status === 200) { if (response.status === 200) {
@ -463,11 +463,11 @@ export async function addUser(user: UserInputType): Promise<Array<Users>> {
export async function getUsersPage( export async function getUsersPage(
skip: number, skip: number,
limit: number limit: number,
): Promise<Array<Users>> { ): Promise<Array<Users>> {
try { try {
const res = await api.get( const res = await api.get(
`${BASE_URL_API}users/?skip=${skip}&limit=${limit}` `${BASE_URL_API}users/?skip=${skip}&limit=${limit}`,
); );
if (res.status === 200) { if (res.status === 200) {
return res.data; return res.data;
@ -504,7 +504,7 @@ export async function resetPassword(user_id: string, user: resetPasswordType) {
try { try {
const res = await api.patch( const res = await api.patch(
`${BASE_URL_API}users/${user_id}/reset-password`, `${BASE_URL_API}users/${user_id}/reset-password`,
user user,
); );
if (res.status === 200) { if (res.status === 200) {
return res.data; return res.data;
@ -578,7 +578,7 @@ export async function saveFlowStore(
last_tested_version?: string; last_tested_version?: string;
}, },
tags: string[], tags: string[],
publicFlow = false publicFlow = false,
): Promise<FlowType> { ): Promise<FlowType> {
try { try {
const response = await api.post(`${BASE_URL_API}store/components/`, { const response = await api.post(`${BASE_URL_API}store/components/`, {
@ -707,7 +707,7 @@ export async function postStoreComponents(component: Component) {
export async function getComponent(component_id: string) { export async function getComponent(component_id: string) {
try { try {
const res = await api.get( const res = await api.get(
`${BASE_URL_API}store/components/${component_id}` `${BASE_URL_API}store/components/${component_id}`,
); );
if (res.status === 200) { if (res.status === 200) {
return res.data; return res.data;
@ -722,7 +722,7 @@ export async function searchComponent(
page?: number | null, page?: number | null,
limit?: number | null, limit?: number | null,
status?: string | null, status?: string | null,
tags?: string[] tags?: string[],
): Promise<StoreComponentResponse | undefined> { ): Promise<StoreComponentResponse | undefined> {
try { try {
let url = `${BASE_URL_API}store/components/`; let url = `${BASE_URL_API}store/components/`;
@ -834,7 +834,7 @@ export async function updateFlowStore(
}, },
tags: string[], tags: string[],
publicFlow = false, publicFlow = false,
id: string id: string,
): Promise<FlowType> { ): Promise<FlowType> {
try { try {
const response = await api.patch(`${BASE_URL_API}store/components/${id}`, { const response = await api.patch(`${BASE_URL_API}store/components/${id}`, {
@ -918,7 +918,7 @@ export async function deleteGlobalVariable(id: string) {
export async function updateGlobalVariable( export async function updateGlobalVariable(
name: string, name: string,
value: string, value: string,
id: string id: string,
) { ) {
try { try {
const response = api.patch(`${BASE_URL_API}variables/${id}`, { const response = api.patch(`${BASE_URL_API}variables/${id}`, {
@ -937,7 +937,7 @@ export async function getVerticesOrder(
startNodeId?: string | null, startNodeId?: string | null,
stopNodeId?: string | null, stopNodeId?: string | null,
nodes?: Node[], nodes?: Node[],
Edges?: Edge[] Edges?: Edge[],
): Promise<AxiosResponse<VerticesOrderTypeAPI>> { ): Promise<AxiosResponse<VerticesOrderTypeAPI>> {
// nodeId is optional and is a query parameter // nodeId is optional and is a query parameter
// if nodeId is not provided, the API will return all vertices // if nodeId is not provided, the API will return all vertices
@ -957,7 +957,7 @@ export async function getVerticesOrder(
return await api.post( return await api.post(
`${BASE_URL_API}build/${flowId}/vertices`, `${BASE_URL_API}build/${flowId}/vertices`,
data, data,
config config,
); );
} }
@ -965,7 +965,7 @@ export async function postBuildVertex(
flowId: string, flowId: string,
vertexId: string, vertexId: string,
input_value: string, input_value: string,
files?: string[] files?: string[],
): Promise<AxiosResponse<VertexBuildTypeAPI>> { ): Promise<AxiosResponse<VertexBuildTypeAPI>> {
// input_value is optional and is a query parameter // input_value is optional and is a query parameter
const data = input_value const data = input_value
@ -976,7 +976,7 @@ export async function postBuildVertex(
} }
return await api.post( return await api.post(
`${BASE_URL_API}build/${flowId}/vertices/${vertexId}`, `${BASE_URL_API}build/${flowId}/vertices/${vertexId}`,
data data,
); );
} }
@ -1000,7 +1000,7 @@ export async function getFlowPool({
} }
export async function deleteFlowPool( export async function deleteFlowPool(
flowId: string flowId: string,
): Promise<AxiosResponse<any>> { ): Promise<AxiosResponse<any>> {
const config = {}; const config = {};
config["params"] = { flow_id: flowId }; config["params"] = { flow_id: flowId };
@ -1014,7 +1014,7 @@ export async function deleteFlowPool(
* @returns A promise that resolves to an array of AxiosResponse objects representing the delete responses. * @returns A promise that resolves to an array of AxiosResponse objects representing the delete responses.
*/ */
export async function multipleDeleteFlowsComponents( export async function multipleDeleteFlowsComponents(
flowIds: string[] flowIds: string[],
): Promise<AxiosResponse<any>[]> { ): Promise<AxiosResponse<any>[]> {
const batches: string[][] = []; const batches: string[][] = [];
@ -1037,7 +1037,7 @@ export async function multipleDeleteFlowsComponents(
// Execute all delete requests // Execute all delete requests
const responses: Promise<AxiosResponse<any>>[] = batches.map((batch) => const responses: Promise<AxiosResponse<any>>[] = batches.map((batch) =>
deleteBatch(batch) deleteBatch(batch),
); );
// Return the responses after all requests are completed // Return the responses after all requests are completed
@ -1047,7 +1047,7 @@ export async function multipleDeleteFlowsComponents(
export async function getTransactionTable( export async function getTransactionTable(
id: string, id: string,
mode: "intersection" | "union", mode: "intersection" | "union",
params = {} params = {},
): Promise<{ rows: Array<object>; columns: Array<ColDef | ColGroupDef> }> { ): Promise<{ rows: Array<object>; columns: Array<ColDef | ColGroupDef> }> {
const config = {}; const config = {};
config["params"] = { flow_id: id }; config["params"] = { flow_id: id };
@ -1063,7 +1063,7 @@ export async function getMessagesTable(
mode: "intersection" | "union", mode: "intersection" | "union",
id?: string, id?: string,
excludedFields?: string[], excludedFields?: string[],
params = {} params = {},
): Promise<{ rows: Array<Message>; columns: Array<ColDef | ColGroupDef> }> { ): Promise<{ rows: Array<Message>; columns: Array<ColDef | ColGroupDef> }> {
const config = {}; const config = {};
if (id) { if (id) {
@ -1074,20 +1074,11 @@ export async function getMessagesTable(
} }
const rows = await api.get(`${BASE_URL_API}monitor/messages`, config); const rows = await api.get(`${BASE_URL_API}monitor/messages`, config);
const columns = extractColumnsFromRows(rows.data, mode, excludedFields); const columns = extractColumnsFromRows(rows.data, mode, excludedFields);
return { rows: rows.data, columns };
}
export async function getSessions(id?: string): Promise<Array<string>> {
const config = {};
if (id) {
config["params"] = { flow_id: id };
}
const rows = await api.get(`${BASE_URL_API}monitor/messages`, config);
const sessions = new Set<string>(); const sessions = new Set<string>();
rows.data.forEach((row) => { rows.data.forEach((row) => {
sessions.add(row.session_id); sessions.add(row.session_id);
}); });
return Array.from(sessions); return { rows: rows.data, columns };
} }
export async function deleteMessagesFn(ids: number[]) { export async function deleteMessagesFn(ids: number[]) {

View file

@ -4,7 +4,7 @@ import { VertexBuildTypeAPI } from "../../types/api";
export const getSpecificClassFromBuildStatus = ( export const getSpecificClassFromBuildStatus = (
buildStatus: BuildStatus | undefined, buildStatus: BuildStatus | undefined,
validationStatus: VertexBuildTypeAPI | null, validationStatus: VertexBuildTypeAPI | null,
isDark: boolean isDark: boolean,
) => { ) => {
let isInvalid = validationStatus && !validationStatus.valid; let isInvalid = validationStatus && !validationStatus.valid;

View file

@ -4,5 +4,5 @@ import SvgStreamlit from "./SvgStreamlit";
export const Streamlit = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>( export const Streamlit = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => { (props, ref) => {
return <SvgStreamlit className="icon" ref={ref} {...props} />; return <SvgStreamlit className="icon" ref={ref} {...props} />;
} },
); );

View file

@ -27,7 +27,7 @@ const useFolderSubmit = (setOpen, folderToEdit) => {
getFoldersApi(true); getFoldersApi(true);
setOpen(false); setOpen(false);
} }
} },
); );
} else { } else {
addFolder(data).then( addFolder(data).then(
@ -42,7 +42,7 @@ const useFolderSubmit = (setOpen, folderToEdit) => {
setErrorData({ setErrorData({
title: `Error creating folder.`, title: `Error creating folder.`,
}); });
} },
); );
} }
}; };

View file

@ -29,7 +29,7 @@ export default function CsvSelect({ node, handleChangeSelect }): JSX.Element {
<SelectItem key={separator} value={separator}> <SelectItem key={separator} value={separator}>
{separator} {separator}
</SelectItem> </SelectItem>
) ),
)} )}
</SelectGroup> </SelectGroup>
</SelectContent> </SelectContent>

View file

@ -0,0 +1,29 @@
import { deleteMessagesFn } from "../../../../../controllers/API";
import { useMessagesStore } from "../../../../../stores/messagesStore";
const useRemoveSession = (setSuccessData, setErrorData) => {
const deleteSession = useMessagesStore((state) => state.deleteSession);
const messages = useMessagesStore((state) => state.messages);
const handleRemoveSession = async (session_id: string) => {
try {
await deleteMessagesFn(
messages
.filter((msg) => msg.session_id === session_id)
.map((msg) => msg.index),
);
deleteSession(session_id);
setSuccessData({
title: "Session deleted successfully.",
});
} catch (error) {
setErrorData({
title: "Error deleting Session.",
});
}
};
return { handleRemoveSession };
};
export default useRemoveSession;

View file

@ -0,0 +1,86 @@
import {
CellEditRequestEvent,
ColDef,
ColGroupDef,
SelectionChangedEvent,
} from "ag-grid-community";
import { useState } from "react";
import TableComponent from "../../../../components/tableComponent";
import { Card, CardContent } from "../../../../components/ui/card";
import useAlertStore from "../../../../stores/alertStore";
import { useMessagesStore } from "../../../../stores/messagesStore";
import useUpdateMessage from "../../../../pages/SettingsPage/pages/messagesPage/hooks/use-updateMessage";
import useRemoveMessages from "../../../../pages/SettingsPage/pages/messagesPage/hooks/use-remove-messages";
import HeaderMessagesComponent from "../../../../pages/SettingsPage/pages/messagesPage/components/headerMessages";
import { Button } from "../../../../components/ui/button";
import ForwardedIconComponent from "../../../../components/genericIconComponent";
import { cn } from "../../../../utils/utils";
export default function SessionView({ rows }: { rows: Array<any> }) {
const columns = useMessagesStore((state) => state.columns);
const setErrorData = useAlertStore((state) => state.setErrorData);
const setSuccessData = useAlertStore((state) => state.setSuccessData);
const [selectedRows, setSelectedRows] = useState<number[]>([]);
const { handleRemoveMessages } = useRemoveMessages(
setSelectedRows,
setSuccessData,
setErrorData,
selectedRows,
);
const { handleUpdate } = useUpdateMessage(setSuccessData, setErrorData);
function handleUpdateMessage(event: CellEditRequestEvent<any, string>) {
const newValue = event.newValue;
const field = event.column.getColId();
const row = event.data;
const data = {
...row,
[field]: newValue,
};
handleUpdate(data);
}
return (
<div className="flex h-full w-full flex-col justify-between gap-6">
<>
<div className="flex w-full items-center justify-end gap-4 space-y-0.5">
<div className="flex flex-shrink-0 items-center gap-2">
<Button
data-testid="api-key-button-store"
variant="primary"
className="group px-2"
disabled={selectedRows.length === 0}
onClick={handleRemoveMessages}
>
<ForwardedIconComponent
name="Trash2"
className={cn(
"h-5 w-5 text-destructive group-disabled:text-primary",
)}
/>
</Button>
</div>
</div>
</>
<TableComponent
readOnlyEdit
onCellEditRequest={(event) => {
handleUpdateMessage(event);
}}
editable={["Sender Name", "Message"]}
overlayNoRowsTemplate="No data available"
onSelectionChanged={(event: SelectionChangedEvent) => {
setSelectedRows(event.api.getSelectedRows().map((row) => row.index));
}}
rowSelection="multiple"
suppressRowClickSelection={true}
pagination={true}
columnDefs={columns}
rowData={rows}
/>
</div>
);
}

View file

@ -60,7 +60,7 @@ export default function ChatInput({
setFiles((prev) => { setFiles((prev) => {
const newFiles = [...prev]; const newFiles = [...prev];
const updatedIndex = newFiles.findIndex( const updatedIndex = newFiles.findIndex(
(file) => file.id === id (file) => file.id === id,
); );
newFiles[updatedIndex].loading = false; newFiles[updatedIndex].loading = false;
newFiles[updatedIndex].path = res.data.file_path; newFiles[updatedIndex].path = res.data.file_path;
@ -71,7 +71,7 @@ export default function ChatInput({
setFiles((prev) => { setFiles((prev) => {
const newFiles = [...prev]; const newFiles = [...prev];
const updatedIndex = newFiles.findIndex( const updatedIndex = newFiles.findIndex(
(file) => file.id === id (file) => file.id === id,
); );
newFiles[updatedIndex].loading = false; newFiles[updatedIndex].loading = false;
newFiles[updatedIndex].error = true; newFiles[updatedIndex].error = true;
@ -138,7 +138,7 @@ export default function ChatInput({
? "form-modal-no-input bg-input" ? "form-modal-no-input bg-input"
: " form-modal-lock-false bg-background", : " form-modal-lock-false bg-background",
"form-modal-lockchat" "form-modal-lockchat",
)} )}
placeholder={ placeholder={
noInput ? CHAT_INPUT_PLACEHOLDER : CHAT_INPUT_PLACEHOLDER_SEND noInput ? CHAT_INPUT_PLACEHOLDER : CHAT_INPUT_PLACEHOLDER_SEND
@ -152,7 +152,7 @@ export default function ChatInput({
? "bg-high-indigo text-background" ? "bg-high-indigo text-background"
: chatValue === "" : chatValue === ""
? "text-primary" ? "text-primary"
: "bg-chat-send text-background" : "bg-chat-send text-background",
)} )}
disabled={lockChat || saveLoading} disabled={lockChat || saveLoading}
onClick={(): void => send()} onClick={(): void => send()}

View file

@ -114,19 +114,19 @@ export default function ChatMessage({
<div <div
className={classNames( className={classNames(
"form-modal-chat-position", "form-modal-chat-position",
chat.isSend ? "" : " " chat.isSend ? "" : " ",
)} )}
> >
<div <div
className={classNames( className={classNames(
"mr-3 mt-1 flex w-24 flex-col items-center gap-1 overflow-hidden px-3 pb-3" "mr-3 mt-1 flex w-24 flex-col items-center gap-1 overflow-hidden px-3 pb-3",
)} )}
> >
<div className="flex flex-col items-center gap-1"> <div className="flex flex-col items-center gap-1">
<div <div
className={cn( className={cn(
"relative flex h-8 w-8 items-center justify-center overflow-hidden rounded-md p-5 text-2xl", "relative flex h-8 w-8 items-center justify-center overflow-hidden rounded-md p-5 text-2xl",
!chat.isSend ? "bg-chat-bot-icon" : "bg-chat-user-icon" !chat.isSend ? "bg-chat-bot-icon" : "bg-chat-user-icon",
)} )}
> >
<img <img
@ -210,12 +210,12 @@ dark:prose-invert"
children[0] = (children[0] as string).replace( children[0] = (children[0] as string).replace(
"`▍`", "`▍`",
"▍" "▍",
); );
} }
const match = /language-(\w+)/.exec( const match = /language-(\w+)/.exec(
className || "" className || "",
); );
return !inline ? ( return !inline ? (
@ -230,7 +230,7 @@ dark:prose-invert"
language: (match && match[1]) || "", language: (match && match[1]) || "",
code: String(children).replace( code: String(children).replace(
/\n$/, /\n$/,
"" "",
), ),
}, },
]} ]}
@ -248,7 +248,7 @@ dark:prose-invert"
{chatMessage} {chatMessage}
</Markdown> </Markdown>
), ),
[chat.message, chatMessage] [chat.message, chatMessage],
)} )}
</div> </div>
</div> </div>
@ -291,7 +291,7 @@ dark:prose-invert"
parts.push( parts.push(
<span className="chat-message-highlight"> <span className="chat-message-highlight">
{chat.message[match[1]]} {chat.message[match[1]]}
</span> </span>,
); );
} }

View file

@ -33,7 +33,7 @@ export default function FileCard({
<img <img
src={`${BACKEND_URL.slice( src={`${BACKEND_URL.slice(
0, 0,
BACKEND_URL.length - 1 BACKEND_URL.length - 1,
)}${BASE_URL_API}files/images/${content}`} )}${BASE_URL_API}files/images/${content}`}
alt="generated image" alt="generated image"
className="h-full w-full rounded-lg" className="h-full w-full rounded-lg"
@ -63,7 +63,7 @@ export default function FileCard({
<img <img
src={`${BACKEND_URL.slice( src={`${BACKEND_URL.slice(
0, 0,
BACKEND_URL.length - 1 BACKEND_URL.length - 1,
)}${BASE_URL_API}files/images/${content}`} )}${BASE_URL_API}files/images/${content}`}
alt="" alt=""
className="h-8 w-8" className="h-8 w-8"

View file

@ -62,7 +62,7 @@ export default function ChatView({
.sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp)) .sort((a, b) => Date.parse(a.timestamp) - Date.parse(b.timestamp))
// //
.filter( .filter(
(output) => output.data.messages && output.data.messages.length > 0 (output) => output.data.messages && output.data.messages.length > 0,
) )
.map((output, index) => { .map((output, index) => {
try { try {
@ -131,7 +131,7 @@ export default function ChatView({
function updateChat( function updateChat(
chat: ChatMessageType, chat: ChatMessageType,
message: string, message: string,
stream_url?: string stream_url?: string,
) { ) {
// if (message === "") return; // if (message === "") return;
chat.message = message; chat.message = message;

View file

@ -18,12 +18,18 @@ import { InputOutput } from "../../constants/enums";
import useFlowStore from "../../stores/flowStore"; import useFlowStore from "../../stores/flowStore";
import useFlowsManagerStore from "../../stores/flowsManagerStore"; import useFlowsManagerStore from "../../stores/flowsManagerStore";
import { IOModalPropsType } from "../../types/components"; import { IOModalPropsType } from "../../types/components";
import { NodeType } from "../../types/flow"; import { NodeDataType, NodeType } from "../../types/flow";
import { updateVerticesOrder } from "../../utils/buildUtils"; import { updateVerticesOrder } from "../../utils/buildUtils";
import { cn } from "../../utils/utils"; import { cn } from "../../utils/utils";
import BaseModal from "../baseModal"; import BaseModal from "../baseModal";
import IOFieldView from "./components/IOFieldView"; import IOFieldView from "./components/IOFieldView";
import ChatView from "./components/chatView"; import ChatView from "./components/chatView";
import { getMessagesTable } from "../../controllers/API";
import { useMessagesStore } from "../../stores/messagesStore";
import SessionView from "./components/SessionView";
import useRemoveSession from "./components/SessionView/hooks";
import useAlertStore from "../../stores/alertStore";
import { Button } from "../../components/ui/button";
export default function IOModal({ export default function IOModal({
children, children,
@ -32,27 +38,30 @@ export default function IOModal({
disable, disable,
}: IOModalPropsType): JSX.Element { }: IOModalPropsType): JSX.Element {
const allNodes = useFlowStore((state) => state.nodes); const allNodes = useFlowStore((state) => state.nodes);
const setMessages = useMessagesStore((state) => state.setMessages);
const inputs = useFlowStore((state) => state.inputs).filter( const inputs = useFlowStore((state) => state.inputs).filter(
(input) => input.type !== "ChatInput" (input) => input.type !== "ChatInput",
); );
const chatInput = useFlowStore((state) => state.inputs).find( const chatInput = useFlowStore((state) => state.inputs).find(
(input) => input.type === "ChatInput" (input) => input.type === "ChatInput",
); );
const outputs = useFlowStore((state) => state.outputs).filter( const outputs = useFlowStore((state) => state.outputs).filter(
(output) => output.type !== "ChatOutput" (output) => output.type !== "ChatOutput",
); );
const chatOutput = useFlowStore((state) => state.outputs).find( const chatOutput = useFlowStore((state) => state.outputs).find(
(output) => output.type === "ChatOutput" (output) => output.type === "ChatOutput",
); );
const nodes = useFlowStore((state) => state.nodes).filter( const nodes = useFlowStore((state) => state.nodes).filter(
(node) => (node) =>
inputs.some((input) => input.id === node.id) || inputs.some((input) => input.id === node.id) ||
outputs.some((output) => output.id === node.id) outputs.some((output) => output.id === node.id),
); );
const haveChat = chatInput || chatOutput; const haveChat = chatInput || chatOutput;
const [selectedTab, setSelectedTab] = useState( const [selectedTab, setSelectedTab] = useState(
inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0 inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0,
); );
const setErrorData = useAlertStore((state) => state.setErrorData);
const setSuccessData = useAlertStore((state) => state.setSuccessData);
function startView() { function startView() {
if (!chatInput && !chatOutput) { if (!chatInput && !chatOutput) {
@ -78,7 +87,8 @@ export default function IOModal({
const currentFlow = useFlowsManagerStore((state) => state.currentFlow); const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const setNode = useFlowStore((state) => state.setNode); const setNode = useFlowStore((state) => state.setNode);
const [sessions, setSessions] = useState<string[]>([]); const [sessions, setSessions] = useState<string[]>([]);
const messages = useMessagesStore((state) => state.messages);
const setColumns = useMessagesStore((state) => state.setColumns);
async function updateVertices() { async function updateVertices() {
return updateVerticesOrder(currentFlow!.id, null); return updateVerticesOrder(currentFlow!.id, null);
} }
@ -121,22 +131,47 @@ export default function IOModal({
} }
} }
const { handleRemoveSession } = useRemoveSession(
setSuccessData,
setErrorData,
);
useEffect(() => { useEffect(() => {
setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0); setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0);
}, [allNodes.length]); }, [allNodes.length]);
const flow_sessions = allNodes.map((node) => {
if ((node.data as NodeDataType).node?.template["session_id"]) {
return {
id: node.id,
session_id: (node.data as NodeDataType).node?.template["session_id"]
.value,
};
}
});
useEffect(() => { useEffect(() => {
setSelectedViewField(startView()); setSelectedViewField(startView());
// if (haveChat) { if (haveChat) {
// getSessions().then((sessions) => { getMessagesTable("union", currentFlow!.id).then(({ rows, columns }) => {
// setSessions(sessions); setMessages(rows);
// }); setColumns(columns);
// } });
}
}, [open]); }, [open]);
useEffect(() => {
const sessions = new Set<string>();
messages.forEach((row) => {
sessions.add(row.session_id);
});
setSessions(Array.from(sessions));
sessions;
}, [messages]);
return ( return (
<BaseModal <BaseModal
size={selectedTab === 0 ? "sm-thin" : "md-thin"} size={"md-thin"}
open={open} open={open}
setOpen={setOpen} setOpen={setOpen}
disable={disable} disable={disable}
@ -157,10 +192,9 @@ export default function IOModal({
<BaseModal.Content> <BaseModal.Content>
<div className="flex h-full flex-col "> <div className="flex h-full flex-col ">
<div className="flex-max-width h-full"> <div className="flex-max-width h-full">
{selectedTab !== 0 && (
<div <div
className={cn( className={cn(
"mr-6 flex h-full w-2/6 flex-shrink-0 flex-col justify-start transition-all duration-300" "mr-6 flex h-full w-2/6 flex-shrink-0 flex-col justify-start transition-all duration-300",
)} )}
> >
<Tabs <Tabs
@ -180,27 +214,18 @@ export default function IOModal({
{outputs.length > 0 && ( {outputs.length > 0 && (
<TabsTrigger value={"2"}>Outputs</TabsTrigger> <TabsTrigger value={"2"}>Outputs</TabsTrigger>
)} )}
{/* {haveChat && ( {haveChat && <TabsTrigger value={"0"}>History</TabsTrigger>}
<TabsTrigger value={"3"}>History</TabsTrigger>
)} */}
</TabsList> </TabsList>
</div> </div>
<TabsContent <TabsContent value={"1"} className="api-modal-tabs-content">
value={"1"}
className="api-modal-tabs-content mt-4"
>
<div className="mx-2 mb-2 flex items-center gap-2 text-sm font-bold">
<IconComponent className="h-4 w-4" name={"Type"} />
{TEXT_INPUT_MODAL_TITLE}
</div>
{nodes {nodes
.filter((node) => .filter((node) =>
inputs.some((input) => input.id === node.id) inputs.some((input) => input.id === node.id),
) )
.map((node, index) => { .map((node, index) => {
const input = inputs.find( const input = inputs.find(
(input) => input.id === node.id (input) => input.id === node.id,
)!; )!;
return ( return (
<div <div
@ -208,6 +233,10 @@ export default function IOModal({
key={index} key={index}
> >
<AccordionComponent <AccordionComponent
disabled={
node.data.node!.template["input_value"]?.value ===
""
}
trigger={ trigger={
<div className="file-component-badge-div"> <div className="file-component-badge-div">
<ShadTooltip <ShadTooltip
@ -254,21 +283,14 @@ export default function IOModal({
); );
})} })}
</TabsContent> </TabsContent>
<TabsContent <TabsContent value={"2"} className="api-modal-tabs-content">
value={"2"}
className="api-modal-tabs-content mt-4"
>
<div className="mx-2 mb-2 flex items-center gap-2 text-sm font-bold">
<IconComponent className="h-4 w-4" name={"Type"} />
{OUTPUTS_MODAL_TITLE}
</div>
{nodes {nodes
.filter((node) => .filter((node) =>
outputs.some((output) => output.id === node.id) outputs.some((output) => output.id === node.id),
) )
.map((node, index) => { .map((node, index) => {
const output = outputs.find( const output = outputs.find(
(output) => output.id === node.id (output) => output.id === node.id,
)!; )!;
return ( return (
<div <div
@ -276,10 +298,6 @@ export default function IOModal({
key={index} key={index}
> >
<AccordionComponent <AccordionComponent
disabled={
node.data.node!.template["input_value"]
?.value === ""
}
trigger={ trigger={
<div className="file-component-badge-div"> <div className="file-component-badge-div">
<ShadTooltip <ShadTooltip
@ -326,16 +344,85 @@ export default function IOModal({
); );
})} })}
</TabsContent> </TabsContent>
<TabsContent value={"0"} className="api-modal-tabs-content">
{sessions.map((session, index) => {
return (
<div
className="file-component-accordion-div cursor-pointer"
onClick={(event) => {
event.stopPropagation();
setSelectedViewField({
id: session,
type: "Session",
});
}}
>
<div className="flex w-full items-center justify-between border-b px-2 py-1 align-middle">
<Badge variant="gray" size="md">
{session}
</Badge>
<div className="flex items-center justify-center gap-2 align-middle">
<Button
variant="ghost"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
handleRemoveSession(session);
if (selectedViewField?.id === session)
setSelectedViewField(undefined);
}}
>
<ShadTooltip
styleClasses="z-50"
content={"delete"}
>
<div>
<IconComponent
name="Trash2"
className="h-4 w-4"
></IconComponent>
</div>
</ShadTooltip>
</Button>
<div>
<ShadTooltip
styleClasses="z-50"
content={
flow_sessions.some(
(f_session) =>
f_session?.session_id === session,
)
? "Active Session"
: "Inactive Session"
}
>
<div
className={cn(
"h-2 w-2 rounded-full",
flow_sessions.some(
(f_session) =>
f_session?.session_id === session,
)
? "bg-status-green"
: "bg-slate-500",
)}
></div>
</ShadTooltip>
</div>
</div>
</div>
</div>
);
})}
</TabsContent>
</Tabs> </Tabs>
</div> </div>
)}
<div className="flex h-full min-w-96 flex-grow"> <div className="flex h-full min-w-96 flex-grow">
{selectedViewField && ( {selectedViewField && (
<div <div
className={cn( className={cn(
"flex h-full w-full flex-col items-start gap-4 pt-4", "flex h-full w-full flex-col items-start gap-4 pt-4",
!selectedViewField ? "hidden" : "" !selectedViewField ? "hidden" : "",
)} )}
> >
<div className="font-xl flex items-center justify-center gap-3 font-semibold"> <div className="font-xl flex items-center justify-center gap-3 font-semibold">
@ -354,15 +441,18 @@ export default function IOModal({
</div> </div>
<div className="h-full w-full"> <div className="h-full w-full">
{inputs.some( {inputs.some(
(input) => input.id === selectedViewField.id (input) => input.id === selectedViewField.id,
) ? ( ) && (
<IOFieldView <IOFieldView
type={InputOutput.INPUT} type={InputOutput.INPUT}
left={false} left={false}
fieldType={selectedViewField.type!} fieldType={selectedViewField.type!}
fieldId={selectedViewField.id!} fieldId={selectedViewField.id!}
/> />
) : ( )}
{outputs.some(
(output) => output.id === selectedViewField.id,
) && (
<IOFieldView <IOFieldView
type={InputOutput.OUTPUT} type={InputOutput.OUTPUT}
left={false} left={false}
@ -370,13 +460,23 @@ export default function IOModal({
fieldId={selectedViewField.id!} fieldId={selectedViewField.id!}
/> />
)} )}
{sessions.some(
(session) => session === selectedViewField.id,
) && (
<SessionView
rows={messages.filter(
(message) =>
message.session_id === selectedViewField.id,
)}
/>
)}
</div> </div>
</div> </div>
)} )}
<div <div
className={cn( className={cn(
"flex h-full w-full", "flex h-full w-full",
selectedViewField ? "hidden" : "" selectedViewField ? "hidden" : "",
)} )}
> >
{haveChat ? ( {haveChat ? (
@ -408,7 +508,7 @@ export default function IOModal({
"h-4 w-4", "h-4 w-4",
isBuilding isBuilding
? "animate-spin" ? "animate-spin"
: "fill-current text-medium-indigo" : "fill-current text-medium-indigo",
)} )}
/> />
), ),

View file

@ -6,7 +6,7 @@ export const checkCanBuildTweakObject = (element, templateField) => {
templateField.charAt(0) !== "_" && templateField.charAt(0) !== "_" &&
element.data.node.template[templateField].show && element.data.node.template[templateField].show &&
LANGFLOW_SUPPORTED_TYPES.has( LANGFLOW_SUPPORTED_TYPES.has(
element.data.node.template[templateField].type element.data.node.template[templateField].type,
) && ) &&
templateField !== "code" templateField !== "code"
); );

View file

@ -3,7 +3,7 @@ import { convertArrayToObj } from "../../../utils/reactflowUtils";
export const getChangesType = ( export const getChangesType = (
changes: string | string[] | boolean | number | Object[] | Object, changes: string | string[] | boolean | number | Object[] | Object,
template: TemplateVariableType template: TemplateVariableType,
) => { ) => {
if (typeof changes === "string" && template.type === "float") { if (typeof changes === "string" && template.type === "float") {
changes = parseFloat(changes); changes = parseFloat(changes);

View file

@ -8,7 +8,7 @@ export function getCurlRunCode(
flowId: string, flowId: string,
isAuth: boolean, isAuth: boolean,
tweaksBuildedObject, tweaksBuildedObject,
endpointName?: string endpointName?: string,
): string { ): string {
const tweaksObject = tweaksBuildedObject[0]; const tweaksObject = tweaksBuildedObject[0];
// show the endpoint name in the curl command if it exists // show the endpoint name in the curl command if it exists

View file

@ -13,8 +13,8 @@ export const getNodesWithDefaultValue = (flow) => {
templateField.charAt(0) !== "_" && templateField.charAt(0) !== "_" &&
node.data.node.template[templateField].show && node.data.node.template[templateField].show &&
LANGFLOW_SUPPORTED_TYPES.has( LANGFLOW_SUPPORTED_TYPES.has(
node.data.node.template[templateField].type node.data.node.template[templateField].type,
) ),
) )
.map((n, i) => { .map((n, i) => {
arrNodesWithValues.push(node["id"]); arrNodesWithValues.push(node["id"]);

View file

@ -9,7 +9,7 @@ export default function getPythonApiCode(
flowId: string, flowId: string,
isAuth: boolean, isAuth: boolean,
tweaksBuildedObject, tweaksBuildedObject,
endpointName?: string endpointName?: string,
): string { ): string {
const tweaksObject = tweaksBuildedObject[0]; const tweaksObject = tweaksBuildedObject[0];
return `import argparse return `import argparse

View file

@ -5,7 +5,7 @@ export const getValue = (
value: string, value: string,
node: NodeType, node: NodeType,
template: TemplateVariableType, template: TemplateVariableType,
tweak: Object[] tweak: Object[],
) => { ) => {
let returnValue = value ?? ""; let returnValue = value ?? "";

View file

@ -6,7 +6,7 @@
export default function getWidgetCode( export default function getWidgetCode(
flowId: string, flowId: string,
flowName: string, flowName: string,
isAuth: boolean isAuth: boolean,
): string { ): string {
return `<script src="https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@1.0_alpha/dist/build/static/js/bundle.min.js"></script> return `<script src="https://cdn.jsdelivr.net/gh/langflow-ai/langflow-embedded-chat@1.0_alpha/dist/build/static/js/bundle.min.js"></script>

View file

@ -1,7 +1,7 @@
export function createTabsArray( export function createTabsArray(
codes, codes,
includeWebhookCurl = false, includeWebhookCurl = false,
includeTweaks = false includeTweaks = false,
) { ) {
const tabs = [ const tabs = [
{ {

View file

@ -35,7 +35,7 @@ const ApiModal = forwardRef(
flow: FlowType; flow: FlowType;
children: ReactNode; children: ReactNode;
}, },
ref ref,
) => { ) => {
const tweak = useTweaksStore((state) => state.tweak); const tweak = useTweaksStore((state) => state.tweak);
const addTweaks = useTweaksStore((state) => state.setTweak); const addTweaks = useTweaksStore((state) => state.setTweak);
@ -50,18 +50,18 @@ const ApiModal = forwardRef(
flow?.id, flow?.id,
autoLogin, autoLogin,
tweak, tweak,
flow?.endpoint_name flow?.endpoint_name,
); );
const curl_run_code = getCurlRunCode( const curl_run_code = getCurlRunCode(
flow?.id, flow?.id,
autoLogin, autoLogin,
tweak, tweak,
flow?.endpoint_name flow?.endpoint_name,
); );
const curl_webhook_code = getCurlWebhookCode( const curl_webhook_code = getCurlWebhookCode(
flow?.id, flow?.id,
autoLogin, autoLogin,
flow?.endpoint_name flow?.endpoint_name,
); );
const pythonCode = getPythonCode(flow?.name, tweak); const pythonCode = getPythonCode(flow?.name, tweak);
const widgetCode = getWidgetCode(flow?.id, flow?.name, autoLogin); const widgetCode = getWidgetCode(flow?.id, flow?.name, autoLogin);
@ -76,7 +76,7 @@ const ApiModal = forwardRef(
pythonCode, pythonCode,
]; ];
const [tabs, setTabs] = useState( const [tabs, setTabs] = useState(
createTabsArray(codesArray, includeWebhook) createTabsArray(codesArray, includeWebhook),
); );
const canShowTweaks = const canShowTweaks =
@ -125,7 +125,7 @@ const ApiModal = forwardRef(
buildTweakObject( buildTweakObject(
nodeId, nodeId,
element.data.node.template[templateField].value, element.data.node.template[templateField].value,
element.data.node.template[templateField] element.data.node.template[templateField],
); );
} }
}); });
@ -142,7 +142,7 @@ const ApiModal = forwardRef(
async function buildTweakObject( async function buildTweakObject(
tw: string, tw: string,
changes: string | string[] | boolean | number | Object[] | Object, changes: string | string[] | boolean | number | Object[] | Object,
template: TemplateVariableType template: TemplateVariableType,
) { ) {
changes = getChangesType(changes, template); changes = getChangesType(changes, template);
@ -184,7 +184,7 @@ const ApiModal = forwardRef(
flow?.id, flow?.id,
autoLogin, autoLogin,
cloneTweak, cloneTweak,
flow?.endpoint_name flow?.endpoint_name,
); );
const pythonCode = getPythonCode(flow?.name, cloneTweak); const pythonCode = getPythonCode(flow?.name, cloneTweak);
const widgetCode = getWidgetCode(flow?.id, flow?.name, autoLogin); const widgetCode = getWidgetCode(flow?.id, flow?.name, autoLogin);
@ -228,7 +228,7 @@ const ApiModal = forwardRef(
</BaseModal.Content> </BaseModal.Content>
</BaseModal> </BaseModal>
); );
} },
); );
export default ApiModal; export default ApiModal;

View file

@ -103,7 +103,7 @@ interface BaseModalProps {
React.ReactElement<ContentProps>, React.ReactElement<ContentProps>,
React.ReactElement<HeaderProps>, React.ReactElement<HeaderProps>,
React.ReactElement<TriggerProps>?, React.ReactElement<TriggerProps>?,
React.ReactElement<FooterProps>? React.ReactElement<FooterProps>?,
]; ];
open?: boolean; open?: boolean;
setOpen?: (open: boolean) => void; setOpen?: (open: boolean) => void;
@ -139,16 +139,16 @@ function BaseModal({
onSubmit, onSubmit,
}: BaseModalProps) { }: BaseModalProps) {
const headerChild = React.Children.toArray(children).find( const headerChild = React.Children.toArray(children).find(
(child) => (child as React.ReactElement).type === Header (child) => (child as React.ReactElement).type === Header,
); );
const triggerChild = React.Children.toArray(children).find( const triggerChild = React.Children.toArray(children).find(
(child) => (child as React.ReactElement).type === Trigger (child) => (child as React.ReactElement).type === Trigger,
); );
const ContentChild = React.Children.toArray(children).find( const ContentChild = React.Children.toArray(children).find(
(child) => (child as React.ReactElement).type === Content (child) => (child as React.ReactElement).type === Content,
); );
const ContentFooter = React.Children.toArray(children).find( const ContentFooter = React.Children.toArray(children).find(
(child) => (child as React.ReactElement).type === Footer (child) => (child as React.ReactElement).type === Footer,
); );
let { minWidth, height } = switchCaseModalSize(size); let { minWidth, height } = switchCaseModalSize(size);

View file

@ -8,7 +8,7 @@ const useColumnDefs = (
myData: any, myData: any,
handleOnNewValue: (newValue: any, name: string) => void, handleOnNewValue: (newValue: any, name: string) => void,
changeAdvanced: (n: string) => void, changeAdvanced: (n: string) => void,
open: boolean open: boolean,
) => { ) => {
const columnDefs: ColDef[] = useMemo( const columnDefs: ColDef[] = useMemo(
() => [ () => [
@ -81,7 +81,7 @@ const useColumnDefs = (
cellClass: "no-border", cellClass: "no-border",
}, },
], ],
[open, myData] [open, myData],
); );
return columnDefs; return columnDefs;

View file

@ -22,7 +22,7 @@ const EditNodeModal = forwardRef(
setOpen: (open: boolean) => void; setOpen: (open: boolean) => void;
data: NodeDataType; data: NodeDataType;
}, },
ref ref,
) => { ) => {
const myData = useRef(data); const myData = useRef(data);
@ -43,7 +43,7 @@ const EditNodeModal = forwardRef(
data, data,
handleOnNewValue, handleOnNewValue,
changeAdvanced, changeAdvanced,
open open,
); );
const [gridApi, setGridApi] = useState<GridApi | null>(null); const [gridApi, setGridApi] = useState<GridApi | null>(null);
@ -107,7 +107,7 @@ const EditNodeModal = forwardRef(
<BaseModal.Footer submit={{ label: "Save Changes" }} /> <BaseModal.Footer submit={{ label: "Save Changes" }} />
</BaseModal> </BaseModal>
); );
} },
); );
export default EditNodeModal; export default EditNodeModal;

View file

@ -37,7 +37,7 @@ export default function FlowLogsModal({
const { columns, rows } = data; const { columns, rows } = data;
setColumns(columns.map((col) => ({ ...col, editable: true }))); setColumns(columns.map((col) => ({ ...col, editable: true })));
setRows(rows); setRows(rows);
} },
); );
} }
@ -47,7 +47,7 @@ export default function FlowLogsModal({
.some((template) => template["stream"] && template["stream"].value); .some((template) => template["stream"] && template["stream"].value);
console.log( console.log(
haStream, haStream,
nodes.map((nodes) => (nodes.data as NodeDataType).node!.template) nodes.map((nodes) => (nodes.data as NodeDataType).node!.template),
); );
if (haStream) { if (haStream) {
setNoticeData({ setNoticeData({

View file

@ -33,7 +33,7 @@ const useFolderSubmit = (setOpen, folderToEdit) => {
getFoldersApi(true); getFoldersApi(true);
setOpen(false); setOpen(false);
} }
} },
); );
} else { } else {
addFolder(data).then( addFolder(data).then(
@ -49,7 +49,7 @@ const useFolderSubmit = (setOpen, folderToEdit) => {
setErrorData({ setErrorData({
title: `Error creating folder.`, title: `Error creating folder.`,
}); });
} },
); );
} }
}; };

View file

@ -83,7 +83,7 @@ export default function GenericModal({
} }
const filteredWordsHighlight = matches.filter( const filteredWordsHighlight = matches.filter(
(word) => !invalid_chars.includes(word) (word) => !invalid_chars.includes(word),
); );
setWordsHighlight(filteredWordsHighlight); setWordsHighlight(filteredWordsHighlight);
@ -134,7 +134,7 @@ export default function GenericModal({
// to the first key of the custom_fields object // to the first key of the custom_fields object
if (field_name === "") { if (field_name === "") {
field_name = Array.isArray( field_name = Array.isArray(
apiReturn.data?.frontend_node?.custom_fields?.[""] apiReturn.data?.frontend_node?.custom_fields?.[""],
) )
? apiReturn.data?.frontend_node?.custom_fields?.[""][0] ?? "" ? apiReturn.data?.frontend_node?.custom_fields?.[""][0] ?? ""
: apiReturn.data?.frontend_node?.custom_fields?.[""] ?? ""; : apiReturn.data?.frontend_node?.custom_fields?.[""] ?? "";
@ -209,7 +209,7 @@ export default function GenericModal({
<div <div
className={classNames( className={classNames(
!isEdit ? "rounded-lg border" : "", !isEdit ? "rounded-lg border" : "",
"flex h-full w-full" "flex h-full w-full",
)} )}
> >
{type === TypeModal.PROMPT && isEdit && !readonly ? ( {type === TypeModal.PROMPT && isEdit && !readonly ? (

View file

@ -32,7 +32,7 @@ export default function NewFlowModal({
key={0} key={0}
flow={ flow={
examples.find( examples.find(
(e) => e.name == "Basic Prompting (Hello, World)" (e) => e.name == "Basic Prompting (Hello, World)",
)! )!
} }
/> />

View file

@ -128,14 +128,14 @@ export default function ShareModal({
title: "Error sharing " + is_component ? "component" : "flow", title: "Error sharing " + is_component ? "component" : "flow",
list: [err["response"]["data"]["detail"]], list: [err["response"]["data"]["detail"]],
}); });
} },
); );
else else
updateFlowStore( updateFlowStore(
flow!, flow!,
getTagsIds(selectedTags, tags), getTagsIds(selectedTags, tags),
sharePublic, sharePublic,
unavaliableNames.find((e) => e.name === name)!.id unavaliableNames.find((e) => e.name === name)!.id,
).then(successShare, (err) => { ).then(successShare, (err) => {
setErrorData({ setErrorData({
title: "Error sharing " + is_component ? "component" : "flow", title: "Error sharing " + is_component ? "component" : "flow",
@ -203,7 +203,7 @@ export default function ShareModal({
setOpen={setOpen ?? internalSetOpen} setOpen={setOpen ?? internalSetOpen}
onSubmit={() => { onSubmit={() => {
const isNameAvailable = !unavaliableNames.some( const isNameAvailable = !unavaliableNames.some(
(element) => element.name === name (element) => element.name === name,
); );
if (isNameAvailable) { if (isNameAvailable) {

View file

@ -1,6 +1,6 @@
export default function getTagsIds( export default function getTagsIds(
tags: string[], tags: string[],
tagListId: { name: string; id: string }[] tagListId: { name: string; id: string }[],
) { ) {
return tags return tags
.map((tag) => tagListId.find((tagObj) => tagObj.name === tag))! .map((tag) => tagListId.find((tagObj) => tagObj.name === tag))!

View file

@ -52,19 +52,19 @@ export default function Page({
}): JSX.Element { }): JSX.Element {
const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow); const uploadFlow = useFlowsManagerStore((state) => state.uploadFlow);
const autoSaveCurrentFlow = useFlowsManagerStore( const autoSaveCurrentFlow = useFlowsManagerStore(
(state) => state.autoSaveCurrentFlow (state) => state.autoSaveCurrentFlow,
); );
const types = useTypesStore((state) => state.types); const types = useTypesStore((state) => state.types);
const templates = useTypesStore((state) => state.templates); const templates = useTypesStore((state) => state.templates);
const setFilterEdge = useFlowStore((state) => state.setFilterEdge); const setFilterEdge = useFlowStore((state) => state.setFilterEdge);
const reactFlowWrapper = useRef<HTMLDivElement>(null); const reactFlowWrapper = useRef<HTMLDivElement>(null);
const [showCanvas, setSHowCanvas] = useState( const [showCanvas, setSHowCanvas] = useState(
Object.keys(templates).length > 0 && Object.keys(types).length > 0 Object.keys(templates).length > 0 && Object.keys(types).length > 0,
); );
const reactFlowInstance = useFlowStore((state) => state.reactFlowInstance); const reactFlowInstance = useFlowStore((state) => state.reactFlowInstance);
const setReactFlowInstance = useFlowStore( const setReactFlowInstance = useFlowStore(
(state) => state.setReactFlowInstance (state) => state.setReactFlowInstance,
); );
const nodes = useFlowStore((state) => state.nodes); const nodes = useFlowStore((state) => state.nodes);
const edges = useFlowStore((state) => state.edges); const edges = useFlowStore((state) => state.edges);
@ -81,10 +81,10 @@ export default function Page({
const paste = useFlowStore((state) => state.paste); const paste = useFlowStore((state) => state.paste);
const resetFlow = useFlowStore((state) => state.resetFlow); const resetFlow = useFlowStore((state) => state.resetFlow);
const lastCopiedSelection = useFlowStore( const lastCopiedSelection = useFlowStore(
(state) => state.lastCopiedSelection (state) => state.lastCopiedSelection,
); );
const setLastCopiedSelection = useFlowStore( const setLastCopiedSelection = useFlowStore(
(state) => state.setLastCopiedSelection (state) => state.setLastCopiedSelection,
); );
const onConnect = useFlowStore((state) => state.onConnect); const onConnect = useFlowStore((state) => state.onConnect);
const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId); const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId);
@ -107,7 +107,7 @@ export default function Page({
clonedSelection!, clonedSelection!,
clonedNodes, clonedNodes,
clonedEdges, clonedEdges,
getRandomName() getRandomName(),
); );
const newGroupNode = generateNodeFromFlow(newFlow, getNodeId); const newGroupNode = generateNodeFromFlow(newFlow, getNodeId);
const newEdges = reconnectEdges(newGroupNode, removedEdges); const newEdges = reconnectEdges(newGroupNode, removedEdges);
@ -115,8 +115,8 @@ export default function Page({
...clonedNodes.filter( ...clonedNodes.filter(
(oldNodes) => (oldNodes) =>
!clonedSelection?.nodes.some( !clonedSelection?.nodes.some(
(selectionNode) => selectionNode.id === oldNodes.id (selectionNode) => selectionNode.id === oldNodes.id,
) ),
), ),
newGroupNode, newGroupNode,
]); ]);
@ -126,8 +126,8 @@ export default function Page({
!clonedSelection!.nodes.some( !clonedSelection!.nodes.some(
(selectionNode) => (selectionNode) =>
selectionNode.id === oldEdge.target || selectionNode.id === oldEdge.target ||
selectionNode.id === oldEdge.source selectionNode.id === oldEdge.source,
) ),
), ),
...newEdges, ...newEdges,
]); ]);
@ -180,7 +180,7 @@ export default function Page({
{ {
x: position.current.x, x: position.current.x,
y: position.current.y, y: position.current.y,
} },
); );
} }
if (!isWrappedWithClass(event, "noundo")) { if (!isWrappedWithClass(event, "noundo")) {
@ -276,7 +276,7 @@ export default function Page({
useEffect(() => { useEffect(() => {
setSHowCanvas( setSHowCanvas(
Object.keys(templates).length > 0 && Object.keys(types).length > 0 Object.keys(templates).length > 0 && Object.keys(types).length > 0,
); );
}, [templates, types]); }, [templates, types]);
@ -285,7 +285,7 @@ export default function Page({
takeSnapshot(); takeSnapshot();
onConnect(params); onConnect(params);
}, },
[takeSnapshot, onConnect] [takeSnapshot, onConnect],
); );
const onNodeDragStart: NodeDragHandler = useCallback(() => { const onNodeDragStart: NodeDragHandler = useCallback(() => {
@ -326,7 +326,7 @@ export default function Page({
// Extract the data from the drag event and parse it as a JSON object // Extract the data from the drag event and parse it as a JSON object
const data: { type: string; node?: APIClassType } = JSON.parse( const data: { type: string; node?: APIClassType } = JSON.parse(
event.dataTransfer.getData("nodedata") event.dataTransfer.getData("nodedata"),
); );
const newId = getNodeId(data.type); const newId = getNodeId(data.type);
@ -342,7 +342,7 @@ export default function Page({
}; };
paste( paste(
{ nodes: [newNode], edges: [] }, { nodes: [newNode], edges: [] },
{ x: event.clientX, y: event.clientY } { x: event.clientX, y: event.clientY },
); );
} else if (event.dataTransfer.types.some((types) => types === "Files")) { } else if (event.dataTransfer.types.some((types) => types === "Files")) {
takeSnapshot(); takeSnapshot();
@ -371,7 +371,7 @@ export default function Page({
} }
}, },
// Specify dependencies for useCallback // Specify dependencies for useCallback
[getNodeId, setNodes, takeSnapshot, paste] [getNodeId, setNodes, takeSnapshot, paste],
); );
const onEdgeUpdateStart = useCallback(() => { const onEdgeUpdateStart = useCallback(() => {
@ -387,7 +387,7 @@ export default function Page({
setEdges((els) => updateEdge(oldEdge, newConnection, els)); setEdges((els) => updateEdge(oldEdge, newConnection, els));
} }
}, },
[setEdges] [setEdges],
); );
const onEdgeUpdateEnd = useCallback((_, edge: Edge): void => { const onEdgeUpdateEnd = useCallback((_, edge: Edge): void => {
@ -420,7 +420,7 @@ export default function Page({
(flow: OnSelectionChangeParams): void => { (flow: OnSelectionChangeParams): void => {
setLastSelection(flow); setLastSelection(flow);
}, },
[] [],
); );
const onPaneClick = useCallback((flow) => { const onPaneClick = useCallback((flow) => {

View file

@ -5,7 +5,7 @@ import { toTitleCase } from "../../../../../utils/utils";
export default function getRandomName( export default function getRandomName(
retry: number = 0, retry: number = 0,
noSpace: boolean = false, noSpace: boolean = false,
maxRetries: number = 3 maxRetries: number = 3,
): string { ): string {
const left: string[] = ADJECTIVES; const left: string[] = ADJECTIVES;
const right: string[] = NOUNS; const right: string[] = NOUNS;

View file

@ -13,7 +13,7 @@ export default function SelectionMenu({
const [disable, setDisable] = useState<boolean>( const [disable, setDisable] = useState<boolean>(
lastSelection && edges.length > 0 lastSelection && edges.length > 0
? validateSelection(lastSelection!, edges).length > 0 ? validateSelection(lastSelection!, edges).length > 0
: false : false,
); );
const [isOpen, setIsOpen] = useState(false); const [isOpen, setIsOpen] = useState(false);
const [isTransitioning, setIsTransitioning] = useState(false); const [isTransitioning, setIsTransitioning] = useState(false);

View file

@ -41,7 +41,7 @@ export default function ExtraSidebar(): JSX.Element {
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
function onDragStart( function onDragStart(
event: React.DragEvent<any>, event: React.DragEvent<any>,
data: { type: string; node?: APIClassType } data: { type: string; node?: APIClassType },
): void { ): void {
//start drag event //start drag event
var crt = event.currentTarget.cloneNode(true); var crt = event.currentTarget.cloneNode(true);
@ -67,7 +67,7 @@ export default function ExtraSidebar(): JSX.Element {
let keys = Object.keys(data[d]).filter( let keys = Object.keys(data[d]).filter(
(nd) => (nd) =>
nd.toLowerCase().includes(e.toLowerCase()) || nd.toLowerCase().includes(e.toLowerCase()) ||
data[d][nd].display_name?.toLowerCase().includes(e.toLowerCase()) data[d][nd].display_name?.toLowerCase().includes(e.toLowerCase()),
); );
keys.forEach((element) => { keys.forEach((element) => {
ret[d][element] = data[d][element]; ret[d][element] = data[d][element];
@ -134,7 +134,7 @@ export default function ExtraSidebar(): JSX.Element {
if (filtered.some((x) => x !== "")) { if (filtered.some((x) => x !== "")) {
let keys = Object.keys(dataClone[d]).filter((nd) => let keys = Object.keys(dataClone[d]).filter((nd) =>
filtered.includes(nd) filtered.includes(nd),
); );
Object.keys(dataClone[d]).forEach((element) => { Object.keys(dataClone[d]).forEach((element) => {
if (!keys.includes(element)) { if (!keys.includes(element)) {
@ -171,7 +171,7 @@ export default function ExtraSidebar(): JSX.Element {
if (filtered.some((x) => x !== "")) { if (filtered.some((x) => x !== "")) {
let keys = Object.keys(dataClone[d]).filter((nd) => let keys = Object.keys(dataClone[d]).filter((nd) =>
filtered.includes(nd) filtered.includes(nd),
); );
Object.keys(dataClone[d]).forEach((element) => { Object.keys(dataClone[d]).forEach((element) => {
if (!keys.includes(element)) { if (!keys.includes(element)) {
@ -200,7 +200,7 @@ export default function ExtraSidebar(): JSX.Element {
"extra-side-bar-buttons gap-[4px] text-sm font-semibold", "extra-side-bar-buttons gap-[4px] text-sm font-semibold",
!hasApiKey || !validApiKey || !hasStore !hasApiKey || !validApiKey || !hasStore
? "button-disable cursor-default text-muted-foreground" ? "button-disable cursor-default text-muted-foreground"
: "" : "",
)} )}
> >
<IconComponent <IconComponent
@ -209,14 +209,14 @@ export default function ExtraSidebar(): JSX.Element {
"-m-0.5 -ml-1 h-6 w-6", "-m-0.5 -ml-1 h-6 w-6",
!hasApiKey || !validApiKey || !hasStore !hasApiKey || !validApiKey || !hasStore
? "extra-side-bar-save-disable" ? "extra-side-bar-save-disable"
: "" : "",
)} )}
/> />
Share Share
</button> </button>
</ShareModal> </ShareModal>
), ),
[hasApiKey, validApiKey, currentFlow, hasStore] [hasApiKey, validApiKey, currentFlow, hasStore],
); );
const ExportMemo = useMemo( const ExportMemo = useMemo(
@ -227,7 +227,7 @@ export default function ExtraSidebar(): JSX.Element {
</button> </button>
</ExportModal> </ExportModal>
), ),
[] [],
); );
const getIcon = useMemo(() => { const getIcon = useMemo(() => {
@ -311,8 +311,8 @@ export default function ExtraSidebar(): JSX.Element {
.sort((a, b) => .sort((a, b) =>
sensitiveSort( sensitiveSort(
dataFilter[SBSectionName][a].display_name, dataFilter[SBSectionName][a].display_name,
dataFilter[SBSectionName][b].display_name dataFilter[SBSectionName][b].display_name,
) ),
) )
.map((SBItemName: string, index) => ( .map((SBItemName: string, index) => (
<ShadTooltip <ShadTooltip
@ -356,7 +356,7 @@ export default function ExtraSidebar(): JSX.Element {
</> </>
) : ( ) : (
<div key={index}></div> <div key={index}></div>
) ),
)}{" "} )}{" "}
<ParentDisclosureComponent <ParentDisclosureComponent
openDisc={false} openDisc={false}
@ -393,8 +393,8 @@ export default function ExtraSidebar(): JSX.Element {
.sort((a, b) => .sort((a, b) =>
sensitiveSort( sensitiveSort(
dataFilter[SBSectionName][a].display_name, dataFilter[SBSectionName][a].display_name,
dataFilter[SBSectionName][b].display_name dataFilter[SBSectionName][b].display_name,
) ),
) )
.map((SBItemName: string, index) => ( .map((SBItemName: string, index) => (
<ShadTooltip <ShadTooltip
@ -468,7 +468,7 @@ export default function ExtraSidebar(): JSX.Element {
</> </>
) : ( ) : (
<div key={index}></div> <div key={index}></div>
) ),
)} )}
</ParentDisclosureComponent> </ParentDisclosureComponent>
</div> </div>

View file

@ -58,7 +58,7 @@ export default function NodeToolbarComponent({
data.node.template[templateField].type === "Any" || data.node.template[templateField].type === "Any" ||
data.node.template[templateField].type === "int" || data.node.template[templateField].type === "int" ||
data.node.template[templateField].type === "dict" || data.node.template[templateField].type === "dict" ||
data.node.template[templateField].type === "NestedDict") data.node.template[templateField].type === "NestedDict"),
).length; ).length;
const templates = useTypesStore((state) => state.templates); const templates = useTypesStore((state) => state.templates);
const hasStore = useStoreStore((state) => state.hasStore); const hasStore = useStoreStore((state) => state.hasStore);
@ -85,7 +85,7 @@ export default function NodeToolbarComponent({
const [showconfirmShare, setShowconfirmShare] = useState(false); const [showconfirmShare, setShowconfirmShare] = useState(false);
const [showOverrideModal, setShowOverrideModal] = useState(false); const [showOverrideModal, setShowOverrideModal] = useState(false);
const [flowComponent, setFlowComponent] = useState<FlowType>( const [flowComponent, setFlowComponent] = useState<FlowType>(
createFlowComponent(cloneDeep(data), version) createFlowComponent(cloneDeep(data), version),
); );
const openInNewTab = (url) => { const openInNewTab = (url) => {
@ -100,7 +100,7 @@ export default function NodeToolbarComponent({
const updateNodeInternals = useUpdateNodeInternals(); const updateNodeInternals = useUpdateNodeInternals();
const setLastCopiedSelection = useFlowStore( const setLastCopiedSelection = useFlowStore(
(state) => state.setLastCopiedSelection (state) => state.setLastCopiedSelection,
); );
const setSuccessData = useAlertStore((state) => state.setSuccessData); const setSuccessData = useAlertStore((state) => state.setSuccessData);
@ -153,7 +153,7 @@ export default function NodeToolbarComponent({
nodes, nodes,
edges, edges,
setNodes, setNodes,
setEdges setEdges,
); );
break; break;
case "override": case "override":
@ -177,7 +177,7 @@ export default function NodeToolbarComponent({
y: 10, y: 10,
paneX: nodes.find((node) => node.id === data.id)?.position.x, paneX: nodes.find((node) => node.id === data.id)?.position.x,
paneY: nodes.find((node) => node.id === data.id)?.position.y, paneY: nodes.find((node) => node.id === data.id)?.position.y,
} },
); );
break; break;
case "update": case "update":
@ -215,13 +215,13 @@ export default function NodeToolbarComponent({
}; };
const isSaved = flows.some((flow) => const isSaved = flows.some((flow) =>
Object.values(flow).includes(data.node?.display_name!) Object.values(flow).includes(data.node?.display_name!),
); );
const setNode = useFlowStore((state) => state.setNode); const setNode = useFlowStore((state) => state.setNode);
const handleOnNewValue = ( const handleOnNewValue = (
newValue: string | string[] | boolean | Object[] newValue: string | string[] | boolean | Object[],
): void => { ): void => {
if (data.node!.template[name].value !== newValue) { if (data.node!.template[name].value !== newValue) {
takeSnapshot(); takeSnapshot();
@ -408,7 +408,7 @@ export default function NodeToolbarComponent({
data-testid="save-button-modal" data-testid="save-button-modal"
className={classNames( 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", "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",
hasCode ? " " : " rounded-l-md " hasCode ? " " : " rounded-l-md ",
)} )}
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();
@ -426,7 +426,7 @@ export default function NodeToolbarComponent({
<button <button
data-testid="duplicate-button-modal" data-testid="duplicate-button-modal"
className={classNames( 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" "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",
)} )}
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();
@ -440,7 +440,7 @@ export default function NodeToolbarComponent({
<ShadTooltip content="Freeze" side="top"> <ShadTooltip content="Freeze" side="top">
<button <button
className={classNames( 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" "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",
)} )}
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();
@ -461,7 +461,7 @@ export default function NodeToolbarComponent({
className={cn( className={cn(
"h-4 w-4 transition-all", "h-4 w-4 transition-all",
// TODO UPDATE THIS COLOR TO BE A VARIABLE // TODO UPDATE THIS COLOR TO BE A VARIABLE
frozen ? "animate-wiggle text-ice" : "" frozen ? "animate-wiggle text-ice" : "",
)} )}
/> />
</button> </button>
@ -474,7 +474,7 @@ export default function NodeToolbarComponent({
<div <div
data-testid="more-options-modal" data-testid="more-options-modal"
className={classNames( className={classNames(
"relative -ml-px inline-flex h-8 w-[31px] items-center rounded-r-md bg-background text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10" "relative -ml-px inline-flex h-8 w-[31px] items-center rounded-r-md bg-background text-foreground shadow-md ring-1 ring-inset ring-ring transition-all duration-500 ease-in-out hover:bg-muted focus:z-10",
)} )}
> >
<IconComponent <IconComponent

View file

@ -10,7 +10,7 @@ import ExtraSidebar from "./components/extraSidebarComponent";
export default function FlowPage({ view }: { view?: boolean }): JSX.Element { export default function FlowPage({ view }: { view?: boolean }): JSX.Element {
const setCurrentFlowId = useFlowsManagerStore( const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId (state) => state.setCurrentFlowId,
); );
const version = useDarkStore((state) => state.version); const version = useDarkStore((state) => state.version);
const setOnFlowPage = useFlowStore((state) => state.setOnFlowPage); const setOnFlowPage = useFlowStore((state) => state.setOnFlowPage);

View file

@ -20,7 +20,7 @@ const HeaderTabsSearchComponent = ({}: HeaderTabsSearchComponentProps) => {
const [inputValue, setInputValue] = useState(""); const [inputValue, setInputValue] = useState("");
const setSearchFlowsComponents = useFlowsManagerStore( const setSearchFlowsComponents = useFlowsManagerStore(
(state) => state.setSearchFlowsComponents (state) => state.setSearchFlowsComponents,
); );
const handleDownloadFolder = () => { const handleDownloadFolder = () => {

View file

@ -23,7 +23,7 @@ const InputSearchComponent = ({
const pagePath = window.location.pathname; const pagePath = window.location.pathname;
const allFlows = useFlowsManagerStore((state) => state.allFlows); const allFlows = useFlowsManagerStore((state) => state.allFlows);
const searchFlowsComponents = useFlowsManagerStore( const searchFlowsComponents = useFlowsManagerStore(
(state) => state.searchFlowsComponents (state) => state.searchFlowsComponents,
); );
const disableInputSearch = const disableInputSearch =

View file

@ -11,7 +11,7 @@ export function handleDownloadFolderFn(folderId: string) {
data.folder_description = folder?.description || ""; data.folder_description = folder?.description || "";
const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent( const jsonString = `data:text/json;chatset=utf-8,${encodeURIComponent(
JSON.stringify(data) JSON.stringify(data),
)}`; )}`;
const link = document.createElement("a"); const link = document.createElement("a");

View file

@ -11,7 +11,7 @@ export default function PlaygroundPage() {
const currentFlow = useFlowsManagerStore((state) => state.currentFlow); const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const getFlowById = useFlowsManagerStore((state) => state.getFlowById); const getFlowById = useFlowsManagerStore((state) => state.getFlowById);
const setCurrentFlowId = useFlowsManagerStore( const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId (state) => state.setCurrentFlowId,
); );
const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId); const currentFlowId = useFlowsManagerStore((state) => state.currentFlowId);
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow); const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);

Some files were not shown because too many files have changed in this diff Show more