From 569d384573b901e3a8d32d2ded6138e82dd019da Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 27 Mar 2024 00:43:02 -0300 Subject: [PATCH 01/25] Add AstraDB icon and field order to AstraDBVectorStoreComponent and AstraDBSearchComponent --- .../langflow/components/vectorstores/AstraDB.py | 2 ++ .../components/vectorstores/AstraDBSearch.py | 2 ++ src/frontend/src/icons/AstraDB/AstraDB.jsx | 16 ++++++++++++++++ src/frontend/src/icons/AstraDB/Favicon.svg | 12 ++++++++++++ src/frontend/src/icons/AstraDB/index.tsx | 9 +++++++++ src/frontend/src/utils/styleUtils.ts | 2 ++ 6 files changed, 43 insertions(+) create mode 100644 src/frontend/src/icons/AstraDB/AstraDB.jsx create mode 100644 src/frontend/src/icons/AstraDB/Favicon.svg create mode 100644 src/frontend/src/icons/AstraDB/index.tsx diff --git a/src/backend/base/langflow/components/vectorstores/AstraDB.py b/src/backend/base/langflow/components/vectorstores/AstraDB.py index 9ab73808e..5ac7f85b4 100644 --- a/src/backend/base/langflow/components/vectorstores/AstraDB.py +++ b/src/backend/base/langflow/components/vectorstores/AstraDB.py @@ -10,6 +10,8 @@ from langflow.schema import Record class AstraDBVectorStoreComponent(CustomComponent): display_name = "AstraDB Vector Store" description = "Builds or loads an AstraDB Vector Store" + icon = "AstraDB" + field_order = ["token", "api_endpoint", "collection_name", "inputs", "embedding"] def build_config(self): return { diff --git a/src/backend/base/langflow/components/vectorstores/AstraDBSearch.py b/src/backend/base/langflow/components/vectorstores/AstraDBSearch.py index 8432f01f1..bc7e69a9a 100644 --- a/src/backend/base/langflow/components/vectorstores/AstraDBSearch.py +++ b/src/backend/base/langflow/components/vectorstores/AstraDBSearch.py @@ -9,6 +9,8 @@ from langflow.schema import Record class AstraDBSearchComponent(AstraDBVectorStoreComponent, LCVectorStoreComponent): display_name = "AstraDB Search" description = "Searches an existing AstraDB Vector Store" + icon = "AstraDB" + field_order = ["token", "api_endpoint", "collection_name", "input_value", "embedding"] def build_config(self): return { diff --git a/src/frontend/src/icons/AstraDB/AstraDB.jsx b/src/frontend/src/icons/AstraDB/AstraDB.jsx new file mode 100644 index 000000000..4f20ce65b --- /dev/null +++ b/src/frontend/src/icons/AstraDB/AstraDB.jsx @@ -0,0 +1,16 @@ +const AstraSVG = (props) => ( + + +{/* */} + + + + + + + + + + +); +export default AstraSVG; diff --git a/src/frontend/src/icons/AstraDB/Favicon.svg b/src/frontend/src/icons/AstraDB/Favicon.svg new file mode 100644 index 000000000..7fe145b1b --- /dev/null +++ b/src/frontend/src/icons/AstraDB/Favicon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/frontend/src/icons/AstraDB/index.tsx b/src/frontend/src/icons/AstraDB/index.tsx new file mode 100644 index 000000000..6d57406c0 --- /dev/null +++ b/src/frontend/src/icons/AstraDB/index.tsx @@ -0,0 +1,9 @@ +import React, { forwardRef } from "react"; +import AstraSVG from "./AstraDB"; + +export const AstraDBIcon = forwardRef< + SVGSVGElement, + React.PropsWithChildren<{}> +>((props, ref) => { + return ; +}); diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index 653d7e642..958b0652a 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -138,6 +138,7 @@ import { FaApple, FaGithub } from "react-icons/fa"; import { AWSIcon } from "../icons/AWS"; import { AirbyteIcon } from "../icons/Airbyte"; import { AnthropicIcon } from "../icons/Anthropic"; +import { AstraDBIcon } from "../icons/AstraDB"; import { AzureIcon } from "../icons/Azure"; import { BingIcon } from "../icons/Bing"; import { BotMessageSquareIcon } from "../icons/BotMessageSquare"; @@ -311,6 +312,7 @@ export const nodeIconsLucide: iconsType = { Amazon: AWSIcon, Anthropic: AnthropicIcon, ChatAnthropic: AnthropicIcon, + AstraDB: AstraDBIcon, BingSearchAPIWrapper: BingIcon, BingSearchRun: BingIcon, Cohere: CohereIcon, From a3b7001264f5863638f5db0d326c9b1743939418 Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Wed, 27 Mar 2024 14:21:49 -0300 Subject: [PATCH 02/25] Refactor: Increase hover time --- src/frontend/src/components/chatComponent/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 9847fd1e6..9d43cfdab 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -50,7 +50,7 @@ export default function FlowToolbar({ flow }: ChatType): JSX.Element {