From 4aefcb03a79b635978c846b0a3532aed1038bca9 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 12:17:47 -0300 Subject: [PATCH 01/13] Reorder Vertex class assignment --- src/backend/langflow/graph/graph/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/graph/graph/base.py b/src/backend/langflow/graph/graph/base.py index 3535c0e2f..453d7a98f 100644 --- a/src/backend/langflow/graph/graph/base.py +++ b/src/backend/langflow/graph/graph/base.py @@ -13,6 +13,7 @@ from langflow.graph.vertex.types import ( ChatVertex, FileToolVertex, LLMVertex, + RoutingVertex, ToolkitVertex, ) from langflow.interface.tools.constants import FILE_TOOLS @@ -402,10 +403,12 @@ class Graph: node_name = node_id.split("-")[0] if node_name in ["ChatOutput", "ChatInput"]: return ChatVertex - if node_name in lazy_load_vertex_dict.VERTEX_TYPE_MAP: - return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_name] + elif node_name in ["ShouldRunNext"]: + return RoutingVertex elif node_base_type in lazy_load_vertex_dict.VERTEX_TYPE_MAP: return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_base_type] + elif node_name in lazy_load_vertex_dict.VERTEX_TYPE_MAP: + return lazy_load_vertex_dict.VERTEX_TYPE_MAP[node_name] if node_type in FILE_TOOLS: return FileToolVertex From 09202b36a7e8f144ab48b343f725a1d463896ae8 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 12:18:36 -0300 Subject: [PATCH 02/13] Fix styling issues and add delete icon --- .../GenericNode/components/parameterComponent/index.tsx | 4 +++- .../pages/FlowPage/components/nodeToolbarComponent/index.tsx | 5 ++++- src/frontend/src/utils/styleUtils.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index da1d18840..917103260 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -324,7 +324,9 @@ export default function ParameterComponent({ ) : ( title )} - {required ? " *" : ""} + + {required ? " *" : ""} +
{info !== "" && ( diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 5abaa7bfb..8d94c3b6e 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -396,7 +396,10 @@ export default function NodeToolbarComponent({ />{" "} Delete{" "} - +
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index 78dcfdec1..73ba319bd 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -25,6 +25,7 @@ import { Compass, Copy, Cpu, + Delete, Download, DownloadCloud, Edit, @@ -117,7 +118,6 @@ import { X, XCircle, Zap, - Delete, } from "lucide-react"; import { FaApple, FaGithub } from "react-icons/fa"; import { AWSIcon } from "../icons/AWS"; From 9a4acbffa3df037251a19f268f1754b3b414bee4 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 12:19:39 -0300 Subject: [PATCH 03/13] Refactor user CRUD imports and add comments about secret key --- src/backend/langflow/services/auth/utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/services/auth/utils.py b/src/backend/langflow/services/auth/utils.py index a47604b9a..23ce1e702 100644 --- a/src/backend/langflow/services/auth/utils.py +++ b/src/backend/langflow/services/auth/utils.py @@ -11,7 +11,11 @@ from starlette.websockets import WebSocket from langflow.services.database.models.api_key.model import ApiKey from langflow.services.database.models.api_key.crud import check_key -from langflow.services.database.models.user.crud import get_user_by_id, get_user_by_username, update_user_last_login_at +from langflow.services.database.models.user.crud import ( + get_user_by_id, + get_user_by_username, + update_user_last_login_at, +) from langflow.services.database.models.user.model import User from langflow.services.deps import get_session, get_settings_service @@ -323,7 +327,7 @@ def add_padding(s): def get_fernet(settings_service=Depends(get_settings_service)): SECRET_KEY = settings_service.auth_settings.SECRET_KEY - # It's important that your secret key is 32 url-safe base64-encoded bytes + # It's important that your secret key is 32 url-safe base64-encoded byte padded_secret_key = add_padding(SECRET_KEY) fernet = Fernet(padded_secret_key) return fernet From 042ea079771efd9806b100284e456a87e23a658b Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 12:33:29 -0300 Subject: [PATCH 04/13] Refactor TextInput and add TextOutput component --- .../langflow/components/io/TextInput.py | 3 --- .../langflow/components/io/TextOutput.py | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 src/backend/langflow/components/io/TextOutput.py diff --git a/src/backend/langflow/components/io/TextInput.py b/src/backend/langflow/components/io/TextInput.py index 3f0125b1a..b0d2eb0a7 100644 --- a/src/backend/langflow/components/io/TextInput.py +++ b/src/backend/langflow/components/io/TextInput.py @@ -9,9 +9,6 @@ class TextInput(CustomComponent): description = "Used to pass text input to the next component." field_config = { - "code": { - "show": False, - }, "value": {"display_name": "Value"}, } diff --git a/src/backend/langflow/components/io/TextOutput.py b/src/backend/langflow/components/io/TextOutput.py new file mode 100644 index 000000000..d3fd37f66 --- /dev/null +++ b/src/backend/langflow/components/io/TextOutput.py @@ -0,0 +1,19 @@ +from typing import Optional + +from langflow import CustomComponent +from langflow.field_typing import Text + + +class TextOutput(CustomComponent): + display_name = "Text Output" + description = "Used to pass text output to the next component." + + field_config = { + "value": {"display_name": "Value"}, + } + + def build(self, value: Optional[str] = "") -> Text: + self.status = value + if not value: + value = "" + return value From 85a3f444dd75265fc2a4525e195e4074e54d6f7c Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 12:33:53 -0300 Subject: [PATCH 05/13] Add ShouldRunNext component --- src/backend/langflow/components/routing/__init__.py | 0 .../langflow/components/{routing => utilities}/ShouldRunNext.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/backend/langflow/components/routing/__init__.py rename src/backend/langflow/components/{routing => utilities}/ShouldRunNext.py (100%) diff --git a/src/backend/langflow/components/routing/__init__.py b/src/backend/langflow/components/routing/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/backend/langflow/components/routing/ShouldRunNext.py b/src/backend/langflow/components/utilities/ShouldRunNext.py similarity index 100% rename from src/backend/langflow/components/routing/ShouldRunNext.py rename to src/backend/langflow/components/utilities/ShouldRunNext.py From d9d2545d9b510c4189a476d5335769856513c6b8 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 17:56:31 -0300 Subject: [PATCH 06/13] Refactor build status handling in GenericNode component to use FlowStore --- .../src/CustomNodes/GenericNode/index.tsx | 12 ++++-- src/frontend/src/stores/flowStore.ts | 38 +++++++++++++------ src/frontend/src/types/api/index.ts | 2 - src/frontend/src/types/flow/index.ts | 2 - src/frontend/src/types/zustand/flow/index.ts | 4 +- 5 files changed, 37 insertions(+), 21 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index c62abf6b9..0e4812c90 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -36,6 +36,7 @@ export default function GenericNode({ const flowPool = useFlowStore((state) => state.flowPool); const buildFlow = useFlowStore((state) => state.buildFlow); const setNode = useFlowStore((state) => state.setNode); + const getBuildStatus = useFlowStore((state) => state.getBuildStatus); const name = nodeIconsLucide[data.type] ? data.type : types[data.type]; const [inputName, setInputName] = useState(false); const [nodeName, setNodeName] = useState(data.node!.display_name); @@ -262,7 +263,7 @@ export default function GenericNode({ className={getNodeBorderClassName( selected, showNode, - data?.build_status, + getBuildStatus(data.id), validationStatus )} > @@ -473,7 +474,10 @@ export default function GenericNode({ variant="outline" className={"h-9 px-1.5"} onClick={() => { - if (data?.build_status === BuildStatus.BUILDING || isBuilding) + if ( + getBuildStatus(data.id) === BuildStatus.BUILDING || + isBuilding + ) return; buildFlow(data.id); }} @@ -481,7 +485,7 @@ export default function GenericNode({
Building... ) : !validationStatus ? ( @@ -507,7 +511,7 @@ export default function GenericNode({ >
{renderIconPlayOrPauseComponents( - data?.build_status, + getBuildStatus(data.id), validationStatus )}
diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 549b0a90c..dac285ddf 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -425,25 +425,20 @@ const useFlowStore = create((set, get) => ({ viewport: get().reactFlowInstance?.getViewport()!, }; }, - updateBuildStatus: (nodeIdList: string[], status: BuildStatus) => { - nodeIdList.forEach((id) => { - const nodeToUpdate = get().nodes.find((node) => node.id === id); - if (nodeToUpdate) { - nodeToUpdate.data.build_status = status; - get().setNodes(get().nodes); - } - }); - }, updateVerticesBuild: (vertices: string[]) => { set({ verticesBuild: vertices }); }, verticesBuild: [], revertAllVerticesToBuild: () => { // set all vertices to TO_BUILD - const verticesIds = get() - .nodes.filter((node) => node.data.build_status === BuildStatus.BUILDING) - .map((node) => node.id); + let verticesIds: string[] = []; + Object.keys(get().buildStatus).forEach((id) => { + if (get().buildStatus[id] !== BuildStatus.TO_BUILD) { + verticesIds.push(id); + } + }); get().updateBuildStatus(verticesIds, BuildStatus.TO_BUILD); + // additional code logic here }, removeFromVerticesBuild: (vertices: string[]) => { set({ @@ -452,6 +447,25 @@ const useFlowStore = create((set, get) => ({ ), }); }, + updateBuildStatus: (nodeIdList: string[], status: BuildStatus) => { + let newBuildStatus = cloneDeep(get().buildStatus); + // check if nodeIdList is an array + if (!Array.isArray(nodeIdList)) { + nodeIdList = [nodeIdList]; + } + nodeIdList.forEach((id) => { + newBuildStatus[id] = status; + }); + set({ buildStatus: newBuildStatus }); + }, + buildStatus: {}, + getBuildStatus: (nodeId: string) => { + // if the node is not in the buildStatus object, set it to TO_BUILD + if (!get().buildStatus[nodeId]) { + get().buildStatus[nodeId] = BuildStatus.TO_BUILD; + } + return get().buildStatus[nodeId]; + }, })); export default useFlowStore; diff --git a/src/frontend/src/types/api/index.ts b/src/frontend/src/types/api/index.ts index ae34aa651..59b8a5ca5 100644 --- a/src/frontend/src/types/api/index.ts +++ b/src/frontend/src/types/api/index.ts @@ -1,5 +1,4 @@ import { Edge, Node, Viewport } from "reactflow"; -import { BuildStatus } from "../../constants/enums"; import { FlowType } from "../flow"; //kind and class are just representative names to represent the actual structure of the object received by the API export type APIDataType = { [key: string]: APIKindType }; @@ -37,7 +36,6 @@ export type APIClassType = { | CustomFieldsType | boolean | undefined; - build_status?: BuildStatus; }; export type TemplateVariableType = { diff --git a/src/frontend/src/types/flow/index.ts b/src/frontend/src/types/flow/index.ts index 127e1a704..8575b331e 100644 --- a/src/frontend/src/types/flow/index.ts +++ b/src/frontend/src/types/flow/index.ts @@ -1,5 +1,4 @@ import { ReactFlowJsonObject, XYPosition } from "reactflow"; -import { BuildStatus } from "../../constants/enums"; import { APIClassType } from "../api/index"; export type FlowType = { @@ -29,7 +28,6 @@ export type NodeDataType = { node?: APIClassType; id: string; output_types?: string[]; - build_status?: BuildStatus; }; // FlowStyleType is the type of the style object that is used to style the // Flow card with an emoji and a color. diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index 7f214b69d..2fc987de6 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -86,9 +86,11 @@ export type FlowStoreType = { unselectAll: () => void; buildFlow: (nodeId?: string) => Promise; getFlow: () => { nodes: Node[]; edges: Edge[]; viewport: Viewport }; - updateBuildStatus: (nodeId: string[], status: BuildStatus) => void; updateVerticesBuild: (vertices: string[]) => void; removeFromVerticesBuild: (vertices: string[]) => void; revertAllVerticesToBuild: () => void; verticesBuild: string[]; + updateBuildStatus: (nodeId: string[], status: BuildStatus) => void; + buildStatus: { [key: string]: BuildStatus }; + getBuildStatus: (nodeId: string) => BuildStatus; }; From 4a6e15533e894f8a6ef7aec95800636e8af0a7b2 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 18:06:33 -0300 Subject: [PATCH 07/13] Update LLMS references to Models and Specs --- .../AmazonBedrockSpecs.py} | 0 .../AnthropicLLMSpecs.py} | 0 .../AnthropicSpecs.py} | 0 .../AzureChatOpenAISpecs.py} | 0 .../BaiduQianfanChatEndpointsSpecs.py} | 0 .../BaiduQianfanLLMEndpointsSpecs.py} | 0 .../CTransformersSpecs.py} | 0 .../ChatAnthropicSpecs.py} | 0 .../ChatLiteLLMSpecs.py} | 0 .../ChatOllamaEndpointSpecs.py} | 0 .../ChatOpenAISpecs.py} | 0 .../ChatVertexAISpecs.py} | 0 .../Cohere.py => model_specs/CohereSpecs.py} | 0 .../GoogleGenerativeAISpecs.py} | 0 .../HuggingFaceEndpointsSpecs.py} | 0 .../LlamaCppSpecs.py} | 0 .../OllamaLLMSpecs.py} | 0 .../VertexAISpecs.py} | 0 .../{llms => model_specs}/__init__.py | 0 ...AmazonBedrock.py => AmazonBedrockModel.py} | 4 +-- .../{Anthropic.py => AnthropicModel.py} | 9 +++--- .../{AzureOpenAI.py => AzureOpenAIModel.py} | 2 +- ...ianfanChat.py => BaiduQianfanChatModel.py} | 0 ...CTransformers.py => CTransformersModel.py} | 13 ++++++-- .../models/{Cohere.py => CohereModel.py} | 30 +++++++++++++++---- ...rativeAI.py => GoogleGenerativeAIModel.py} | 8 ++--- .../{HuggingFace.py => HuggingFaceModel.py} | 0 .../models/{LlamaCpp.py => LlamaCppModel.py} | 15 +++++++--- .../models/{Ollama.py => OllamaModel.py} | 2 +- .../models/{OpenAI.py => OpenAIModel.py} | 0 .../models/{VertexAi.py => VertexAiModel.py} | 2 +- src/backend/langflow/graph/vertex/types.py | 2 +- .../langflow/interface/importing/utils.py | 4 +-- .../langflow/interface/initialize/loading.py | 8 +++-- src/backend/langflow/interface/llms/base.py | 6 ++-- 35 files changed, 71 insertions(+), 34 deletions(-) rename src/backend/langflow/components/{llms/AmazonBedrock.py => model_specs/AmazonBedrockSpecs.py} (100%) rename src/backend/langflow/components/{llms/AnthropicLLM.py => model_specs/AnthropicLLMSpecs.py} (100%) rename src/backend/langflow/components/{llms/Anthropic.py => model_specs/AnthropicSpecs.py} (100%) rename src/backend/langflow/components/{llms/AzureChatOpenAI.py => model_specs/AzureChatOpenAISpecs.py} (100%) rename src/backend/langflow/components/{llms/BaiduQianfanChatEndpoints.py => model_specs/BaiduQianfanChatEndpointsSpecs.py} (100%) rename src/backend/langflow/components/{llms/BaiduQianfanLLMEndpoints.py => model_specs/BaiduQianfanLLMEndpointsSpecs.py} (100%) rename src/backend/langflow/components/{llms/CTransformers.py => model_specs/CTransformersSpecs.py} (100%) rename src/backend/langflow/components/{llms/ChatAnthropic.py => model_specs/ChatAnthropicSpecs.py} (100%) rename src/backend/langflow/components/{llms/ChatLiteLLM.py => model_specs/ChatLiteLLMSpecs.py} (100%) rename src/backend/langflow/components/{llms/ChatOllamaEndpoint.py => model_specs/ChatOllamaEndpointSpecs.py} (100%) rename src/backend/langflow/components/{llms/ChatOpenAI.py => model_specs/ChatOpenAISpecs.py} (100%) rename src/backend/langflow/components/{llms/ChatVertexAI.py => model_specs/ChatVertexAISpecs.py} (100%) rename src/backend/langflow/components/{llms/Cohere.py => model_specs/CohereSpecs.py} (100%) rename src/backend/langflow/components/{llms/GoogleGenerativeAI.py => model_specs/GoogleGenerativeAISpecs.py} (100%) rename src/backend/langflow/components/{llms/HuggingFaceEndpoints.py => model_specs/HuggingFaceEndpointsSpecs.py} (100%) rename src/backend/langflow/components/{llms/LlamaCpp.py => model_specs/LlamaCppSpecs.py} (100%) rename src/backend/langflow/components/{llms/OllamaLLM.py => model_specs/OllamaLLMSpecs.py} (100%) rename src/backend/langflow/components/{llms/VertexAI.py => model_specs/VertexAISpecs.py} (100%) rename src/backend/langflow/components/{llms => model_specs}/__init__.py (100%) rename src/backend/langflow/components/models/{AmazonBedrock.py => AmazonBedrockModel.py} (98%) rename src/backend/langflow/components/models/{Anthropic.py => AnthropicModel.py} (95%) rename src/backend/langflow/components/models/{AzureOpenAI.py => AzureOpenAIModel.py} (98%) rename src/backend/langflow/components/models/{BaiduQianfanChat.py => BaiduQianfanChatModel.py} (100%) rename src/backend/langflow/components/models/{CTransformers.py => CTransformersModel.py} (87%) rename src/backend/langflow/components/models/{Cohere.py => CohereModel.py} (51%) rename src/backend/langflow/components/models/{GoogleGenerativeAI.py => GoogleGenerativeAIModel.py} (95%) rename src/backend/langflow/components/models/{HuggingFace.py => HuggingFaceModel.py} (100%) rename src/backend/langflow/components/models/{LlamaCpp.py => LlamaCppModel.py} (95%) rename src/backend/langflow/components/models/{Ollama.py => OllamaModel.py} (99%) rename src/backend/langflow/components/models/{OpenAI.py => OpenAIModel.py} (100%) rename src/backend/langflow/components/models/{VertexAi.py => VertexAiModel.py} (98%) diff --git a/src/backend/langflow/components/llms/AmazonBedrock.py b/src/backend/langflow/components/model_specs/AmazonBedrockSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/AmazonBedrock.py rename to src/backend/langflow/components/model_specs/AmazonBedrockSpecs.py diff --git a/src/backend/langflow/components/llms/AnthropicLLM.py b/src/backend/langflow/components/model_specs/AnthropicLLMSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/AnthropicLLM.py rename to src/backend/langflow/components/model_specs/AnthropicLLMSpecs.py diff --git a/src/backend/langflow/components/llms/Anthropic.py b/src/backend/langflow/components/model_specs/AnthropicSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/Anthropic.py rename to src/backend/langflow/components/model_specs/AnthropicSpecs.py diff --git a/src/backend/langflow/components/llms/AzureChatOpenAI.py b/src/backend/langflow/components/model_specs/AzureChatOpenAISpecs.py similarity index 100% rename from src/backend/langflow/components/llms/AzureChatOpenAI.py rename to src/backend/langflow/components/model_specs/AzureChatOpenAISpecs.py diff --git a/src/backend/langflow/components/llms/BaiduQianfanChatEndpoints.py b/src/backend/langflow/components/model_specs/BaiduQianfanChatEndpointsSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/BaiduQianfanChatEndpoints.py rename to src/backend/langflow/components/model_specs/BaiduQianfanChatEndpointsSpecs.py diff --git a/src/backend/langflow/components/llms/BaiduQianfanLLMEndpoints.py b/src/backend/langflow/components/model_specs/BaiduQianfanLLMEndpointsSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/BaiduQianfanLLMEndpoints.py rename to src/backend/langflow/components/model_specs/BaiduQianfanLLMEndpointsSpecs.py diff --git a/src/backend/langflow/components/llms/CTransformers.py b/src/backend/langflow/components/model_specs/CTransformersSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/CTransformers.py rename to src/backend/langflow/components/model_specs/CTransformersSpecs.py diff --git a/src/backend/langflow/components/llms/ChatAnthropic.py b/src/backend/langflow/components/model_specs/ChatAnthropicSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/ChatAnthropic.py rename to src/backend/langflow/components/model_specs/ChatAnthropicSpecs.py diff --git a/src/backend/langflow/components/llms/ChatLiteLLM.py b/src/backend/langflow/components/model_specs/ChatLiteLLMSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/ChatLiteLLM.py rename to src/backend/langflow/components/model_specs/ChatLiteLLMSpecs.py diff --git a/src/backend/langflow/components/llms/ChatOllamaEndpoint.py b/src/backend/langflow/components/model_specs/ChatOllamaEndpointSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/ChatOllamaEndpoint.py rename to src/backend/langflow/components/model_specs/ChatOllamaEndpointSpecs.py diff --git a/src/backend/langflow/components/llms/ChatOpenAI.py b/src/backend/langflow/components/model_specs/ChatOpenAISpecs.py similarity index 100% rename from src/backend/langflow/components/llms/ChatOpenAI.py rename to src/backend/langflow/components/model_specs/ChatOpenAISpecs.py diff --git a/src/backend/langflow/components/llms/ChatVertexAI.py b/src/backend/langflow/components/model_specs/ChatVertexAISpecs.py similarity index 100% rename from src/backend/langflow/components/llms/ChatVertexAI.py rename to src/backend/langflow/components/model_specs/ChatVertexAISpecs.py diff --git a/src/backend/langflow/components/llms/Cohere.py b/src/backend/langflow/components/model_specs/CohereSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/Cohere.py rename to src/backend/langflow/components/model_specs/CohereSpecs.py diff --git a/src/backend/langflow/components/llms/GoogleGenerativeAI.py b/src/backend/langflow/components/model_specs/GoogleGenerativeAISpecs.py similarity index 100% rename from src/backend/langflow/components/llms/GoogleGenerativeAI.py rename to src/backend/langflow/components/model_specs/GoogleGenerativeAISpecs.py diff --git a/src/backend/langflow/components/llms/HuggingFaceEndpoints.py b/src/backend/langflow/components/model_specs/HuggingFaceEndpointsSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/HuggingFaceEndpoints.py rename to src/backend/langflow/components/model_specs/HuggingFaceEndpointsSpecs.py diff --git a/src/backend/langflow/components/llms/LlamaCpp.py b/src/backend/langflow/components/model_specs/LlamaCppSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/LlamaCpp.py rename to src/backend/langflow/components/model_specs/LlamaCppSpecs.py diff --git a/src/backend/langflow/components/llms/OllamaLLM.py b/src/backend/langflow/components/model_specs/OllamaLLMSpecs.py similarity index 100% rename from src/backend/langflow/components/llms/OllamaLLM.py rename to src/backend/langflow/components/model_specs/OllamaLLMSpecs.py diff --git a/src/backend/langflow/components/llms/VertexAI.py b/src/backend/langflow/components/model_specs/VertexAISpecs.py similarity index 100% rename from src/backend/langflow/components/llms/VertexAI.py rename to src/backend/langflow/components/model_specs/VertexAISpecs.py diff --git a/src/backend/langflow/components/llms/__init__.py b/src/backend/langflow/components/model_specs/__init__.py similarity index 100% rename from src/backend/langflow/components/llms/__init__.py rename to src/backend/langflow/components/model_specs/__init__.py diff --git a/src/backend/langflow/components/models/AmazonBedrock.py b/src/backend/langflow/components/models/AmazonBedrockModel.py similarity index 98% rename from src/backend/langflow/components/models/AmazonBedrock.py rename to src/backend/langflow/components/models/AmazonBedrockModel.py index 8465ca877..a2e008e2e 100644 --- a/src/backend/langflow/components/models/AmazonBedrock.py +++ b/src/backend/langflow/components/models/AmazonBedrockModel.py @@ -1,13 +1,13 @@ from typing import Optional from langchain_community.chat_models.bedrock import BedrockChat -from langflow.field_typing import Text from langflow import CustomComponent +from langflow.field_typing import Text class AmazonBedrockComponent(CustomComponent): - display_name: str = "Amazon Bedrock model" + display_name: str = "Amazon Bedrock Model" description: str = "Generate text using LLM model from Amazon Bedrock." def build_config(self): diff --git a/src/backend/langflow/components/models/Anthropic.py b/src/backend/langflow/components/models/AnthropicModel.py similarity index 95% rename from src/backend/langflow/components/models/Anthropic.py rename to src/backend/langflow/components/models/AnthropicModel.py index 86af33ede..793bec46a 100644 --- a/src/backend/langflow/components/models/Anthropic.py +++ b/src/backend/langflow/components/models/AnthropicModel.py @@ -2,14 +2,13 @@ from typing import Optional from langchain_community.chat_models.anthropic import ChatAnthropic from pydantic.v1 import SecretStr + +from langflow import CustomComponent from langflow.field_typing import Text -from langflow import CustomComponent - - class AnthropicLLM(CustomComponent): - display_name: str = "Anthropic model" + display_name: str = "AnthropicModel" description: str = "Generate text using Anthropic Chat&Completion large language models." def build_config(self): @@ -67,7 +66,7 @@ class AnthropicLLM(CustomComponent): try: output = ChatAnthropic( model_name=model, - anthropic_api_key=SecretStr(anthropic_api_key) if anthropic_api_key else None, + anthropic_api_key=(SecretStr(anthropic_api_key) if anthropic_api_key else None), max_tokens_to_sample=max_tokens, # type: ignore temperature=temperature, anthropic_api_url=api_endpoint, diff --git a/src/backend/langflow/components/models/AzureOpenAI.py b/src/backend/langflow/components/models/AzureOpenAIModel.py similarity index 98% rename from src/backend/langflow/components/models/AzureOpenAI.py rename to src/backend/langflow/components/models/AzureOpenAIModel.py index f640be109..06fbd444d 100644 --- a/src/backend/langflow/components/models/AzureOpenAI.py +++ b/src/backend/langflow/components/models/AzureOpenAIModel.py @@ -7,7 +7,7 @@ from langflow import CustomComponent class AzureChatOpenAIComponent(CustomComponent): - display_name: str = "AzureOpenAI model" + display_name: str = "AzureOpenAIModel" description: str = "Generate text using LLM model from Azure OpenAI." documentation: str = "https://python.langchain.com/docs/integrations/llms/azure_openai" beta = False diff --git a/src/backend/langflow/components/models/BaiduQianfanChat.py b/src/backend/langflow/components/models/BaiduQianfanChatModel.py similarity index 100% rename from src/backend/langflow/components/models/BaiduQianfanChat.py rename to src/backend/langflow/components/models/BaiduQianfanChatModel.py diff --git a/src/backend/langflow/components/models/CTransformers.py b/src/backend/langflow/components/models/CTransformersModel.py similarity index 87% rename from src/backend/langflow/components/models/CTransformers.py rename to src/backend/langflow/components/models/CTransformersModel.py index 16cb8ff1d..932b1b351 100644 --- a/src/backend/langflow/components/models/CTransformers.py +++ b/src/backend/langflow/components/models/CTransformersModel.py @@ -1,13 +1,13 @@ from typing import Dict, Optional from langchain_community.llms.ctransformers import CTransformers -from langflow.field_typing import Text from langflow import CustomComponent +from langflow.field_typing import Text class CTransformersComponent(CustomComponent): - display_name = "CTransformers model" + display_name = "CTransformersModel" description = "Generate text using CTransformers LLM models" documentation = "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/ctransformers" @@ -31,7 +31,14 @@ class CTransformersComponent(CustomComponent): "inputs": {"display_name": "Input"}, } - def build(self, model: str, model_file: str, inputs: str, model_type: str, config: Optional[Dict] = None) -> Text: + def build( + self, + model: str, + model_file: str, + inputs: str, + model_type: str, + config: Optional[Dict] = None, + ) -> Text: output = CTransformers(model=model, model_file=model_file, model_type=model_type, config=config) message = output.invoke(inputs) result = message.content if hasattr(message, "content") else message diff --git a/src/backend/langflow/components/models/Cohere.py b/src/backend/langflow/components/models/CohereModel.py similarity index 51% rename from src/backend/langflow/components/models/Cohere.py rename to src/backend/langflow/components/models/CohereModel.py index 3342033b1..3912cb855 100644 --- a/src/backend/langflow/components/models/Cohere.py +++ b/src/backend/langflow/components/models/CohereModel.py @@ -1,18 +1,33 @@ from langchain_community.chat_models.cohere import ChatCohere + from langflow import CustomComponent from langflow.field_typing import Text class CohereComponent(CustomComponent): - display_name = "Cohere model" + display_name = "CohereModel" description = "Generate text using Cohere large language models." documentation = "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/cohere" def build_config(self): return { - "cohere_api_key": {"display_name": "Cohere API Key", "type": "password", "password": True}, - "max_tokens": {"display_name": "Max Tokens", "default": 256, "type": "int", "show": True}, - "temperature": {"display_name": "Temperature", "default": 0.75, "type": "float", "show": True}, + "cohere_api_key": { + "display_name": "Cohere API Key", + "type": "password", + "password": True, + }, + "max_tokens": { + "display_name": "Max Tokens", + "default": 256, + "type": "int", + "show": True, + }, + "temperature": { + "display_name": "Temperature", + "default": 0.75, + "type": "float", + "show": True, + }, "inputs": {"display_name": "Input"}, } @@ -23,8 +38,13 @@ class CohereComponent(CustomComponent): max_tokens: int = 256, temperature: float = 0.75, ) -> Text: - output = ChatCohere(cohere_api_key=cohere_api_key, max_tokens=max_tokens, temperature=temperature) + output = ChatCohere( + cohere_api_key=cohere_api_key, + max_tokens=max_tokens, + temperature=temperature, + ) message = output.invoke(inputs) result = message.content if hasattr(message, "content") else message self.status = result return result + return result diff --git a/src/backend/langflow/components/models/GoogleGenerativeAI.py b/src/backend/langflow/components/models/GoogleGenerativeAIModel.py similarity index 95% rename from src/backend/langflow/components/models/GoogleGenerativeAI.py rename to src/backend/langflow/components/models/GoogleGenerativeAIModel.py index a3756a55a..ce967bd57 100644 --- a/src/backend/langflow/components/models/GoogleGenerativeAI.py +++ b/src/backend/langflow/components/models/GoogleGenerativeAIModel.py @@ -1,14 +1,14 @@ from typing import Optional from langchain_google_genai import ChatGoogleGenerativeAI # type: ignore -from langflow import CustomComponent -from langflow.field_typing import RangeSpec from pydantic.v1.types import SecretStr -from langflow.field_typing import Text + +from langflow import CustomComponent +from langflow.field_typing import RangeSpec, Text class GoogleGenerativeAIComponent(CustomComponent): - display_name: str = "Google Generative AI model" + display_name: str = "Google Generative AIModel" description: str = "Generate text using Google Generative AI to generate text." documentation: str = "http://docs.langflow.org/components/custom" diff --git a/src/backend/langflow/components/models/HuggingFace.py b/src/backend/langflow/components/models/HuggingFaceModel.py similarity index 100% rename from src/backend/langflow/components/models/HuggingFace.py rename to src/backend/langflow/components/models/HuggingFaceModel.py diff --git a/src/backend/langflow/components/models/LlamaCpp.py b/src/backend/langflow/components/models/LlamaCppModel.py similarity index 95% rename from src/backend/langflow/components/models/LlamaCpp.py rename to src/backend/langflow/components/models/LlamaCppModel.py index 925703007..af0de5159 100644 --- a/src/backend/langflow/components/models/LlamaCpp.py +++ b/src/backend/langflow/components/models/LlamaCppModel.py @@ -1,11 +1,13 @@ -from typing import Optional, List, Dict, Any -from langflow import CustomComponent +from typing import Any, Dict, List, Optional + from langchain_community.llms.llamacpp import LlamaCpp + +from langflow import CustomComponent from langflow.field_typing import Text class LlamaCppComponent(CustomComponent): - display_name = "LlamaCpp model" + display_name = "LlamaCppModel" description = "Generate text using llama.cpp model." documentation = "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/llamacpp" @@ -17,7 +19,10 @@ class LlamaCppComponent(CustomComponent): "echo": {"display_name": "Echo", "advanced": True}, "f16_kv": {"display_name": "F16 KV", "advanced": True}, "grammar_path": {"display_name": "Grammar Path", "advanced": True}, - "last_n_tokens_size": {"display_name": "Last N Tokens Size", "advanced": True}, + "last_n_tokens_size": { + "display_name": "Last N Tokens Size", + "advanced": True, + }, "logits_all": {"display_name": "Logits All", "advanced": True}, "logprobs": {"display_name": "Logprobs", "advanced": True}, "lora_base": {"display_name": "Lora Base", "advanced": True}, @@ -134,3 +139,5 @@ class LlamaCppComponent(CustomComponent): result = message.content if hasattr(message, "content") else message self.status = result return result + self.status = result + return result diff --git a/src/backend/langflow/components/models/Ollama.py b/src/backend/langflow/components/models/OllamaModel.py similarity index 99% rename from src/backend/langflow/components/models/Ollama.py rename to src/backend/langflow/components/models/OllamaModel.py index 496dc1a15..129f96482 100644 --- a/src/backend/langflow/components/models/Ollama.py +++ b/src/backend/langflow/components/models/OllamaModel.py @@ -12,7 +12,7 @@ from langflow.field_typing import Text class ChatOllamaComponent(CustomComponent): - display_name = "ChatOllama model" + display_name = "ChatOllamaModel" description = "Generate text using Local LLM for chat with Ollama." def build_config(self) -> dict: diff --git a/src/backend/langflow/components/models/OpenAI.py b/src/backend/langflow/components/models/OpenAIModel.py similarity index 100% rename from src/backend/langflow/components/models/OpenAI.py rename to src/backend/langflow/components/models/OpenAIModel.py diff --git a/src/backend/langflow/components/models/VertexAi.py b/src/backend/langflow/components/models/VertexAiModel.py similarity index 98% rename from src/backend/langflow/components/models/VertexAi.py rename to src/backend/langflow/components/models/VertexAiModel.py index 65f64578f..eee804e02 100644 --- a/src/backend/langflow/components/models/VertexAi.py +++ b/src/backend/langflow/components/models/VertexAiModel.py @@ -7,7 +7,7 @@ from langflow.field_typing import Text class ChatVertexAIComponent(CustomComponent): - display_name = "ChatVertexAI model" + display_name = "ChatVertexAIModel" description = "Generate text using Vertex AI Chat large language models API." def build_config(self): diff --git a/src/backend/langflow/graph/vertex/types.py b/src/backend/langflow/graph/vertex/types.py index 705b5d114..cec1f6caf 100644 --- a/src/backend/langflow/graph/vertex/types.py +++ b/src/backend/langflow/graph/vertex/types.py @@ -67,7 +67,7 @@ class LLMVertex(StatelessVertex): class_built_object = None def __init__(self, data: Dict, graph, params: Optional[Dict] = None): - super().__init__(data, graph=graph, base_type="llms", params=params) + super().__init__(data, graph=graph, base_type="models", params=params) self.steps: List[Callable] = [self._custom_build] async def _custom_build(self, *args, **kwargs): diff --git a/src/backend/langflow/interface/importing/utils.py b/src/backend/langflow/interface/importing/utils.py index 62e1b5e42..d9d9198b6 100644 --- a/src/backend/langflow/interface/importing/utils.py +++ b/src/backend/langflow/interface/importing/utils.py @@ -35,7 +35,7 @@ def import_by_type(_type: str, name: str) -> Any: func_dict = { "agents": import_agent, "prompts": import_prompt, - "llms": {"llm": import_llm, "chat": import_chat_llm}, + "models": {"llm": import_llm, "chat": import_chat_llm}, "tools": import_tool, "chains": import_chain, "toolkits": import_toolkit, @@ -50,7 +50,7 @@ def import_by_type(_type: str, name: str) -> Any: "retrievers": import_retriever, "custom_components": import_custom_component, } - if _type == "llms": + if _type == "models": key = "chat" if "chat" in name.lower() else "llm" loaded_func = func_dict[_type][key] # type: ignore else: diff --git a/src/backend/langflow/interface/initialize/loading.py b/src/backend/langflow/interface/initialize/loading.py index b18f8c658..83bd67321 100644 --- a/src/backend/langflow/interface/initialize/loading.py +++ b/src/backend/langflow/interface/initialize/loading.py @@ -19,7 +19,11 @@ from langflow.interface.custom.utils import get_function from langflow.interface.custom_lists import CUSTOM_NODES from langflow.interface.importing.utils import import_by_type from langflow.interface.initialize.llm import initialize_vertexai -from langflow.interface.initialize.utils import handle_format_kwargs, handle_node_type, handle_partial_variables +from langflow.interface.initialize.utils import ( + handle_format_kwargs, + handle_node_type, + handle_partial_variables, +) from langflow.interface.initialize.vector_store import vecstore_initializer from langflow.interface.output_parsers.base import output_parser_creator from langflow.interface.retrievers.base import retriever_creator @@ -105,7 +109,7 @@ async def instantiate_based_on_type(class_object, base_type, node_type, params, return instantiate_chains(node_type, class_object, params) elif base_type == "output_parsers": return instantiate_output_parser(node_type, class_object, params) - elif base_type == "llms": + elif base_type == "models": return instantiate_llm(node_type, class_object, params) elif base_type == "retrievers": return instantiate_retriever(node_type, class_object, params) diff --git a/src/backend/langflow/interface/llms/base.py b/src/backend/langflow/interface/llms/base.py index 4b0654a1a..ba611da8d 100644 --- a/src/backend/langflow/interface/llms/base.py +++ b/src/backend/langflow/interface/llms/base.py @@ -1,16 +1,16 @@ from typing import Dict, List, Optional, Type +from loguru import logger + from langflow.interface.base import LangChainTypeCreator from langflow.interface.custom_lists import llm_type_to_cls_dict from langflow.services.deps import get_settings_service - from langflow.template.frontend_node.llms import LLMFrontendNode -from loguru import logger from langflow.utils.util import build_template_from_class class LLMCreator(LangChainTypeCreator): - type_name: str = "llms" + type_name: str = "models" @property def frontend_node_class(self) -> Type[LLMFrontendNode]: From 91ff2ce3df0c004dcf5a5aef48b35a7c68c4956c Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 18:07:00 -0300 Subject: [PATCH 08/13] Update node colors and names in styleUtils.ts --- src/frontend/src/utils/styleUtils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts index 73ba319bd..245d7a6ed 100644 --- a/src/frontend/src/utils/styleUtils.ts +++ b/src/frontend/src/utils/styleUtils.ts @@ -195,7 +195,7 @@ export const gradients = [ export const nodeColors: { [char: string]: string } = { prompts: "#4367BF", models: "#AA2411", - llms: "#6344BE", + model_specs: "#6344BE", chains: "#FE7500", Document: "#7AAE42", list: "#9AAE42", @@ -224,7 +224,7 @@ export const nodeColors: { [char: string]: string } = { export const nodeNames: { [char: string]: string } = { prompts: "Prompts", models: "Language Models", - llms: "Model Settings", + model_specs: "Model Specs", chains: "Chains", agents: "Agents", tools: "Tools", @@ -296,7 +296,7 @@ export const nodeIconsLucide: iconsType = { chains: Link, memories: Cpu, models: Bot, - llms: Lightbulb, + model_specs: Lightbulb, prompts: TerminalSquare, tools: Wrench, advanced: Laptop2, From 6d484790660aa5862e843be18637555477e3e883 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 18:55:51 -0300 Subject: [PATCH 09/13] Remove unused revertAllVerticesToBuild function --- src/frontend/src/stores/flowStore.ts | 13 +------------ src/frontend/src/types/zustand/flow/index.ts | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index dac285ddf..babb053e6 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -416,7 +416,6 @@ const useFlowStore = create((set, get) => ({ useFlowStore.getState().updateBuildStatus(idList, BuildStatus.BUILDING); }, }); - get().revertAllVerticesToBuild(); }, getFlow: () => { return { @@ -429,17 +428,7 @@ const useFlowStore = create((set, get) => ({ set({ verticesBuild: vertices }); }, verticesBuild: [], - revertAllVerticesToBuild: () => { - // set all vertices to TO_BUILD - let verticesIds: string[] = []; - Object.keys(get().buildStatus).forEach((id) => { - if (get().buildStatus[id] !== BuildStatus.TO_BUILD) { - verticesIds.push(id); - } - }); - get().updateBuildStatus(verticesIds, BuildStatus.TO_BUILD); - // additional code logic here - }, + removeFromVerticesBuild: (vertices: string[]) => { set({ verticesBuild: get().verticesBuild.filter( diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index 2fc987de6..93995fd7c 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -88,7 +88,6 @@ export type FlowStoreType = { getFlow: () => { nodes: Node[]; edges: Edge[]; viewport: Viewport }; updateVerticesBuild: (vertices: string[]) => void; removeFromVerticesBuild: (vertices: string[]) => void; - revertAllVerticesToBuild: () => void; verticesBuild: string[]; updateBuildStatus: (nodeId: string[], status: BuildStatus) => void; buildStatus: { [key: string]: BuildStatus }; From 515b281248a0adea97c0d28dc9cdba56c29d3963 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 18:56:19 -0300 Subject: [PATCH 10/13] Fix build status class issue in GenericNode component --- .../src/CustomNodes/GenericNode/index.tsx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 0e4812c90..5091e09c1 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -170,7 +170,6 @@ export default function GenericNode({ validationStatus: validationStatusType | null ) => { const isValid = validationStatus && validationStatus.valid; - if (isValid) { return "green-status"; } else if (!isValid && buildStatus === BuildStatus.INACTIVE) { @@ -181,8 +180,10 @@ export default function GenericNode({ return "red-status"; } else if (!validationStatus) { return "yellow-status"; - } else { + } else if (buildStatus === BuildStatus.BUILDING) { return "status-build-animation"; + } else { + return "green-status"; } }; @@ -203,6 +204,7 @@ export default function GenericNode({ validationStatus: validationStatusType | null ) => { let isInvalid = validationStatus && !validationStatus.valid; + if (buildStatus === BuildStatus.INACTIVE && isInvalid) { // INACTIVE should have its own class return "inactive-status"; @@ -222,11 +224,17 @@ export default function GenericNode({ buildStatus: BuildStatus | undefined, validationStatus: validationStatusType | null ) => { + const specificClassFromBuildStatus = getSpecificClassFromBuildStatus( + buildStatus, + validationStatus + ); + const baseBorderClass = getBaseBorderClass(selected); + const nodeSizeClass = getNodeSizeClass(showNode); return classNames( - getBaseBorderClass(selected), - getNodeSizeClass(showNode), + baseBorderClass, + nodeSizeClass, "generic-node-div", - getSpecificClassFromBuildStatus(buildStatus, validationStatus) + specificClassFromBuildStatus ); }; @@ -479,6 +487,7 @@ export default function GenericNode({ isBuilding ) return; + buildFlow(data.id); }} > From 523e8d8ca2a5ca1f8846e3d9396f5f517e9c6516 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 19:06:12 -0300 Subject: [PATCH 11/13] Update status colors in CSS and Tailwind config --- src/frontend/src/style/applies.css | 2 +- src/frontend/src/style/index.css | 1 + src/frontend/tailwind.config.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/style/applies.css b/src/frontend/src/style/applies.css index 39d4769e6..a9ffa8dd4 100644 --- a/src/frontend/src/style/applies.css +++ b/src/frontend/src/style/applies.css @@ -296,7 +296,7 @@ @apply generic-node-status text-status-green; } .gray-status { - @apply generic-node-status text-muted-foreground; + @apply generic-node-status text-status-gray; } .red-status { diff --git a/src/frontend/src/style/index.css b/src/frontend/src/style/index.css index 0185d25b7..ba0496071 100644 --- a/src/frontend/src/style/index.css +++ b/src/frontend/src/style/index.css @@ -60,6 +60,7 @@ --chat-send: #059669; --status-green: #4ade80; --status-blue: #2563eb; + --status-gray: #6b7280; --connection: #555; } diff --git a/src/frontend/tailwind.config.js b/src/frontend/tailwind.config.js index cef5b5891..ba37b1b62 100644 --- a/src/frontend/tailwind.config.js +++ b/src/frontend/tailwind.config.js @@ -80,6 +80,7 @@ module.exports = { "status-green": "var(--status-green)", "status-red": "var(--status-red)", "status-yellow": "var(--status-yellow)", + "status-gray": "var(--status-gray)", "success-background": "var(--success-background)", "success-foreground": "var(--success-foreground)", "beta-background": "var(--beta-background)", From a4697e293a31dc001713d8d0b8b2536b3a16b67e Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 19:06:38 -0300 Subject: [PATCH 12/13] Update validation status color --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 5091e09c1..94bb60422 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -179,7 +179,7 @@ export default function GenericNode({ } else if (!isValid && buildStatus === BuildStatus.BUILT) { return "red-status"; } else if (!validationStatus) { - return "yellow-status"; + return "green-status"; } else if (buildStatus === BuildStatus.BUILDING) { return "status-build-animation"; } else { @@ -501,7 +501,7 @@ export default function GenericNode({ Build{" "} {" "} flow to validate status.
From b49a948c1b188ffecd430166f74ac2c6b9d8d028 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Sun, 25 Feb 2024 19:07:19 -0300 Subject: [PATCH 13/13] Fix validation status condition in GenericNode component --- src/frontend/src/CustomNodes/GenericNode/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 94bb60422..46f8d18ad 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -178,7 +178,7 @@ export default function GenericNode({ return "green-status"; } else if (!isValid && buildStatus === BuildStatus.BUILT) { return "red-status"; - } else if (!validationStatus) { + } else if (!validationStatus && buildStatus === BuildStatus.TO_BUILD) { return "green-status"; } else if (buildStatus === BuildStatus.BUILDING) { return "status-build-animation";