Merge remote-tracking branch 'origin/cz/mergeAll' into fix/minor_ui_adjustments

This commit is contained in:
Lucas Oliveira 2024-06-11 12:39:08 -03:00
commit 23e25cad7a
75 changed files with 1385 additions and 546 deletions

View file

@ -9,7 +9,7 @@ def build_status_from_tool(tool: Tool):
tool (Tool): The tool object to build the status for.
Returns:
str: The status string representation of the tool, including its name, description, and arguments (if any).
str: The status string representation of the tool, including its name, description, arguments (if any), and args_schema (if any).
"""
description_repr = repr(tool.description).strip("'")
args_str = "\n".join(
@ -19,5 +19,8 @@ def build_status_from_tool(tool: Tool):
if "description" in arg_data
]
)
# Include args_schema information
args_schema_str = repr(tool.args_schema) if tool.args_schema else "None"
status = f"Name: {tool.name}\nDescription: {description_repr}"
status += f"\nArgs Schema: {args_schema_str}"
return status + (f"\nArguments:\n{args_str}" if args_str else "")

View file

@ -1,10 +1,8 @@
from typing import Optional, cast
from langchain_astradb.chat_message_histories import AstraDBChatMessageHistory
from langflow.base.memory.memory import BaseMemoryComponent
from langflow.field_typing import Text
from langflow.schema import Record
from langflow.schema.schema import Record
class AstraDBMessageReaderComponent(BaseMemoryComponent):
@ -51,6 +49,14 @@ class AstraDBMessageReaderComponent(BaseMemoryComponent):
Returns:
list[Record]: A list of Record objects representing the search results.
"""
try:
from langchain_astradb.chat_message_histories import AstraDBChatMessageHistory
except ImportError:
raise ImportError(
"Could not import langchain Astra DB integration package. "
"Please install it with `pip install langchain-astradb`."
)
memory: AstraDBChatMessageHistory = cast(AstraDBChatMessageHistory, kwargs.get("memory"))
if not memory:
raise ValueError("AstraDBChatMessageHistory instance is required.")
@ -63,14 +69,14 @@ class AstraDBMessageReaderComponent(BaseMemoryComponent):
def build(
self,
session_id: Text,
session_id: str,
collection_name: str,
token: str,
api_endpoint: str,
namespace: Optional[str] = None,
) -> list[Record]:
try:
pass
from langchain_astradb.chat_message_histories import AstraDBChatMessageHistory
except ImportError:
raise ImportError(
"Could not import langchain Astra DB integration package. "

View file

@ -4,8 +4,9 @@ from langchain_astradb import AstraDBChatMessageHistory
from langchain_core.messages import BaseMessage
from langflow.base.memory.memory import BaseMemoryComponent
from langflow.field_typing import Text
from langflow.schema import Record
from langflow.schema.schema import Record
from langchain_core.messages import BaseMessage
class AstraDBMessageWriterComponent(BaseMemoryComponent):
@ -50,7 +51,7 @@ class AstraDBMessageWriterComponent(BaseMemoryComponent):
self,
sender: str,
sender_name: str,
text: Text,
text: str,
session_id: str,
metadata: Optional[dict] = None,
**kwargs,
@ -59,17 +60,27 @@ class AstraDBMessageWriterComponent(BaseMemoryComponent):
Adds a message to the AstraDBChatMessageHistory memory.
Args:
sender (Text): The type of the message sender. Valid values are "Machine" or "User".
sender_name (Text): The name of the message sender.
text (Text): The content of the message.
session_id (Text): The session ID associated with the message.
sender (str): The type of the message sender. Typically "ai" or "human".
sender_name (str): The name of the message sender.
text (str): The content of the message.
session_id (str): The session ID associated with the message.
metadata (dict | None, optional): Additional metadata for the message. Defaults to None.
**kwargs: Additional keyword arguments.
**kwargs: Additional keyword arguments, including:
memory (AstraDBChatMessageHistory | None): The memory instance to add the message to.
Raises:
ValueError: If the AstraDBChatMessageHistory instance is not provided.
"""
try:
from langchain_astradb.chat_message_histories import AstraDBChatMessageHistory
except ImportError:
raise ImportError(
"Could not import langchain Astra DB integration package. "
"Please install it with `pip install langchain-astradb`."
)
memory: AstraDBChatMessageHistory | None = kwargs.pop("memory", None)
if memory is None:
raise ValueError("AstraDBChatMessageHistory instance is required.")
@ -89,14 +100,14 @@ class AstraDBMessageWriterComponent(BaseMemoryComponent):
def build(
self,
input_value: Record,
session_id: Text,
session_id: str,
collection_name: str,
token: str,
api_endpoint: str,
namespace: Optional[str] = None,
) -> Record:
try:
pass
from langchain_astradb.chat_message_histories import AstraDBChatMessageHistory
except ImportError:
raise ImportError(
"Could not import langchain Astra DB integration package. "

View file

@ -0,0 +1,86 @@
from typing import Optional, cast
from langchain_community.chat_message_histories import CassandraChatMessageHistory
from langflow.base.memory.memory import BaseMemoryComponent
from langflow.schema.schema import Record
class CassandraMessageReaderComponent(BaseMemoryComponent):
display_name = "Cassandra Message Reader"
description = "Retrieves stored chat messages from a Cassandra table on Astra DB."
def build_config(self):
return {
"session_id": {
"display_name": "Session ID",
"info": "Session ID of the chat history.",
"input_types": ["Text"],
},
"database_id": {
"display_name": "Database ID",
"info": "The Astra database ID.",
},
"table_name": {
"display_name": "Table Name",
"info": "The name of the table where messages are stored.",
},
"token": {
"display_name": "Token",
"info": "Authentication token for accessing Cassandra on Astra DB.",
"password": True,
},
"keyspace": {
"display_name": "Keyspace",
"info": "Optional key space within Astra DB. The keyspace should already be created.",
"input_types": ["Text"],
"advanced": True,
},
}
def get_messages(self, **kwargs) -> list[Record]:
"""
Retrieves messages from the CassandraChatMessageHistory memory.
Args:
memory (CassandraChatMessageHistory): The CassandraChatMessageHistory instance to retrieve messages from.
Returns:
list[Record]: A list of Record objects representing the search results.
"""
memory: CassandraChatMessageHistory = cast(CassandraChatMessageHistory, kwargs.get("memory"))
if not memory:
raise ValueError("CassandraChatMessageHistory instance is required.")
# Get messages from the memory
messages = memory.messages
results = [Record.from_lc_message(message) for message in messages]
return list(results)
def build(
self,
session_id: str,
table_name: str,
token: str,
database_id: str,
keyspace: Optional[str] = None,
) -> list[Record]:
try:
import cassio
except ImportError:
raise ImportError(
"Could not import cassio integration package. " "Please install it with `pip install cassio`."
)
cassio.init(token=token, database_id=database_id)
memory = CassandraChatMessageHistory(
session_id=session_id,
table_name=table_name,
keyspace=keyspace,
)
records = self.get_messages(memory=memory)
self.status = records
return records

View file

@ -0,0 +1,122 @@
from typing import Optional
from langflow.base.memory.memory import BaseMemoryComponent
from langflow.schema.schema import Record
from langchain_core.messages import BaseMessage
from langchain_community.chat_message_histories import CassandraChatMessageHistory
class CassandraMessageWriterComponent(BaseMemoryComponent):
display_name = "Cassandra Message Writer"
description = "Writes a message to a Cassandra table on Astra DB."
def build_config(self):
return {
"input_value": {
"display_name": "Input Record",
"info": "Record to write to Cassandra.",
},
"session_id": {
"display_name": "Session ID",
"info": "Session ID of the chat history.",
"input_types": ["Text"],
},
"database_id": {
"display_name": "Database ID",
"info": "The Astra database ID.",
},
"table_name": {
"display_name": "Table Name",
"info": "The name of the table where messages will be stored.",
},
"token": {
"display_name": "Token",
"info": "Authentication token for accessing Cassandra on Astra DB.",
"password": True,
},
"keyspace": {
"display_name": "Keyspace",
"info": "Optional key space within Astra DB. The keyspace should already be created.",
"input_types": ["Text"],
"advanced": True,
},
"ttl_seconds": {
"display_name": "TTL Seconds",
"info": "Optional time-to-live for the messages.",
"input_types": ["Number"],
"advanced": True,
},
}
def add_message(
self,
sender: str,
sender_name: str,
text: str,
session_id: str,
metadata: Optional[dict] = None,
**kwargs,
):
"""
Adds a message to the CassandraChatMessageHistory memory.
Args:
sender (str): The type of the message sender. Typically "ai" or "human".
sender_name (str): The name of the message sender.
text (str): The content of the message.
session_id (str): The session ID associated with the message.
metadata (dict | None, optional): Additional metadata for the message. Defaults to None.
**kwargs: Additional keyword arguments, including:
memory (CassandraChatMessageHistory | None): The memory instance to add the message to.
Raises:
ValueError: If the CassandraChatMessageHistory instance is not provided.
"""
memory: CassandraChatMessageHistory | None = kwargs.pop("memory", None)
if memory is None:
raise ValueError("CassandraChatMessageHistory instance is required.")
text_list = [
BaseMessage(
content=text,
sender=sender,
sender_name=sender_name,
metadata=metadata,
session_id=session_id,
)
]
memory.add_messages(text_list)
def build(
self,
input_value: Record,
session_id: str,
table_name: str,
token: str,
database_id: str,
keyspace: Optional[str] = None,
ttl_seconds: Optional[int] = None,
) -> Record:
try:
import cassio
except ImportError:
raise ImportError(
"Could not import cassio integration package. " "Please install it with `pip install cassio`."
)
cassio.init(token=token, database_id=database_id)
memory = CassandraChatMessageHistory(
session_id=session_id,
table_name=table_name,
keyspace=keyspace,
ttl_seconds=ttl_seconds,
)
self.add_message(**input_value.data, memory=memory)
self.status = f"Added message to Cassandra memory for session {session_id}"
return input_value

View file

@ -28,7 +28,7 @@ class ChatOpenAIComponent(CustomComponent):
"model_name": {"display_name": "Model Name", "advanced": False, "options": MODEL_NAMES},
"openai_api_base": {
"display_name": "OpenAI API Base",
"advanced": False,
"advanced": True,
"required": False,
"info": (
"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\n"

View file

@ -0,0 +1,94 @@
from typing import Any, List, Optional, Tuple
from langflow.components.vectorstores.Cassandra import CassandraVectorStoreComponent
from langflow.components.vectorstores.base.model import LCVectorStoreComponent
from langflow.field_typing import Embeddings, Text
from langflow.schema import Record
from langchain_community.utilities.cassandra import SetupMode
class CassandraSearchComponent(LCVectorStoreComponent):
display_name = "Cassandra Search"
description = "Searches an existing Cassandra Vector Store."
icon = "Cassandra"
field_order = ["token", "database_id", "table_name", "input_value", "embedding"]
def build_config(self):
return {
"search_type": {
"display_name": "Search Type",
"options": ["Similarity", "MMR"],
},
"input_value": {
"display_name": "Input Value",
"info": "Input value to search",
},
"embedding": {"display_name": "Embedding", "info": "Embedding to use"},
"token": {
"display_name": "Token",
"info": "Authentication token for accessing Cassandra on Astra DB.",
"password": True,
},
"database_id": {
"display_name": "Database ID",
"info": "The Astra database ID.",
},
"table_name": {
"display_name": "Table Name",
"info": "The name of the table where vectors will be stored.",
},
"keyspace": {
"display_name": "Keyspace",
"info": "Optional key space within Astra DB. The keyspace should already be created.",
"advanced": True,
},
"body_index_options": {
"display_name": "Body Index Options",
"info": "Optional options used to create the body index.",
"advanced": True,
},
"setup_mode": {
"display_name": "Setup Mode",
"info": "Configuration mode for setting up the Cassandra table, with options like 'Sync', 'Async', or 'Off'.",
"options": ["Sync", "Async", "Off"],
"advanced": True,
},
"number_of_results": {
"display_name": "Number of Results",
"info": "Number of results to return.",
"advanced": True,
},
}
def build(
self,
embedding: Embeddings,
table_name: str,
input_value: Text,
token: str,
database_id: str,
search_type: str = "similarity",
number_of_results: int = 4,
keyspace: Optional[str] = None,
body_index_options: Optional[List[Tuple[str, Any]]] = None,
setup_mode: SetupMode = SetupMode.SYNC,
) -> List[Record]:
vector_store = CassandraVectorStoreComponent().build(
embedding=embedding,
table_name=table_name,
token=token,
database_id=database_id,
keyspace=keyspace,
body_index_options=body_index_options,
setup_mode=setup_mode,
)
try:
return self.search_with_vector_store(input_value, search_type, vector_store, k=number_of_results)
except KeyError as e:
if "content" in str(e):
raise ValueError(
"You should ingest data through Langflow (or LangChain) to query it in Langflow. Your collection does not contain a field name 'content'."
)
else:
raise e

View file

@ -1,12 +1,9 @@
from typing import List, Optional, Union
from langchain_astradb import AstraDBVectorStore
from langchain_astradb.utils.astradb import SetupMode
from langchain_core.retrievers import BaseRetriever
from langflow.custom import CustomComponent
from langflow.field_typing import Embeddings, VectorStore
from langflow.schema import Record
from langchain_core.retrievers import BaseRetriever
class AstraDBVectorStoreComponent(CustomComponent):
@ -112,6 +109,15 @@ class AstraDBVectorStoreComponent(CustomComponent):
metadata_indexing_exclude: Optional[List[str]] = None,
collection_indexing_policy: Optional[dict] = None,
) -> Union[VectorStore, BaseRetriever]:
try:
from langchain_astradb import AstraDBVectorStore
from langchain_astradb.utils.astradb import SetupMode
except ImportError:
raise ImportError(
"Could not import langchain Astra DB integration package. "
"Please install it with `pip install langchain-astradb`."
)
try:
setup_mode_value = SetupMode[setup_mode.upper()]
except KeyError:

View file

@ -0,0 +1,110 @@
from typing import Any, List, Optional, Tuple
from langchain_community.vectorstores import Cassandra
from langchain_community.utilities.cassandra import SetupMode
from langflow.custom import CustomComponent
from langflow.field_typing import Embeddings, VectorStore
from langflow.schema import Record
class CassandraVectorStoreComponent(CustomComponent):
display_name = "Cassandra"
description = "Builds or loads a Cassandra Vector Store."
icon = "Cassandra"
field_order = ["token", "database_id", "table_name", "inputs", "embedding"]
def build_config(self):
return {
"inputs": {
"display_name": "Inputs",
"info": "Optional list of records to be processed and stored in the vector store.",
},
"embedding": {"display_name": "Embedding", "info": "Embedding to use"},
"token": {
"display_name": "Token",
"info": "Authentication token for accessing Cassandra on Astra DB.",
"password": True,
},
"database_id": {
"display_name": "Database ID",
"info": "The Astra database ID.",
},
"table_name": {
"display_name": "Table Name",
"info": "The name of the table where vectors will be stored.",
},
"keyspace": {
"display_name": "Keyspace",
"info": "Optional key space within Astra DB. The keyspace should already be created.",
"advanced": True,
},
"ttl_seconds": {
"display_name": "TTL Seconds",
"info": "Optional time-to-live for the added texts.",
"advanced": True,
},
"batch_size": {
"display_name": "Batch Size",
"info": "Optional number of records to process in a single batch.",
"advanced": True,
},
"body_index_options": {
"display_name": "Body Index Options",
"info": "Optional options used to create the body index.",
"advanced": True,
},
"setup_mode": {
"display_name": "Setup Mode",
"info": "Configuration mode for setting up the Cassandra table, with options like 'Sync', 'Async', or 'Off'.",
"options": ["Sync", "Async", "Off"],
"advanced": True,
},
}
def build(
self,
embedding: Embeddings,
token: str,
database_id: str,
inputs: Optional[List[Record]] = None,
keyspace: Optional[str] = None,
table_name: str = "",
ttl_seconds: Optional[int] = None,
batch_size: int = 16,
body_index_options: Optional[List[Tuple[str, Any]]] = None,
setup_mode: SetupMode = SetupMode.SYNC,
) -> VectorStore:
try:
import cassio
except ImportError:
raise ImportError(
"Could not import cassio integration package. " "Please install it with `pip install cassio`."
)
cassio.init(
database_id=database_id,
token=token,
)
if inputs:
documents = [_input.to_lc_document() for _input in inputs]
table = Cassandra.from_documents(
documents=documents,
embedding=embedding,
table_name=table_name,
keyspace=keyspace,
ttl_seconds=ttl_seconds,
batch_size=batch_size,
body_index_options=body_index_options,
)
else:
table = Cassandra(
embedding=embedding,
table_name=table_name,
keyspace=keyspace,
ttl_seconds=ttl_seconds,
body_index_options=body_index_options,
setup_mode=setup_mode,
)
return table

View file

@ -1,6 +1,6 @@
from datetime import datetime
from pathlib import Path
from typing import TYPE_CHECKING, Optional, Union
from typing import TYPE_CHECKING, Optional, Union, List
import duckdb
from loguru import logger
@ -107,12 +107,21 @@ class MonitorService(Service):
return self.exec_query(query)
def delete_messages(self, message_ids: list[int]):
query = f"DELETE FROM messages WHERE index IN ({','.join(map(str, message_ids))})"
def delete_messages(self, message_ids: Union[List[int], str]):
if isinstance(message_ids, list):
# If message_ids is a list, join the string representations of the integers
ids_str = ','.join(map(str, message_ids))
elif isinstance(message_ids, str):
# If message_ids is already a string, use it directly
ids_str = message_ids
else:
raise ValueError("message_ids must be a list of integers or a string")
query = f"DELETE FROM messages WHERE index IN ({ids_str})"
return self.exec_query(query)
def update_message(self, message_id: int, **kwargs):
def update_message(self, message_id: str, **kwargs):
query = (
f"""UPDATE messages SET {', '.join(f"{k} = '{v}'" for k, v in kwargs.items())} WHERE index = {message_id}"""
)

View file

@ -64,7 +64,7 @@
"react-icons": "^5.0.1",
"react-laag": "^2.0.5",
"react-markdown": "^8.0.7",
"react-pdf": "^7.7.1",
"react-pdf": "^9.0.0",
"react-router-dom": "^6.15.0",
"react-syntax-highlighter": "^15.5.0",
"react18-json-view": "^0.2.3",
@ -481,6 +481,7 @@
},
"node_modules/@clack/prompts/node_modules/is-unicode-supported": {
"version": "1.3.0",
"extraneous": true,
"inBundle": true,
"license": "MIT",
"engines": {
@ -10238,25 +10239,25 @@
"node": ">=8"
}
},
"node_modules/path2d-polyfill": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path2d-polyfill/-/path2d-polyfill-2.0.1.tgz",
"integrity": "sha512-ad/3bsalbbWhmBo0D6FZ4RNMwsLsPpL6gnvhuSaU5Vm7b06Kr5ubSltQQ0T7YKsiJQO+g22zJ4dJKNTXIyOXtA==",
"node_modules/path2d": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/path2d/-/path2d-0.2.0.tgz",
"integrity": "sha512-KdPAykQX6kmLSOO6Jpu2KNcCED7CKjmaBNGGNuctOsG0hgYO1OdYQaan6cYXJiG0WmXOwZZPILPBimu5QAIw3A==",
"optional": true,
"engines": {
"node": ">=8"
"node": ">=6"
}
},
"node_modules/pdfjs-dist": {
"version": "3.11.174",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-3.11.174.tgz",
"integrity": "sha512-TdTZPf1trZ8/UFu5Cx/GXB7GZM30LT+wWUNfsi6Bq8ePLnb+woNKtDymI2mxZYBpMbonNFqKmiz684DIfnd8dA==",
"version": "4.3.136",
"resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-4.3.136.tgz",
"integrity": "sha512-gzfnt1qc4yA+U46golPGYtU4WM2ssqP2MvFjKga8GEKOrEnzRPrA/9jogLLPYHiA3sGBPJ+p7BdAq+ytmw3jEg==",
"engines": {
"node": ">=18"
},
"optionalDependencies": {
"canvas": "^2.11.2",
"path2d-polyfill": "^2.0.1"
"path2d": "^0.2.0"
}
},
"node_modules/peek-readable": {
@ -11094,17 +11095,16 @@
"integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="
},
"node_modules/react-pdf": {
"version": "7.7.3",
"resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-7.7.3.tgz",
"integrity": "sha512-a2VfDl8hiGjugpqezBTUzJHYLNB7IS7a2t7GD52xMI9xHg8LdVaTMsnM9ZlNmKadnStT/tvX5IfV0yLn+JvYmw==",
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/react-pdf/-/react-pdf-9.0.0.tgz",
"integrity": "sha512-J+pza8R2p9oNEOJOHIQJI4o5rFK7ji7bBl2IvsHvz1OOyphvuzVDo5tOJwWAFAbxYauCH3Kt8jOvcMJUOpxYZQ==",
"dependencies": {
"clsx": "^2.0.0",
"dequal": "^2.0.3",
"make-cancellable-promise": "^1.3.1",
"make-event-props": "^1.6.0",
"merge-refs": "^1.2.1",
"pdfjs-dist": "3.11.174",
"prop-types": "^15.6.2",
"merge-refs": "^1.3.0",
"pdfjs-dist": "4.3.136",
"tiny-invariant": "^1.0.0",
"warning": "^4.0.0"
},
@ -11112,9 +11112,9 @@
"url": "https://github.com/wojtekmaj/react-pdf?sponsor=1"
},
"peerDependencies": {
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
"@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
"@types/react": {

View file

@ -59,7 +59,7 @@
"react-icons": "^5.0.1",
"react-laag": "^2.0.5",
"react-markdown": "^8.0.7",
"react-pdf": "^7.7.1",
"react-pdf": "^9.0.0",
"react-router-dom": "^6.15.0",
"react-syntax-highlighter": "^15.5.0",
"react18-json-view": "^0.2.3",

View file

@ -39,7 +39,11 @@ import {
scapedJSONStringfy,
} from "../../../../utils/reactflowUtils";
import { nodeColors } from "../../../../utils/styleUtils";
import { classNames, groupByFamily } from "../../../../utils/utils";
import {
classNames,
groupByFamily,
isThereModal,
} from "../../../../utils/utils";
import useFetchDataOnMount from "../../../hooks/use-fetch-data-on-mount";
import useHandleOnNewValue from "../../../hooks/use-handle-new-value";
import useHandleNodeClass from "../../../hooks/use-handle-node-class";
@ -47,6 +51,8 @@ import useHandleRefreshButtonPress from "../../../hooks/use-handle-refresh-butto
import TooltipRenderComponent from "../tooltipRenderComponent";
import { TEXT_FIELD_TYPES } from "./constants";
import OutputModal from "../outputModal";
import { useShortcutsStore } from "../../../../stores/shortcuts";
import { useHotkeys } from "react-hotkeys-hook";
export default function ParameterComponent({
left,
@ -63,6 +69,7 @@ export default function ParameterComponent({
proxy,
showNode,
index = "",
selected,
}: ParameterComponentType): JSX.Element {
const ref = useRef<HTMLDivElement>(null);
const refHtml = useRef<HTMLDivElement & ReactNode>(null);
@ -92,6 +99,19 @@ export default function ParameterComponent({
"unknown"
);
const preventDefault = true;
function handleOutputWShortcut() {
if (!displayOutputPreview || unknownOutput) return;
if (isThereModal() && !openOutputModal) return;
if (selected && !left) {
setOpenOutputModal((state) => !state);
}
}
const output = useShortcutsStore((state) => state.output);
useHotkeys(output, handleOutputWShortcut, { preventDefault });
const { handleOnNewValue: handleOnNewValueHook } = useHandleOnNewValue(
data,
name,

View file

@ -38,6 +38,7 @@ import useValidationStatusString from "../hooks/use-validation-status-string";
import getFieldTitle from "../utils/get-field-title";
import sortFields from "../utils/sort-fields";
import ParameterComponent from "./components/parameterComponent";
import { useHotkeys } from "react-hotkeys-hook";
export default function GenericNode({
data,
@ -49,6 +50,7 @@ export default function GenericNode({
xPos?: number;
yPos?: number;
}): JSX.Element {
const preventDefault = true;
const types = useTypesStore((state) => state.types);
const templates = useTypesStore((state) => state.templates);
const deleteNode = useFlowStore((state) => state.deleteNode);
@ -232,6 +234,25 @@ export default function GenericNode({
}
};
function handleUpdateCodeWShortcut() {
if (isOutdated && selected) {
handleUpdateCode();
}
}
function handlePlayWShortcut() {
if (buildStatus === BuildStatus.BUILDING || isBuilding || !selected) return;
setValidationStatus(null);
console.log(data.node?.display_name);
buildFlow({ stopNodeId: data.id });
}
const update = useShortcutsStore((state) => state.update);
const play = useShortcutsStore((state) => state.play);
useHotkeys(update, handleUpdateCodeWShortcut, { preventDefault });
useHotkeys(play, handlePlayWShortcut, { preventDefault });
const shortcuts = useShortcutsStore((state) => state.shortcuts);
const memoizedNodeToolbarComponent = useMemo(() => {
@ -393,6 +414,7 @@ export default function GenericNode({
data.node!.template[templateField].show &&
!data.node!.template[templateField].advanced && (
<ParameterComponent
selected={selected}
index={idx.toString()}
key={scapedJSONStringfy({
inputTypes:
@ -466,6 +488,7 @@ export default function GenericNode({
),
)}
<ParameterComponent
selected={selected}
key={scapedJSONStringfy({
baseClasses: data.node!.base_classes,
id: data.id,
@ -650,6 +673,7 @@ export default function GenericNode({
{data.node!.template[templateField].show &&
!data.node!.template[templateField].advanced ? (
<ParameterComponent
selected={selected}
index={idx.toString()}
key={scapedJSONStringfy({
inputTypes:
@ -729,6 +753,7 @@ export default function GenericNode({
</div>
{data.node!.base_classes.length > 0 && (
<ParameterComponent
selected={selected}
key={scapedJSONStringfy({
baseClasses: data.node!.base_classes,
id: data.id,

View file

@ -12,35 +12,35 @@ export default function RenderIcons({
shortcutWPlus: string[];
}): JSX.Element {
return hasShift ? (
<>
<span className="flex gap-0.5 text-xs">
{isMac ? (
<ForwardedIconComponent name="Command" className="h-4 w-4" />
<ForwardedIconComponent name="Command" className="h-3 w-3" />
) : (
filteredShortcut[0]
)}
<ForwardedIconComponent name="ArrowBigUp" className="ml-1 h-5 w-5" />
<ForwardedIconComponent name="ArrowBigUp" className=" h-4 w-4" />
{filteredShortcut.map((key, idx) => {
if (idx > 0) {
return <span className="ml-1"> {key.toUpperCase()} </span>;
return <span className=""> {key.toUpperCase()} </span>;
}
})}
</>
</span>
) : (
<>
<span className="flex gap-1 text-xs">
{shortcutWPlus[0].toLowerCase() === "space" ? (
"Space"
) : shortcutWPlus[0].length <= 1 ? (
shortcutWPlus[0]
) : isMac ? (
<ForwardedIconComponent name="Command" className="h-4 w-4" />
<ForwardedIconComponent name="Command" className="h-3 w-3" />
) : (
shortcutWPlus[0]
)}
{shortcutWPlus.map((key, idx) => {
if (idx > 0) {
return <span className="ml-0.5"> {key.toUpperCase()} </span>;
return <span className=""> {key.toUpperCase()} </span>;
}
})}
</>
</span>
);
}

View file

@ -758,7 +758,7 @@ export const defaultShortcuts = [
shortcut: `${IS_MAC ? "Cmd" : "Ctrl"} + D`,
},
{
name: "Share",
name: "Component Share",
shortcut: `${IS_MAC ? "Cmd" : "Ctrl"} + Shift + S`,
},
{
@ -799,7 +799,7 @@ export const defaultShortcuts = [
},
{
name: "API",
shortcut: `${IS_MAC ? "Cmd" : "Ctrl"} + R`,
shortcut: `R`,
},
{
name: "Download",
@ -817,6 +817,14 @@ export const defaultShortcuts = [
name: "Flow Share",
shortcut: `${IS_MAC ? "Cmd" : "Ctrl"} + B`,
},
{
name: "Play",
shortcut: `P`,
},
{
name: "Output Inspection",
shortcut: `O`,
},
];
export const DEFAULT_TABLE_ALERT_MSG = `Oops! It seems there's no data to display right now. Please check back later.`;

View file

@ -0,0 +1,73 @@
const CassandraSVG = (props) => (
<svg
width="24"
height="24"
viewBox="0 -43.5 256 256"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<g fill="#373535">
<path d="M30.9 142.2c2.2 0 4.2.5 5.3 1.5.2 1.6-1.3 4.2-2.2 4.2-1.1-.4-2.1-.6-3.4-.6-5.2 0-7.8 5.4-7.8 10.7 0 3.3 1.1 5.3 3.8 5.3 2.8 0 5.6-1.9 7.2-3.3.4.3.9 1.2.9 2.2 0 1.1-.3 2.2-1.4 3.3-1.8 1.8-4.9 3.4-9.4 3.4-5.1 0-8.7-2.9-8.7-9.7.2-9 6-17 15.7-17ZM47.7 163c2.8 0 7.9-4.9 9.3-14.3.1-.6.1-.7.2-1.3-.6-.2-1.5-.4-2.3-.4-2.1 0-4.3.6-6.2 3.3-2 2.8-2.9 6.3-2.9 9.1 0 2.3.7 3.6 1.9 3.6Zm-9.2-2.6c0-3.4 1.1-9.2 5.4-13.5 3.7-3.8 8.1-4.7 12.2-4.7 2.7 0 6.3.9 8.6 1.3-.6 2.5-1.9 12-2.6 17.5-.3 2.3-.4 5.6-.3 6.8-1.9.8-5.4 1-6.4 1-.5 0-.6-2.3-.5-4.6.1-.7.2-1.8.2-2.3-2.2 3.7-6.6 6.8-11.2 6.8-3.3.1-5.4-2.7-5.4-8.3ZM78.9 142.2c2.3 0 4.6.9 5.6 1.9-.1 1.6-1.3 4.3-3.3 3.5-.9-.3-1.7-.5-2.9-.5-1.5 0-2.9.7-2.9 2.1 0 1.1.8 1.9 4.6 4.6 2.7 2 3.8 3.8 3.8 6.3 0 4.2-3.9 8.7-10.8 8.7-2.8 0-5.3-1.1-6-2.2-1-1.7-.2-5.1.9-4.5 1.5.7 3.9 1.5 5.9 1.5 1.9 0 3.1-.9 3.1-2 0-1-.9-1.8-4.3-4.3-2.9-2.2-3.8-4.2-3.8-6.4 0-4.8 4.1-8.7 10.1-8.7ZM98.6 142.2c2.3 0 4.6.9 5.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17-.3-36.8 6.5-51.6 12.8-1.5 4.4-2.4 9.1-2.4 14 0 26 23.5 47.1 52.5 47.1s52.6-21 52.6-47.1c0-8.2-2.4-16-6.5-22.7-11.8-1.8-28.1-3.8-44.6-4.1"
/>
<path
fill="#FFF"
d="M121.4 15.2c-9.4-.6-25.6 4.3-39.1 9.2-2.1 4.8-3.2 10.1-3.2 15.7 0 22.8 20.7 41.3 42.5 41.3 21.7 0 40.9-18.5 42.5-41.3.5-7.4-2-14.4-5.6-20.4-13.9-2.4-28.7-3.9-37.1-4.5"
/>
<path
fill="#373535"
d="M97.3 37.2c1.2-2.6 2.9-3.8 4.6-5.9-.2-.5-.6-2.2-.6-2.7 0-2.6 2.1-4.6 4.6-4.6.6 0 1.2.1 1.7.3 7.7-5.9 17.8-8.4 28-6.1.9.2 1.8.5 2.7.7-10-1.4-21.4 2.2-29.1 8.4.2.6.9 2.1.9 2.8 0 2.6-1.7 3.2-4.2 3.2-.6 0-1.1-.1-1.7-.3-1.7 2.3-3.9 6.8-4.9 9.6 4.3 3.8 8.1 5.2 13.1 7.1 0-.2.2-.5.2-.7 0-7.7 6.8-14 14.5-14 6.9 0 12.7 5 13.8 11.6 3.5-2.2 6.8-3.9 9.3-7.1-.6-.7-1.2-2.8-1.2-3.8 0-2.3 1.9-4.2 4.2-4.2.3 0 .6 0 1 .1 1.3-2.7 2.3-5.5 2.9-8.4-12.1-9-35.5-7.7-35.5-7.7s-18.6-1-31.2 5.2c.9 5.8 3.3 11.6 6.9 16.5"
/>
<path
fill="#373535"
d="M155.1 33.7c.9.8 1.3 1.4 1.7 2.1 1.1 2-1.1 3.9-3.5 3.9-.2 0-.5 0-.7-.1-2.6 4.1-7.2 9.3-11.3 12 6.3 1 12.2 3.5 16.8 7.4 3.4-6.1 6-15 6-22.5 0-5.7-2.5-9.9-6.3-13-.1 3.1-1.8 7.4-2.7 10.2M104.3 72.5c2.1-5.8 7.2-10.2 12.1-14.1-.7-1-1.8-3.4-2.2-4.5-5.9-1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
<path
fill="#373535"
fill-opacity=".35"
d="M2.8 76.5C42.9 36.4 74.9 24 104 18.4c3.8-.7 4.6-9.2 4.6-9.2s.5 6.2 3.2 7c2.7.8 6.2-9.7 6.2-9.7s-3.2 9.4 0 10c3.2.5 9.2-9.2 9.2-9.2s-2.4 8.3-.8 8.9c1.6.5 9.7-12.1 9.7-12.1s-4.8 8.3-.3 9.2c4.6.8 11.3-5.7 11.3-5.7s-5.2 5.9-2.9 6.8c10 3.5 18-9.4 18-9.4s-1.9 5.7-6.7 11.9c10.5 2.7 18.3-13.1 18.3-13.1L166 19.6c4 2 20.1-16.6 20.1-16.6s-8.3 14.5-13.2 17.5c2.7 2.2 12.4-6.5 12.4-6.5s-7.8 9.7-4.8 10.2c4.3 3.5 20.2-18 20.2-18s-6.2 12.7-15.3 22.6C193 32.7 212 8.2 212 8.2s-.5 7.8-14.3 20.2c10.2-1.3 23.4-20.7 23.4-20.7s-4.8 14.5-16.4 24.8c10-1 26.1-25.8 26.1-25.8s-6.2 17.2-18.8 27.2c14 3.1 34.2-17.8 34.2-17.8s-7.9 14.8-18.3 20.9c11.6 4.4 27.5-13.9 27.5-13.9s-15.9 24.5-41.2 23.4c-8.3-.4-33.4-25.2-87.2-23.2C55.8 25.9 40.8 56.1 2.8 76.5"
/>
<path
fill="#373535"
d="M4.4 73.5C44.5 33.4 76.5 21 105.6 15.4c3.8-.7 4.6-9.2 4.6-9.2s.5 6.2 3.2 7c2.7.8 6.2-9.7 6.2-9.7s-3.2 9.4 0 10c3.2.5 9.2-9.2 9.2-9.2s-2.4 8.3-.8 8.9c1.6.5 9.7-12.1 9.7-12.1s-4.8 8.3-.3 9.2c4.6.8 11.3-5.7 11.3-5.7s-5.2 5.9-2.9 6.8c10 3.5 18-9.4 18-9.4s-1.9 5.7-6.7 11.9C167.6 16.6 175.4.8 175.4.8l-7.8 15.8c4 2.2 20.2-16.4 20.2-16.4s-8.3 14.5-13.2 17.5C177.3 19.6 187 11 187 11s-7.8 9.7-4.8 10.2c4.3 3.5 20.2-18 20.2-18s-6.3 12.7-15.4 22.6c7.6 3.8 26.7-20.7 26.7-20.7s-.5 7.8-14.3 20.2c10.2-1.3 23.4-20.7 23.4-20.7s-4.8 14.5-16.4 24.8c10-1 26.1-25.8 26.1-25.8s-6.2 17.2-18.8 27.2c14 3.1 34.2-17.8 34.2-17.8s-7.9 14.8-18.3 20.9c11.6 4.4 27.5-13.9 27.5-13.9s-15.9 24.5-41.2 23.4c-8.3-.4-33.4-25.2-87.2-23.2C57.5 22.9 42.4 53 4.4 73.5"
/>
<path
fill="#373535"
fill-opacity=".35"
d="M1.8 80.9c21.2 10.6 40.6-1.6 65 5.3 18.6 5.2 41.2 11.7 71.9 7.2 30.7-4.4 56.9-17.8 69.5-41.6 3.9-10.6 19.8 2.4 19.8 2.4s-11.6-4.8-11.3-2.6c.3 2.3 17.4 10.2 17.4 10.2s-15.5-4.8-14.5-1.2c.9 3.6 19.4 18.2 19.4 18.2S217.9 63 216.2 65.2c-1.8 2.2 8.9 10.9 8.9 10.9s-17.6-10.9-23.8-7.7c-4.5 2.3 18.3 17.2 18.3 17.2s-14.8-11.3-18.3-8.3 16.7 27.2 16.7 27.2-23-24.8-25.3-23.6C190.4 82.1 199 94 199 94s-11.2-12.4-14.3-10.3c-3.1 2.2 16.2 34.3 16.2 34.3S180 85.1 171.3 90.6c13.5 29.7 8.5 33.9 8.5 33.9s-1.7-30.3-18.6-29.5c-8.5.4 4 22.6 4 22.6S153.7 97.3 146 97.7c14.1 26.8 9.1 37.6 9.1 37.6s2.3-22.9-16.8-35.6c7.3 6.5-4.6 35.6-4.6 35.6s10.4-42.9-7.7-34.7c-2.9 1.3-.2 21.4-.2 21.4s-3.6-23-9.1-21.8c-3.2.7-20.2 31.9-20.2 31.9s13.9-33.7 9.7-32.3c-3.1 1-8.9 14.9-8.9 14.9s2.8-13.7 0-14.5c-2.8-.8-18.6 14.5-18.6 14.5s11.7-13.7 9.7-16.6c-3.1-4.3-6.6-4.5-10.9-2.8C71.3 97.7 63 109 63 109s8.3-11.5 6.9-15.7c-2.3-6.9-26.2 13.3-26.2 13.3s14.1-13.3 10.9-16.2c-3.2-2.8-20.8-2-26.2-2-16.1.2-21.7-3.6-26.6-7.5"
/>
<path
fill="#373535"
d="M.9 78.5c21.2 10.6 40.6-1.6 65 5.3 18.6 5.2 41.2 11.7 71.9 7.2 30.7-4.4 56.9-17.8 69.5-41.6 3.9-10.6 19.8 2.4 19.8 2.4s-11.6-4.8-11.3-2.6c.3 2.3 17.4 10.2 17.4 10.2s-15.5-4.8-14.5-1.2c.9 3.6 19.4 18.2 19.4 18.2s-20.9-15.9-22.6-13.7c-1.7 2.2 8.9 10.9 8.9 10.9s-17.6-10.9-23.8-7.7c-4.5 2.3 18.3 17.2 18.3 17.2s-14.8-11.3-18.3-8.3 16.7 27.2 16.7 27.2-22.9-24.8-25.2-23.6c-2.3 1.2 6.3 13.1 6.3 13.1S187 79.2 183.9 81.3c-3.1 2.2 16.1 34.3 16.1 34.3s-20.9-33-29.5-27.5c13.6 29.8 8.5 34 8.5 34s-1.7-30.3-18.6-29.5c-8.5.4 4 22.6 4 22.6S153 95 145.3 95.4c14.1 26.8 9.1 37.6 9.1 37.6s2.3-22.9-16.8-35.6c7.3 6.5-4.6 35.6-4.6 35.6s10.4-42.9-7.7-34.7c-2.9 1.3-.2 21.4-.2 21.4s-3.6-23-9.1-21.8c-3.2.7-20.2 31.9-20.2 31.9s13.9-33.7 9.7-32.3c-3.1 1-8.9 14.9-8.9 14.9s2.8-13.7 0-14.5c-2.8-.8-18.6 14.5-18.6 14.5s11.7-13.7 9.7-16.6c-3.1-4.3-6.6-4.5-10.9-2.8-6.2 2.4-14.5 13.7-14.5 13.7s8.3-11.5 6.9-15.7C66.9 84.1 43 104.3 43 104.3S57.1 91 53.9 88.1c-3.2-2.8-20.8-2-26.2-2-16.3.1-21.9-3.7-26.8-7.6"
/>
</svg>
);
export default CassandraSVG;

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" preserveAspectRatio="xMidYMid" viewBox="0 -43.5 256 256">
<g fill="#373535">
<path
d="M30.9 142.2c2.2 0 4.2.5 5.3 1.5.2 1.6-1.3 4.2-2.2 4.2-1.1-.4-2.1-.6-3.4-.6-5.2 0-7.8 5.4-7.8 10.7 0 3.3 1.1 5.3 3.8 5.3 2.8 0 5.6-1.9 7.2-3.3.4.3.9 1.2.9 2.2 0 1.1-.3 2.2-1.4 3.3-1.8 1.8-4.9 3.4-9.4 3.4-5.1 0-8.7-2.9-8.7-9.7.2-9 6-17 15.7-17ZM47.7 163c2.8 0 7.9-4.9 9.3-14.3.1-.6.1-.7.2-1.3-.6-.2-1.5-.4-2.3-.4-2.1 0-4.3.6-6.2 3.3-2 2.8-2.9 6.3-2.9 9.1 0 2.3.7 3.6 1.9 3.6Zm-9.2-2.6c0-3.4 1.1-9.2 5.4-13.5 3.7-3.8 8.1-4.7 12.2-4.7 2.7 0 6.3.9 8.6 1.3-.6 2.5-1.9 12-2.6 17.5-.3 2.3-.4 5.6-.3 6.8-1.9.8-5.4 1-6.4 1-.5 0-.6-2.3-.5-4.6.1-.7.2-1.8.2-2.3-2.2 3.7-6.6 6.8-11.2 6.8-3.3.1-5.4-2.7-5.4-8.3ZM78.9 142.2c2.3 0 4.6.9 5.6 1.9-.1 1.6-1.3 4.3-3.3 3.5-.9-.3-1.7-.5-2.9-.5-1.5 0-2.9.7-2.9 2.1 0 1.1.8 1.9 4.6 4.6 2.7 2 3.8 3.8 3.8 6.3 0 4.2-3.9 8.7-10.8 8.7-2.8 0-5.3-1.1-6-2.2-1-1.7-.2-5.1.9-4.5 1.5.7 3.9 1.5 5.9 1.5 1.9 0 3.1-.9 3.1-2 0-1-.9-1.8-4.3-4.3-2.9-2.2-3.8-4.2-3.8-6.4 0-4.8 4.1-8.7 10.1-8.7ZM98.6 142.2c2.3 0 4.6.9 5.6 1.9-.1 1.6-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12.8-1.5 4.4-2.4 9.1-2.4 14 0 26 23.5 47.1 52.5 47.1s52.6-21 52.6-47.1c0-8.2-2.4-16-6.5-22.7-11.8-1.8-28.1-3.8-44.6-4.1" />
<path fill="#FFF"
d="M121.4 15.2c-9.4-.6-25.6 4.3-39.1 9.2-2.1 4.8-3.2 10.1-3.2 15.7 0 22.8 20.7 41.3 42.5 41.3 21.7 0 40.9-18.5 42.5-41.3.5-7.4-2-14.4-5.6-20.4-13.9-2.4-28.7-3.9-37.1-4.5" />
<path fill="#373535"
d="M97.3 37.2c1.2-2.6 2.9-3.8 4.6-5.9-.2-.5-.6-2.2-.6-2.7 0-2.6 2.1-4.6 4.6-4.6.6 0 1.2.1 1.7.3 7.7-5.9 17.8-8.4 28-6.1.9.2 1.8.5 2.7.7-10-1.4-21.4 2.2-29.1 8.4.2.6.9 2.1.9 2.8 0 2.6-1.7 3.2-4.2 3.2-.6 0-1.1-.1-1.7-.3-1.7 2.3-3.9 6.8-4.9 9.6 4.3 3.8 8.1 5.2 13.1 7.1 0-.2.2-.5.2-.7 0-7.7 6.8-14 14.5-14 6.9 0 12.7 5 13.8 11.6 3.5-2.2 6.8-3.9 9.3-7.1-.6-.7-1.2-2.8-1.2-3.8 0-2.3 1.9-4.2 4.2-4.2.3 0 .6 0 1 .1 1.3-2.7 2.3-5.5 2.9-8.4-12.1-9-35.5-7.7-35.5-7.7s-18.6-1-31.2 5.2c.9 5.8 3.3 11.6 6.9 16.5" />
<path fill="#373535"
d="M155.1 33.7c.9.8 1.3 1.4 1.7 2.1 1.1 2-1.1 3.9-3.5 3.9-.2 0-.5 0-.7-.1-2.6 4.1-7.2 9.3-11.3 12 6.3 1 12.2 3.5 16.8 7.4 3.4-6.1 6-15 6-22.5 0-5.7-2.5-9.9-6.3-13-.1 3.1-1.8 7.4-2.7 10.2M104.3 72.5c2.1-5.8 7.2-10.2 12.1-14.1-.7-1-1.8-3.4-2.2-4.5-5.9-1.8-11.1-5.2-15.2-9.6 0 .1-.1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.1 7.6-10.2 10.2 6 .9 11.7 3.5 16.4 7.4 3.4-6.1 5.4-13.2 5.4-20.7 0-5.7-2.5-9.9-6.3-13-.2 3.1-.8 6.1-1.8 8.9M104.9 73.8c2.1-5.8 5.7-10.9 10.6-14.8-.7-1-1.3-2-1.7-3.2-5.9-1.8-11.1-5.2-15.2-9.6 0 .1-.1.3-.1.4-.8 3.4-.9 6.9-.5 10.2 2.8.5 5 3 5 6 0 1.8-.8 3.4-2 4.5 1 2.3 2.4 4.5 3.9 6.5" />
<path fill="#1287B1"
d="M103.9 77.2c-2.5-2.5-4.6-5.3-6.2-8.4-.3 0-.6.1-.9.1-3.4 0-6.1-2.7-6.1-6.1 0-2.4 1.4-4.5 3.4-5.5-.5-3.8-.3-7.6.6-11.5.2-1.1.6-2.2.9-3.3-3.7-5.4-5.9-12-5.9-19.1v-.8c-6.3 3.2-11 8.1-11 15.9 0 17.3 10.3 32.2 25.1 38.8.1 0 .1 0 .1-.1M140 55.4c-1.9 5.4-7.1 9.4-13.2 9.4-3.3 0-6.3-1.1-8.6-3-4.9 3.8-8.6 9-10.9 14.9 1 1.1 2.1 2.1 3.2 3.1 3.4.9 7 1.4 10.7 1.4 14.9 0 28.1-7.7 35.7-19.4-5-3.6-10.9-5.9-16.9-6.4" />
<path fill="#FFF"
d="m140.5 51.8 12.9-3.1-13-.7 10.6-8-12 4.3 8.1-11.3-11.3 7.5 3.9-13.2-7.7 10.9-.2-13.8-5.1 12.3-4.2-12.4.2 14.6-7.3-13.1 4 13.9-11.9-8.6 9.3 11.7-14.8-5.4 11.6 8.6-14.9.5 15.3 3.9-15.3 3.3 15.1 1.1-12.7 8.1 13.1-4.7-9.1 11.5 11.5-9.3-4.1 15.4 8.9-12.6-1.2 14.8 5-13.5 4.3 14.1 1-14.2 6.4 12.1-3.8-13.8 11.6 9-7.5-11.5 12.8 5-9.8-9.6 13.1 1-12.8-4.8Z" />
<path fill="#373535" fill-opacity=".35"
d="M2.8 76.5C42.9 36.4 74.9 24 104 18.4c3.8-.7 4.6-9.2 4.6-9.2s.5 6.2 3.2 7c2.7.8 6.2-9.7 6.2-9.7s-3.2 9.4 0 10c3.2.5 9.2-9.2 9.2-9.2s-2.4 8.3-.8 8.9c1.6.5 9.7-12.1 9.7-12.1s-4.8 8.3-.3 9.2c4.6.8 11.3-5.7 11.3-5.7s-5.2 5.9-2.9 6.8c10 3.5 18-9.4 18-9.4s-1.9 5.7-6.7 11.9c10.5 2.7 18.3-13.1 18.3-13.1L166 19.6c4 2 20.1-16.6 20.1-16.6s-8.3 14.5-13.2 17.5c2.7 2.2 12.4-6.5 12.4-6.5s-7.8 9.7-4.8 10.2c4.3 3.5 20.2-18 20.2-18s-6.2 12.7-15.3 22.6C193 32.7 212 8.2 212 8.2s-.5 7.8-14.3 20.2c10.2-1.3 23.4-20.7 23.4-20.7s-4.8 14.5-16.4 24.8c10-1 26.1-25.8 26.1-25.8s-6.2 17.2-18.8 27.2c14 3.1 34.2-17.8 34.2-17.8s-7.9 14.8-18.3 20.9c11.6 4.4 27.5-13.9 27.5-13.9s-15.9 24.5-41.2 23.4c-8.3-.4-33.4-25.2-87.2-23.2C55.8 25.9 40.8 56.1 2.8 76.5" />
<path fill="#373535"
d="M4.4 73.5C44.5 33.4 76.5 21 105.6 15.4c3.8-.7 4.6-9.2 4.6-9.2s.5 6.2 3.2 7c2.7.8 6.2-9.7 6.2-9.7s-3.2 9.4 0 10c3.2.5 9.2-9.2 9.2-9.2s-2.4 8.3-.8 8.9c1.6.5 9.7-12.1 9.7-12.1s-4.8 8.3-.3 9.2c4.6.8 11.3-5.7 11.3-5.7s-5.2 5.9-2.9 6.8c10 3.5 18-9.4 18-9.4s-1.9 5.7-6.7 11.9C167.6 16.6 175.4.8 175.4.8l-7.8 15.8c4 2.2 20.2-16.4 20.2-16.4s-8.3 14.5-13.2 17.5C177.3 19.6 187 11 187 11s-7.8 9.7-4.8 10.2c4.3 3.5 20.2-18 20.2-18s-6.3 12.7-15.4 22.6c7.6 3.8 26.7-20.7 26.7-20.7s-.5 7.8-14.3 20.2c10.2-1.3 23.4-20.7 23.4-20.7s-4.8 14.5-16.4 24.8c10-1 26.1-25.8 26.1-25.8s-6.2 17.2-18.8 27.2c14 3.1 34.2-17.8 34.2-17.8s-7.9 14.8-18.3 20.9c11.6 4.4 27.5-13.9 27.5-13.9s-15.9 24.5-41.2 23.4c-8.3-.4-33.4-25.2-87.2-23.2C57.5 22.9 42.4 53 4.4 73.5" />
<path fill="#373535" fill-opacity=".35"
d="M1.8 80.9c21.2 10.6 40.6-1.6 65 5.3 18.6 5.2 41.2 11.7 71.9 7.2 30.7-4.4 56.9-17.8 69.5-41.6 3.9-10.6 19.8 2.4 19.8 2.4s-11.6-4.8-11.3-2.6c.3 2.3 17.4 10.2 17.4 10.2s-15.5-4.8-14.5-1.2c.9 3.6 19.4 18.2 19.4 18.2S217.9 63 216.2 65.2c-1.8 2.2 8.9 10.9 8.9 10.9s-17.6-10.9-23.8-7.7c-4.5 2.3 18.3 17.2 18.3 17.2s-14.8-11.3-18.3-8.3 16.7 27.2 16.7 27.2-23-24.8-25.3-23.6C190.4 82.1 199 94 199 94s-11.2-12.4-14.3-10.3c-3.1 2.2 16.2 34.3 16.2 34.3S180 85.1 171.3 90.6c13.5 29.7 8.5 33.9 8.5 33.9s-1.7-30.3-18.6-29.5c-8.5.4 4 22.6 4 22.6S153.7 97.3 146 97.7c14.1 26.8 9.1 37.6 9.1 37.6s2.3-22.9-16.8-35.6c7.3 6.5-4.6 35.6-4.6 35.6s10.4-42.9-7.7-34.7c-2.9 1.3-.2 21.4-.2 21.4s-3.6-23-9.1-21.8c-3.2.7-20.2 31.9-20.2 31.9s13.9-33.7 9.7-32.3c-3.1 1-8.9 14.9-8.9 14.9s2.8-13.7 0-14.5c-2.8-.8-18.6 14.5-18.6 14.5s11.7-13.7 9.7-16.6c-3.1-4.3-6.6-4.5-10.9-2.8C71.3 97.7 63 109 63 109s8.3-11.5 6.9-15.7c-2.3-6.9-26.2 13.3-26.2 13.3s14.1-13.3 10.9-16.2c-3.2-2.8-20.8-2-26.2-2-16.1.2-21.7-3.6-26.6-7.5" />
<path fill="#373535"
d="M.9 78.5c21.2 10.6 40.6-1.6 65 5.3 18.6 5.2 41.2 11.7 71.9 7.2 30.7-4.4 56.9-17.8 69.5-41.6 3.9-10.6 19.8 2.4 19.8 2.4s-11.6-4.8-11.3-2.6c.3 2.3 17.4 10.2 17.4 10.2s-15.5-4.8-14.5-1.2c.9 3.6 19.4 18.2 19.4 18.2s-20.9-15.9-22.6-13.7c-1.7 2.2 8.9 10.9 8.9 10.9s-17.6-10.9-23.8-7.7c-4.5 2.3 18.3 17.2 18.3 17.2s-14.8-11.3-18.3-8.3 16.7 27.2 16.7 27.2-22.9-24.8-25.2-23.6c-2.3 1.2 6.3 13.1 6.3 13.1S187 79.2 183.9 81.3c-3.1 2.2 16.1 34.3 16.1 34.3s-20.9-33-29.5-27.5c13.6 29.8 8.5 34 8.5 34s-1.7-30.3-18.6-29.5c-8.5.4 4 22.6 4 22.6S153 95 145.3 95.4c14.1 26.8 9.1 37.6 9.1 37.6s2.3-22.9-16.8-35.6c7.3 6.5-4.6 35.6-4.6 35.6s10.4-42.9-7.7-34.7c-2.9 1.3-.2 21.4-.2 21.4s-3.6-23-9.1-21.8c-3.2.7-20.2 31.9-20.2 31.9s13.9-33.7 9.7-32.3c-3.1 1-8.9 14.9-8.9 14.9s2.8-13.7 0-14.5c-2.8-.8-18.6 14.5-18.6 14.5s11.7-13.7 9.7-16.6c-3.1-4.3-6.6-4.5-10.9-2.8-6.2 2.4-14.5 13.7-14.5 13.7s8.3-11.5 6.9-15.7C66.9 84.1 43 104.3 43 104.3S57.1 91 53.9 88.1c-3.2-2.8-20.8-2-26.2-2-16.3.1-21.9-3.7-26.8-7.6" />
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,9 @@
import React, { forwardRef } from "react";
import CassandraSVG from "./Cassandra";
export const CassandraIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <CassandraSVG ref={ref} {...props} />;
});

View file

@ -2,16 +2,27 @@
* Function to get the python code for the API
* @param {string} flowId - The id of the flow
* @param {boolean} isAuth - If the API is authenticated
* @param {any[]} tweak - The tweaks
* @param {any[]} tweaksBuildedObject - The tweaks
* @param {string} [endpointName] - The optional endpoint name
* @returns {string} - The python code
*/
export default function getPythonApiCode(
flowId: string,
isAuth: boolean,
tweaksBuildedObject,
tweaksBuildedObject: any[],
endpointName?: string,
): string {
const tweaksObject = tweaksBuildedObject[0];
let tweaksString = "{}";
if (tweaksBuildedObject && tweaksBuildedObject.length > 0) {
const tweaksObject = tweaksBuildedObject[0];
if (!tweaksObject) {
throw new Error("expected tweaks");
}
tweaksString = JSON.stringify(tweaksObject, null, 2)
.replace(/true/g, "True")
.replace(/false/g, "False");
}
return `import argparse
import json
from argparse import RawTextHelpFormatter
@ -34,7 +45,7 @@ ENDPOINT = "${endpointName || ""}" ${
# You can tweak the flow by adding a tweaks dictionary
# e.g {"OpenAI-XXXXX": {"model_name": "gpt-4"}}
TWEAKS = ${JSON.stringify(tweaksObject, null, 2)}
TWEAKS = ${tweaksString}
def run_flow(message: str,
endpoint: str,

View file

@ -1,17 +1,26 @@
/**
* Function to get the python code for the API
* @param {string} flow - The current flow
* @param {any[]} tweak - The tweaks
* @param {any[]} tweaksBuildedObject - The tweaks
* @returns {string} - The python code
*/
export default function getPythonCode(
flowName: string,
tweaksBuildedObject,
tweaksBuildedObject: any[],
): string {
const tweaksObject = tweaksBuildedObject[0];
let tweaksString = "{}";
if (tweaksBuildedObject && tweaksBuildedObject.length > 0) {
const tweaksObject = tweaksBuildedObject[0];
if (!tweaksObject) {
throw new Error("expected tweaks");
}
tweaksString = JSON.stringify(tweaksObject, null, 2)
.replace(/true/g, "True")
.replace(/false/g, "False");
}
return `from langflow.load import run_flow_from_json
TWEAKS = ${JSON.stringify(tweaksObject, null, 2)}
TWEAKS = ${tweaksString}
result = run_flow_from_json(flow="${flowName}.json",
input_value="message",

View file

@ -171,19 +171,17 @@ export default function NodeToolbarComponent({
const advanced = useShortcutsStore((state) => state.advanced);
const minimize = useShortcutsStore((state) => state.minimize);
const share = useShortcutsStore((state) => state.share);
const component = useShortcutsStore((state) => state.component);
const save = useShortcutsStore((state) => state.save);
const docs = useShortcutsStore((state) => state.docs);
const code = useShortcutsStore((state) => state.code);
const group = useShortcutsStore((state) => state.group);
const update = useShortcutsStore((state) => state.update);
const download = useShortcutsStore((state) => state.download);
const freeze = useShortcutsStore((state) => state.freeze);
useHotkeys(minimize, handleMinimizeWShortcut, { preventDefault });
useHotkeys(update, handleUpdateWShortcut, { preventDefault });
useHotkeys(group, handleGroupWShortcut, { preventDefault });
useHotkeys(share, handleShareWShortcut, { preventDefault });
useHotkeys(component, handleShareWShortcut, { preventDefault });
useHotkeys(code, handleCodeWShortcut, { preventDefault });
useHotkeys(advanced, handleAdvancedWShortcut, { preventDefault });
useHotkeys(save, handleSaveWShortcut, { preventDefault });
@ -356,7 +354,7 @@ export default function NodeToolbarComponent({
<div className="flex justify-center">
<span> {name} </span>
<span
className={`ml-3 flex items-center rounded-sm bg-muted px-1 py-[0.2] text-muted-foreground`}
className={`ml-3 flex items-center rounded-sm bg-muted px-1.5 py-[0.1em] text-lg text-muted-foreground`}
>
<RenderIcons
isMac={isMac}
@ -618,7 +616,8 @@ export default function NodeToolbarComponent({
>
<ToolbarSelectItem
shortcut={
shortcuts.find((obj) => obj.name === "Share")?.shortcut!
shortcuts.find((obj) => obj.name === "Component Share")
?.shortcut!
}
value={"Share"}
icon={"Share3"}
@ -711,7 +710,7 @@ export default function NodeToolbarComponent({
/>{" "}
<span className="">Delete</span>{" "}
<span
className={`justify absolute right-2 top-2 flex items-center rounded-sm px-1 py-[0.2] ${deleteIsFocus ? " " : "bg-muted"}`}
className={` absolute right-2 top-2 flex items-center justify-center rounded-sm px-1 py-[0.2] ${deleteIsFocus ? " " : "bg-muted"}`}
>
<IconComponent
name="Delete"

View file

@ -38,7 +38,7 @@ export default function ToolbarSelectItem({
{value}
</span>
<span
className={`absolute right-2 top-[0.43em] flex items-center rounded-sm bg-muted px-1 py-[0.2] text-muted-foreground `}
className={`absolute right-2 top-[0.43em] flex items-center rounded-sm bg-muted px-1.5 py-[0.1em] text-muted-foreground `}
>
<RenderIcons
isMac={isMac}

View file

@ -7,6 +7,8 @@ export const useShortcutsStore = create<shortcutsStoreType>((set, get) => ({
setShortcuts: (newShortcuts) => {
set({ shortcuts: newShortcuts });
},
output: "o",
play: "p",
flow: "mod+b",
undo: "mod+z",
redo: "mod+y",
@ -16,14 +18,14 @@ export const useShortcutsStore = create<shortcutsStoreType>((set, get) => ({
code: "space",
copy: "mod+c",
duplicate: "mod+d",
share: "mod+shift+s",
component: "mod+shift+s",
docs: "mod+shift+d",
save: "mod+s",
delete: "backspace",
group: "mod+g",
cut: "mod+x",
paste: "mod+v",
api: "mod+shift+r",
api: "r",
update: "mod+u",
download: "mod+j",
freeze: "mod+f",

View file

@ -54,6 +54,7 @@ export type DropDownComponentType = {
children?: ReactNode;
};
export type ParameterComponentType = {
selected: boolean;
data: NodeDataType;
title: string;
id: sourceHandleType | targetHandleType;

View file

@ -21,6 +21,8 @@ export type StoreComponentResponse = {
export type shortcutsStoreType = {
updateUniqueShortcut: (name: string, combination: string) => void;
output: string;
play: string;
flow: string;
group: string;
cut: string;
@ -34,7 +36,7 @@ export type shortcutsStoreType = {
code: string;
copy: string;
duplicate: string;
share: string;
component: string;
docs: string;
save: string;
delete: string;

View file

@ -159,6 +159,7 @@ import { AstraDBIcon } from "../icons/AstraDB";
import { AzureIcon } from "../icons/Azure";
import { BingIcon } from "../icons/Bing";
import { BotMessageSquareIcon } from "../icons/BotMessageSquare";
import { CassandraIcon } from "../icons/Cassandra";
import { ChromaIcon } from "../icons/ChromaIcon";
import { CohereIcon } from "../icons/Cohere";
import { CouchbaseIcon } from "../icons/Couchbase";
@ -334,6 +335,7 @@ export const nodeIconsLucide: iconsType = {
Play,
Vectara: VectaraIcon,
ArrowUpToLine: ArrowUpToLine,
Cassandra: CassandraIcon,
Chroma: ChromaIcon,
Couchbase: CouchbaseIcon,
AirbyteJSONLoader: AirbyteIcon,

View file

@ -153,6 +153,8 @@ test("user should be able to download a flow or a component", async ({
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.getByText("Chat Input", { exact: true }).click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("icon-SaveAll").first().click();
await page.waitForTimeout(3000);
@ -223,6 +225,8 @@ test("user should be able to duplicate a flow or a component", async ({
await page.getByRole("heading", { name: "Basic Prompting" }).click();
await page.getByText("Chat Input", { exact: true }).click();
await page.getByTestId("more-options-modal").click();
await page.getByTestId("icon-SaveAll").first().click();
await page.waitForTimeout(3000);