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.
* [langflow](#overview)
* [langflow api-key](#langflow-api-key)
* [langflow copy-db](#langflow-copy-db)
* [langflow migration](#langflow-migration)
* [langflow run](#langflow-run)
* [langflow superuser](#langflow-superuser)
- [langflow](#overview)
- [langflow api-key](#langflow-api-key)
- [langflow copy-db](#langflow-copy-db)
- [langflow migration](#langflow-migration)
- [langflow run](#langflow-run)
- [langflow superuser](#langflow-superuser)
## Overview
@ -23,21 +23,21 @@ langflow --help
python -m langflow
```
| Command | Description |
| ------- | ----------- |
| `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`). |
| `migration` | Run or test migrations. |
| `run` | Run the Langflow. |
| `superuser` | Create a superuser. |
| Command | Description |
| ----------- | ---------------------------------------------------------------------- |
| `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`). |
| `migration` | Run or test migrations. |
| `run` | Run the Langflow. |
| `superuser` | Create a superuser. |
### Options
| Option | Description |
| ------ | ----------- |
| `--install-completion` | Install completion for the current shell. |
| `--show-completion` | Show completion for the current shell, to copy it or customize the installation. |
| `--help` | Show this message and exit. |
| Option | Description |
| ---------------------- | -------------------------------------------------------------------------------- |
| `--install-completion` | Install completion for the current shell. |
| `--show-completion` | Show completion for the current shell, to copy it or customize the installation. |
| `--help` | Show this message and exit. |
## langflow api-key
@ -61,10 +61,10 @@ python -m langflow api-key
### Options
| Option | Type | Description |
|------------------|------|-------------------------------------------------------------|
| --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
| --help | | Show this message and exit. |
| Option | Type | Description |
| ----------- | ---- | ------------------------------------------------------------- |
| --log-level | TEXT | Logging level. [env var: LANGFLOW_LOG_LEVEL] [default: error] |
| --help | | Show this message and exit. |
## langflow copy-db
@ -87,12 +87,12 @@ python -m langflow migration
```
### Options
| Option | Description |
|-----------------|-------------------------------------------------------------|
| `--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] |
| `--help` | Show this message and exit. |
| Option | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `--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] |
| `--help` | Show this message and exit. |
## langflow run
@ -106,26 +106,26 @@ python -m langflow run
### Options
| Option | Description |
|-------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--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`. |
| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. |
| `--timeout` | Sets the worker timeout in seconds. The default is `60`. |
| `--port` | Sets the port to listen on. Can be set using the `LANGFLOW_PORT` environment variable. The default is `7860`. |
| `--env-file` | Specifies the path to the .env file containing environment variables. The default is `.env`. |
| `--log-level` | Defines the logging level. Can be set using the `LANGFLOW_LOG_LEVEL` environment variable. The default is `critical`. |
| `--components-path` | Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`. |
| `--log-file` | Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`. |
| `--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`. |
| `--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`. |
| `--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. |
| `--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).|
| `--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. |
| Option | Description |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--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`. |
| `--workers` | Sets the number of worker processes. Can be set using the `LANGFLOW_WORKERS` environment variable. The default is `1`. |
| `--timeout` | Sets the worker timeout in seconds. The default is `60`. |
| `--port` | Sets the port to listen on. Can be set using the `LANGFLOW_PORT` environment variable. The default is `7860`. |
| `--env-file` | Specifies the path to the .env file containing environment variables. The default is `.env`. |
| `--log-level` | Defines the logging level. Can be set using the `LANGFLOW_LOG_LEVEL` environment variable. The default is `critical`. |
| `--components-path` | Specifies the path to the directory containing custom components. Can be set using the `LANGFLOW_COMPONENTS_PATH` environment variable. The default is `langflow/components`. |
| `--log-file` | Specifies the path to the log file. Can be set using the `LANGFLOW_LOG_FILE` environment variable. The default is `logs/langflow.log`. |
| `--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`. |
| `--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`. |
| `--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. |
| `--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). |
| `--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
@ -145,10 +145,9 @@ python -m langflow superuser
### Options
| Option | Type | Description |
|----------------|-------|-------------------------------------------------------------|
| `--username` | TEXT | Username 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] |
| `--help` | | Show this message and exit. |
| Option | Type | Description |
| ------------- | ---- | ------------------------------------------------------------- |
| `--username` | TEXT | Username 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] |
| `--help` | | Show this message and exit. |

View file

@ -1,4 +1,5 @@
# Backend-only
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`.
@ -8,17 +9,18 @@ Langflow will now serve requests to its API without the frontend running.
## 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
1. Click API.
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 -X POST \
"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": {}
}}'
```
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
1. Stop Langflow with Ctrl+C.
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`.
Langflow will now serve requests to its API.
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.
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
{"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.
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.
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
import requests
from typing import Optional
@ -99,15 +105,19 @@ message = "message"
print(run_flow(message=message, flow_id=FLOW_ID))
```
3. Run your Python app:
```python
python3 app.py
```
The result is similar to the curl call:
```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}]}]}
```
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",
label: "Deployment",
collapsed: true,
items: ["deployment/docker",
items: [
"deployment/docker",
"deployment/backend-only",
"deployment/gcp-deployment",
],

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -24,7 +24,7 @@ const TooltipRenderComponent = ({ item, index, left }) => {
<span
key={index}
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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -17,7 +17,7 @@ export default function AccordionComponent({
sideBar,
}: AccordionComponentType): JSX.Element {
const [value, setValue] = useState(
open.length === 0 ? "" : getOpenAccordion()
open.length === 0 ? "" : getOpenAccordion(),
);
function getOpenAccordion(): string {
@ -52,7 +52,7 @@ export default function AccordionComponent({
disabled={disabled}
className={cn(
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}

View file

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

View file

@ -10,7 +10,7 @@ export default function DragCardComponent({ data }: { data: storeComponent }) {
draggable
//TODO check color schema
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>
@ -22,7 +22,7 @@ export default function DragCardComponent({ data }: { data: storeComponent }) {
"visible flex-shrink-0",
data.is_component
? "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"}
/>

View file

@ -60,11 +60,11 @@ export default function CollectionCardComponent({
const [loading, setLoading] = useState(false);
const [loadingLike, setLoadingLike] = useState(false);
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 [downloads_count, setDownloads_count] = useState(
data?.downloads_count ?? 0
data?.downloads_count ?? 0,
);
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const setCurrentFlow = useFlowsManagerStore((state) => state.setCurrentFlow);
@ -75,12 +75,12 @@ export default function CollectionCardComponent({
const [openPlayground, setOpenPlayground] = useState(false);
const [openDelete, setOpenDelete] = useState(false);
const setCurrentFlowId = useFlowsManagerStore(
(state) => state.setCurrentFlowId
(state) => state.setCurrentFlowId,
);
const [loadingPlayground, setLoadingPlayground] = useState(false);
const selectedFlowsComponentsCards = useFlowsManagerStore(
(state) => state.selectedFlowsComponentsCards
(state) => state.selectedFlowsComponentsCards,
);
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]",
disabled ? "pointer-events-none opacity-50" : "",
onClick ? "cursor-pointer" : "",
isSelectedCard ? "border border-selected" : ""
isSelectedCard ? "border border-selected" : "",
)}
onClick={onClick}
>
@ -233,7 +233,7 @@ export default function CollectionCardComponent({
"visible flex-shrink-0",
data.is_component
? "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"}
/>
@ -428,7 +428,7 @@ export default function CollectionCardComponent({
name="Trash2"
className={cn(
"h-5 w-5",
!authorized ? " text-ring" : ""
!authorized ? " text-ring" : "",
)}
/>
</Button>
@ -463,7 +463,7 @@ export default function CollectionCardComponent({
liked_by_user
? "fill-destructive stroke-destructive"
: "",
!authorized ? " text-ring" : ""
!authorized ? " text-ring" : "",
)}
/>
</Button>
@ -501,7 +501,7 @@ export default function CollectionCardComponent({
}
className={cn(
loading ? "h-5 w-5 animate-spin" : "h-5 w-5",
!authorized ? " text-ring" : ""
!authorized ? " text-ring" : "",
)}
/>
</Button>

View file

@ -65,7 +65,7 @@ export default function CardsWrapComponent({
"h-full w-full",
isDragging
? "mb-36 flex flex-col items-center justify-center gap-4 text-2xl font-light"
: ""
: "",
)}
>
{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 ",
!hasApiKey || !validApiKey || !hasStore
? " button-disable text-muted-foreground "
: ""
: "",
)}
>
<ForwardedIconComponent
@ -59,14 +59,14 @@ export default function FlowToolbar(): JSX.Element {
"-m-0.5 -ml-1 h-6 w-6",
!hasApiKey || !validApiKey || !hasStore
? "extra-side-bar-save-disable"
: ""
: "",
)}
/>
Share
</button>
</ShareModal>
),
[hasApiKey, validApiKey, currentFlow, hasStore]
[hasApiKey, validApiKey, currentFlow, hasStore],
);
return (
@ -118,7 +118,7 @@ export default function FlowToolbar(): JSX.Element {
<ApiModal flow={currentFlow}>
<div
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

View file

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

View file

@ -236,7 +236,7 @@ export default function CodeTabsComponent({
<div className="api-modal-according-display">
<div
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) => (
@ -275,8 +275,8 @@ export default function CodeTabsComponent({
.show &&
LANGFLOW_SUPPORTED_TYPES.has(
node.data.node.template[templateField]
.type
)
.type,
),
)
.map((templateField, indx) => {
return (
@ -334,7 +334,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -380,7 +380,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -433,7 +433,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -470,7 +470,7 @@ export default function CodeTabsComponent({
e,
node.data.node.template[
templateField
]
],
);
}}
size="small"
@ -501,7 +501,7 @@ export default function CodeTabsComponent({
].fileTypes
}
onFileChange={(
value: any
value: any,
) => {
node.data.node.template[
templateField
@ -554,7 +554,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -594,7 +594,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
value={
@ -656,7 +656,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -702,7 +702,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -748,7 +748,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>
@ -780,8 +780,8 @@ export default function CodeTabsComponent({
].value,
type(
node,
templateField
)
templateField,
),
)
}
duplicateKey={
@ -790,15 +790,15 @@ export default function CodeTabsComponent({
onChange={(target) => {
const valueToNumbers =
convertValuesToNumbers(
target
target,
);
node.data.node!.template[
templateField
].value = valueToNumbers;
setErrorDuplicateKey(
hasDuplicateKeys(
valueToNumbers
)
valueToNumbers,
),
);
setData((old) => {
let newInputList =
@ -815,7 +815,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
isList={
@ -863,7 +863,7 @@ export default function CodeTabsComponent({
target,
node.data.node.template[
templateField
]
],
);
}}
/>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -60,14 +60,14 @@ const CustomInputPopoverObject = ({
? options.find((option) => option.id === selectedOption)?.name ||
""
: (selectedOptions?.length !== 0 || !onChange) &&
setSelectedOptions
? selectedOptions
.map(
(optionId) =>
options.find((option) => option.id === optionId)?.name
)
.join(", ")
: value
setSelectedOptions
? selectedOptions
.map(
(optionId) =>
options.find((option) => option.id === optionId)?.name,
)
.join(", ")
: value
}
autoFocus={autoFocus}
disabled={disabled}
@ -115,15 +115,15 @@ const CustomInputPopoverObject = ({
onSelect={(currentValue) => {
setSelectedOption &&
setSelectedOption(
currentValue === selectedOption ? "" : currentValue
currentValue === selectedOption ? "" : currentValue,
);
setSelectedOptions &&
setSelectedOptions(
selectedOptions?.includes(currentValue)
? selectedOptions.filter(
(item) => item !== currentValue
(item) => item !== currentValue,
)
: [...selectedOptions, currentValue]
: [...selectedOptions, currentValue],
);
!setSelectedOptions && setShowOptions(false);
}}
@ -136,7 +136,7 @@ const CustomInputPopoverObject = ({
selectedOption === option.id ||
selectedOptions?.includes(option.id)
? "opacity-100"
: "opacity-0"
: "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 " : "",
password && editNode ? "pr-8" : "",
password && !editNode ? "pr-10" : "",
className!
className!,
)}
placeholder={password && editNode ? "Key" : placeholder}
onChange={(e) => {
@ -154,7 +154,7 @@ export default function InputComponent({
<span
className={cn(
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
@ -167,7 +167,7 @@ export default function InputComponent({
selectedOption !== ""
? "text-medium-indigo"
: "text-muted-foreground",
"hover:text-accent-foreground"
"hover:text-accent-foreground",
)}
>
<ForwardedIconComponent
@ -187,7 +187,7 @@ export default function InputComponent({
"mb-px",
editNode
? "input-component-true-button"
: "input-component-false-button"
: "input-component-false-button",
)}
onClick={(event) => {
event.preventDefault();
@ -204,7 +204,7 @@ export default function InputComponent({
className={classNames(
editNode
? "input-component-true-svg"
: "input-component-false-svg"
: "input-component-false-svg",
)}
>
<path
@ -223,7 +223,7 @@ export default function InputComponent({
className={classNames(
editNode
? "input-component-true-svg"
: "input-component-false-svg"
: "input-component-false-svg",
)}
>
<path

View file

@ -103,8 +103,8 @@ export default function InputFileComponent({
editNode
? "input-edit-node input-dialog text-muted-foreground"
: disabled
? "input-disable input-dialog primary-input"
: "input-dialog primary-input text-muted-foreground"
? "input-disable input-dialog primary-input"
: "input-dialog primary-input text-muted-foreground"
}
>
{myValue !== "" ? myValue : "No file"}

View file

@ -19,15 +19,15 @@ export default function InputGlobalComponent({
editNode = false,
}: InputGlobalComponentType): JSX.Element {
const globalVariablesEntries = useGlobalVariablesStore(
(state) => state.globalVariablesEntries
(state) => state.globalVariablesEntries,
);
const getVariableId = useGlobalVariablesStore((state) => state.getVariableId);
const unavaliableFields = useGlobalVariablesStore(
(state) => state.unavaliableFields
(state) => state.unavaliableFields,
);
const removeGlobalVariable = useGlobalVariablesStore(
(state) => state.removeGlobalVariable
(state) => state.removeGlobalVariable,
);
const setErrorData = useAlertStore((state) => state.setErrorData);
@ -121,7 +121,7 @@ export default function InputGlobalComponent({
<ForwardedIconComponent
name="Trash2"
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"
/>

View file

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

View file

@ -27,7 +27,7 @@ const SideBarButtonsComponent = ({
pathname === item.href
? "border border-border bg-muted hover:bg-muted"
: "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}

View file

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

View file

@ -34,7 +34,7 @@ export default function TableAutoCellRender({
variant="outline"
size="sq"
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}

View file

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

View file

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

View file

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

View file

@ -34,7 +34,7 @@ const AccordionTrigger = React.forwardRef<
<div
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",
className
className,
)}
>
{children}
@ -46,7 +46,7 @@ const AccordionTrigger = React.forwardRef<
<ChevronDownIcon
className={cn(
"h-4 w-4 font-bold transition-transform duration-200",
disabled ? "text-muted-foreground" : "text-primary"
disabled ? "text-muted-foreground" : "text-primary",
)}
/>
</ShadTooltip>
@ -64,7 +64,7 @@ const AccordionContent = React.forwardRef<
ref={ref}
className={cn(
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
className
className,
)}
{...props}
>

View file

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

View file

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

View file

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

View file

@ -13,7 +13,7 @@ const Checkbox = React.forwardRef<
ref={ref}
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",
className
className,
)}
{...props}
>
@ -37,7 +37,7 @@ const CheckBoxDiv = ({
className={cn(
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",
checked ? "bg-primary text-primary-foreground" : ""
checked ? "bg-primary text-primary-foreground" : "",
)}
>
{checked && (

View file

@ -24,7 +24,7 @@ const AccordionTrigger = React.forwardRef<
<div
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",
className
className,
)}
>
{children}
@ -43,7 +43,7 @@ const AccordionContent = React.forwardRef<
ref={ref}
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",
className
className,
)}
{...props}
>

View file

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

View file

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

View file

@ -20,7 +20,7 @@ const TooltipContent = React.forwardRef<
sideOffset={sideOffset}
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",
className
className,
)}
{...props}
/>
@ -37,7 +37,7 @@ const TooltipContentWithoutPortal = React.forwardRef<
sideOffset={sideOffset}
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",
className
className,
)}
{...props}
/>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -29,7 +29,7 @@ export default function CsvSelect({ node, handleChangeSelect }): JSX.Element {
<SelectItem key={separator} value={separator}>
{separator}
</SelectItem>
)
),
)}
</SelectGroup>
</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) => {
const newFiles = [...prev];
const updatedIndex = newFiles.findIndex(
(file) => file.id === id
(file) => file.id === id,
);
newFiles[updatedIndex].loading = false;
newFiles[updatedIndex].path = res.data.file_path;
@ -71,7 +71,7 @@ export default function ChatInput({
setFiles((prev) => {
const newFiles = [...prev];
const updatedIndex = newFiles.findIndex(
(file) => file.id === id
(file) => file.id === id,
);
newFiles[updatedIndex].loading = false;
newFiles[updatedIndex].error = true;
@ -135,10 +135,10 @@ export default function ChatInput({
lockChat || saveLoading
? " form-modal-lock-true bg-input"
: noInput
? "form-modal-no-input bg-input"
: " form-modal-lock-false bg-background",
? "form-modal-no-input bg-input"
: " form-modal-lock-false bg-background",
"form-modal-lockchat"
"form-modal-lockchat",
)}
placeholder={
noInput ? CHAT_INPUT_PLACEHOLDER : CHAT_INPUT_PLACEHOLDER_SEND
@ -151,8 +151,8 @@ export default function ChatInput({
noInput
? "bg-high-indigo text-background"
: chatValue === ""
? "text-primary"
: "bg-chat-send text-background"
? "text-primary"
: "bg-chat-send text-background",
)}
disabled={lockChat || saveLoading}
onClick={(): void => send()}

View file

@ -114,19 +114,19 @@ export default function ChatMessage({
<div
className={classNames(
"form-modal-chat-position",
chat.isSend ? "" : " "
chat.isSend ? "" : " ",
)}
>
<div
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={cn(
"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
@ -210,12 +210,12 @@ dark:prose-invert"
children[0] = (children[0] as string).replace(
"`▍`",
"▍"
"▍",
);
}
const match = /language-(\w+)/.exec(
className || ""
className || "",
);
return !inline ? (
@ -230,7 +230,7 @@ dark:prose-invert"
language: (match && match[1]) || "",
code: String(children).replace(
/\n$/,
""
"",
),
},
]}
@ -248,7 +248,7 @@ dark:prose-invert"
{chatMessage}
</Markdown>
),
[chat.message, chatMessage]
[chat.message, chatMessage],
)}
</div>
</div>
@ -291,7 +291,7 @@ dark:prose-invert"
parts.push(
<span className="chat-message-highlight">
{chat.message[match[1]]}
</span>
</span>,
);
}

View file

@ -33,7 +33,7 @@ export default function FileCard({
<img
src={`${BACKEND_URL.slice(
0,
BACKEND_URL.length - 1
BACKEND_URL.length - 1,
)}${BASE_URL_API}files/images/${content}`}
alt="generated image"
className="h-full w-full rounded-lg"
@ -63,7 +63,7 @@ export default function FileCard({
<img
src={`${BACKEND_URL.slice(
0,
BACKEND_URL.length - 1
BACKEND_URL.length - 1,
)}${BASE_URL_API}files/images/${content}`}
alt=""
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))
//
.filter(
(output) => output.data.messages && output.data.messages.length > 0
(output) => output.data.messages && output.data.messages.length > 0,
)
.map((output, index) => {
try {
@ -131,7 +131,7 @@ export default function ChatView({
function updateChat(
chat: ChatMessageType,
message: string,
stream_url?: string
stream_url?: string,
) {
// if (message === "") return;
chat.message = message;

View file

@ -18,12 +18,18 @@ import { InputOutput } from "../../constants/enums";
import useFlowStore from "../../stores/flowStore";
import useFlowsManagerStore from "../../stores/flowsManagerStore";
import { IOModalPropsType } from "../../types/components";
import { NodeType } from "../../types/flow";
import { NodeDataType, NodeType } from "../../types/flow";
import { updateVerticesOrder } from "../../utils/buildUtils";
import { cn } from "../../utils/utils";
import BaseModal from "../baseModal";
import IOFieldView from "./components/IOFieldView";
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({
children,
@ -32,27 +38,30 @@ export default function IOModal({
disable,
}: IOModalPropsType): JSX.Element {
const allNodes = useFlowStore((state) => state.nodes);
const setMessages = useMessagesStore((state) => state.setMessages);
const inputs = useFlowStore((state) => state.inputs).filter(
(input) => input.type !== "ChatInput"
(input) => input.type !== "ChatInput",
);
const chatInput = useFlowStore((state) => state.inputs).find(
(input) => input.type === "ChatInput"
(input) => input.type === "ChatInput",
);
const outputs = useFlowStore((state) => state.outputs).filter(
(output) => output.type !== "ChatOutput"
(output) => output.type !== "ChatOutput",
);
const chatOutput = useFlowStore((state) => state.outputs).find(
(output) => output.type === "ChatOutput"
(output) => output.type === "ChatOutput",
);
const nodes = useFlowStore((state) => state.nodes).filter(
(node) =>
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 [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() {
if (!chatInput && !chatOutput) {
@ -78,7 +87,8 @@ export default function IOModal({
const currentFlow = useFlowsManagerStore((state) => state.currentFlow);
const setNode = useFlowStore((state) => state.setNode);
const [sessions, setSessions] = useState<string[]>([]);
const messages = useMessagesStore((state) => state.messages);
const setColumns = useMessagesStore((state) => state.setColumns);
async function updateVertices() {
return updateVerticesOrder(currentFlow!.id, null);
}
@ -121,22 +131,47 @@ export default function IOModal({
}
}
const { handleRemoveSession } = useRemoveSession(
setSuccessData,
setErrorData,
);
useEffect(() => {
setSelectedTab(inputs.length > 0 ? 1 : outputs.length > 0 ? 2 : 0);
}, [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(() => {
setSelectedViewField(startView());
// if (haveChat) {
// getSessions().then((sessions) => {
// setSessions(sessions);
// });
// }
if (haveChat) {
getMessagesTable("union", currentFlow!.id).then(({ rows, columns }) => {
setMessages(rows);
setColumns(columns);
});
}
}, [open]);
useEffect(() => {
const sessions = new Set<string>();
messages.forEach((row) => {
sessions.add(row.session_id);
});
setSessions(Array.from(sessions));
sessions;
}, [messages]);
return (
<BaseModal
size={selectedTab === 0 ? "sm-thin" : "md-thin"}
size={"md-thin"}
open={open}
setOpen={setOpen}
disable={disable}
@ -157,185 +192,237 @@ export default function IOModal({
<BaseModal.Content>
<div className="flex h-full flex-col ">
<div className="flex-max-width h-full">
{selectedTab !== 0 && (
<div
className={cn(
"mr-6 flex h-full w-2/6 flex-shrink-0 flex-col justify-start transition-all duration-300"
)}
<div
className={cn(
"mr-6 flex h-full w-2/6 flex-shrink-0 flex-col justify-start transition-all duration-300",
)}
>
<Tabs
value={selectedTab.toString()}
className={
"flex h-full flex-col overflow-y-auto rounded-md border bg-muted text-center custom-scroll"
}
onValueChange={(value) => {
setSelectedTab(Number(value));
}}
>
<Tabs
value={selectedTab.toString()}
className={
"flex h-full flex-col overflow-y-auto rounded-md border bg-muted text-center custom-scroll"
}
onValueChange={(value) => {
setSelectedTab(Number(value));
}}
>
<div className="api-modal-tablist-div">
<TabsList>
{inputs.length > 0 && (
<TabsTrigger value={"1"}>Inputs</TabsTrigger>
)}
{outputs.length > 0 && (
<TabsTrigger value={"2"}>Outputs</TabsTrigger>
)}
{/* {haveChat && (
<TabsTrigger value={"3"}>History</TabsTrigger>
)} */}
</TabsList>
</div>
<div className="api-modal-tablist-div">
<TabsList>
{inputs.length > 0 && (
<TabsTrigger value={"1"}>Inputs</TabsTrigger>
)}
{outputs.length > 0 && (
<TabsTrigger value={"2"}>Outputs</TabsTrigger>
)}
{haveChat && <TabsTrigger value={"0"}>History</TabsTrigger>}
</TabsList>
</div>
<TabsContent
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
.filter((node) =>
inputs.some((input) => input.id === node.id)
)
.map((node, index) => {
const input = inputs.find(
(input) => input.id === node.id
)!;
return (
<div
className="file-component-accordion-div"
key={index}
>
<AccordionComponent
trigger={
<div className="file-component-badge-div">
<ShadTooltip
content={input.id}
styleClasses="z-50"
>
<div>
<Badge variant="gray" size="md">
{node.data.node.display_name}
</Badge>
</div>
</ShadTooltip>
<div
className="-mb-1 pr-4"
onClick={(event) => {
event.stopPropagation();
setSelectedViewField(input);
}}
>
<IconComponent
className="h-4 w-4"
name="ExternalLink"
></IconComponent>
<TabsContent value={"1"} className="api-modal-tabs-content">
{nodes
.filter((node) =>
inputs.some((input) => input.id === node.id),
)
.map((node, index) => {
const input = inputs.find(
(input) => input.id === node.id,
)!;
return (
<div
className="file-component-accordion-div"
key={index}
>
<AccordionComponent
disabled={
node.data.node!.template["input_value"]?.value ===
""
}
trigger={
<div className="file-component-badge-div">
<ShadTooltip
content={input.id}
styleClasses="z-50"
>
<div>
<Badge variant="gray" size="md">
{node.data.node.display_name}
</Badge>
</div>
</div>
}
key={index}
keyValue={input.id}
>
<div className="file-component-tab-column">
<div className="">
{input && (
<IOFieldView
type={InputOutput.INPUT}
left={true}
fieldType={input.type}
fieldId={input.id}
/>
)}
</ShadTooltip>
<div
className="-mb-1 pr-4"
onClick={(event) => {
event.stopPropagation();
setSelectedViewField(input);
}}
>
<IconComponent
className="h-4 w-4"
name="ExternalLink"
></IconComponent>
</div>
</div>
</AccordionComponent>
</div>
);
})}
</TabsContent>
<TabsContent
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
.filter((node) =>
outputs.some((output) => output.id === node.id)
)
.map((node, index) => {
const output = outputs.find(
(output) => output.id === node.id
)!;
return (
<div
className="file-component-accordion-div"
}
key={index}
keyValue={input.id}
>
<AccordionComponent
disabled={
node.data.node!.template["input_value"]
?.value === ""
}
trigger={
<div className="file-component-badge-div">
<ShadTooltip
content={output.id}
styleClasses="z-50"
>
<div>
<Badge variant="gray" size="md">
{node.data.node.display_name}
</Badge>
</div>
</ShadTooltip>
<div
className="-mb-1 pr-4"
onClick={(event) => {
event.stopPropagation();
setSelectedViewField(output);
}}
>
<IconComponent
className="h-4 w-4"
name="ExternalLink"
></IconComponent>
<div className="file-component-tab-column">
<div className="">
{input && (
<IOFieldView
type={InputOutput.INPUT}
left={true}
fieldType={input.type}
fieldId={input.id}
/>
)}
</div>
</div>
</AccordionComponent>
</div>
);
})}
</TabsContent>
<TabsContent value={"2"} className="api-modal-tabs-content">
{nodes
.filter((node) =>
outputs.some((output) => output.id === node.id),
)
.map((node, index) => {
const output = outputs.find(
(output) => output.id === node.id,
)!;
return (
<div
className="file-component-accordion-div"
key={index}
>
<AccordionComponent
trigger={
<div className="file-component-badge-div">
<ShadTooltip
content={output.id}
styleClasses="z-50"
>
<div>
<Badge variant="gray" size="md">
{node.data.node.display_name}
</Badge>
</div>
</div>
}
key={index}
keyValue={output.id}
>
<div className="file-component-tab-column">
<div className="">
{output && (
<IOFieldView
type={InputOutput.OUTPUT}
left={true}
fieldType={output.type}
fieldId={output.id}
/>
)}
</ShadTooltip>
<div
className="-mb-1 pr-4"
onClick={(event) => {
event.stopPropagation();
setSelectedViewField(output);
}}
>
<IconComponent
className="h-4 w-4"
name="ExternalLink"
></IconComponent>
</div>
</div>
</AccordionComponent>
}
key={index}
keyValue={output.id}
>
<div className="file-component-tab-column">
<div className="">
{output && (
<IOFieldView
type={InputOutput.OUTPUT}
left={true}
fieldType={output.type}
fieldId={output.id}
/>
)}
</div>
</div>
</AccordionComponent>
</div>
);
})}
</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>
);
})}
</TabsContent>
</Tabs>
</div>
)}
</div>
</div>
);
})}
</TabsContent>
</Tabs>
</div>
<div className="flex h-full min-w-96 flex-grow">
{selectedViewField && (
<div
className={cn(
"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">
@ -354,15 +441,18 @@ export default function IOModal({
</div>
<div className="h-full w-full">
{inputs.some(
(input) => input.id === selectedViewField.id
) ? (
(input) => input.id === selectedViewField.id,
) && (
<IOFieldView
type={InputOutput.INPUT}
left={false}
fieldType={selectedViewField.type!}
fieldId={selectedViewField.id!}
/>
) : (
)}
{outputs.some(
(output) => output.id === selectedViewField.id,
) && (
<IOFieldView
type={InputOutput.OUTPUT}
left={false}
@ -370,13 +460,23 @@ export default function IOModal({
fieldId={selectedViewField.id!}
/>
)}
{sessions.some(
(session) => session === selectedViewField.id,
) && (
<SessionView
rows={messages.filter(
(message) =>
message.session_id === selectedViewField.id,
)}
/>
)}
</div>
</div>
)}
<div
className={cn(
"flex h-full w-full",
selectedViewField ? "hidden" : ""
selectedViewField ? "hidden" : "",
)}
>
{haveChat ? (
@ -408,7 +508,7 @@ export default function IOModal({
"h-4 w-4",
isBuilding
? "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) !== "_" &&
element.data.node.template[templateField].show &&
LANGFLOW_SUPPORTED_TYPES.has(
element.data.node.template[templateField].type
element.data.node.template[templateField].type,
) &&
templateField !== "code"
);

View file

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

View file

@ -8,14 +8,14 @@ export function getCurlRunCode(
flowId: string,
isAuth: boolean,
tweaksBuildedObject,
endpointName?: string
endpointName?: string,
): string {
const tweaksObject = tweaksBuildedObject[0];
// show the endpoint name in the curl command if it exists
return `curl -X POST \\
"${window.location.protocol}//${window.location.host}/api/v1/run/${
endpointName || flowId
}?stream=false" \\
endpointName || flowId
}?stream=false" \\
-H 'Content-Type: application/json'\\${
!isAuth ? `\n -H 'x-api-key: <your api key>'\\` : ""
}

View file

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

View file

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

View file

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

View file

@ -6,7 +6,7 @@
export default function getWidgetCode(
flowId: string,
flowName: string,
isAuth: boolean
isAuth: boolean,
): 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>

View file

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

View file

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

View file

@ -103,7 +103,7 @@ interface BaseModalProps {
React.ReactElement<ContentProps>,
React.ReactElement<HeaderProps>,
React.ReactElement<TriggerProps>?,
React.ReactElement<FooterProps>?
React.ReactElement<FooterProps>?,
];
open?: boolean;
setOpen?: (open: boolean) => void;
@ -139,16 +139,16 @@ function BaseModal({
onSubmit,
}: BaseModalProps) {
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(
(child) => (child as React.ReactElement).type === Trigger
(child) => (child as React.ReactElement).type === Trigger,
);
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(
(child) => (child as React.ReactElement).type === Footer
(child) => (child as React.ReactElement).type === Footer,
);
let { minWidth, height } = switchCaseModalSize(size);

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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