From 197f1f9e71b2a105547edad1ad59284c8acc4c5d Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 29 Jun 2023 09:34:01 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20refactor(utils.ts):=20remove=20u?= =?UTF-8?q?nused=20imports=20and=20icons=20to=20improve=20code=20cleanline?= =?UTF-8?q?ss=20and=20reduce=20bundle=20size=20=F0=9F=8E=A8=20style(utils.?= =?UTF-8?q?ts):=20reorganize=20nodeColors=20and=20nodeNames=20objects=20to?= =?UTF-8?q?=20improve=20readability=20and=20maintainability=20The=20change?= =?UTF-8?q?s=20in=20this=20commit=20remove=20unused=20imports=20and=20icon?= =?UTF-8?q?s=20from=20the=20`utils.ts`=20file,=20which=20helps=20improve?= =?UTF-8?q?=20code=20cleanliness=20and=20reduces=20the=20bundle=20size.=20?= =?UTF-8?q?Additionally,=20the=20`nodeColors`=20and=20`nodeNames`=20object?= =?UTF-8?q?s=20have=20been=20reorganized=20to=20improve=20readability=20an?= =?UTF-8?q?d=20maintainability.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/utils.ts | 86 +++------------------------------------ 1 file changed, 6 insertions(+), 80 deletions(-) diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index af75b2cdf..d89fe8a00 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -1,21 +1,3 @@ -import { - RocketLaunchIcon, - LinkIcon, - CpuChipIcon, - LightBulbIcon, - CommandLineIcon, - WrenchScrewdriverIcon, - WrenchIcon, - ComputerDesktopIcon, - GiftIcon, - PaperClipIcon, - QuestionMarkCircleIcon, - FingerPrintIcon, - ScissorsIcon, - CircleStackIcon, - Squares2X2Icon, - Bars3CenterLeftIcon, -} from "@heroicons/react/24/outline"; import { Connection, Edge, Node, ReactFlowInstance } from "reactflow"; import { FlowType, NodeType } from "./types/flow"; import { APITemplateType } from "./types/api"; @@ -58,6 +40,7 @@ import { Paperclip, Rocket, Scissors, + Search, TerminalSquare, Wand2, Wrench, @@ -139,6 +122,7 @@ export const nodeColors: { [char: string]: string } = { toolkits: "#DB2C2C", wrappers: "#E6277A", utilities: "#31A3CC", + retrievers: "#F5B85A", unknown: "#9CA3AF", }; @@ -157,72 +141,11 @@ export const nodeNames: { [char: string]: string } = { toolkits: "Toolkits", wrappers: "Wrappers", textsplitters: "Text Splitters", + retrievers: "Retrievers", utilities: "Utilities", unknown: "Unknown", }; -export const nodeIcons: { - [char: string]: React.ForwardRefExoticComponent< - React.SVGProps - >; -} = { - Chroma: ChromaIcon, - AirbyteJSONLoader: AirbyteIcon, - // SerpAPIWrapper: SerperIcon, - // AZLyricsLoader: AzIcon, - Anthropic: AnthropicIcon, - ChatAnthropic: AnthropicIcon, - BingSearchAPIWrapper: BingIcon, - BingSearchRun: BingIcon, - Cohere: CohereIcon, - CohereEmbeddings: CohereIcon, - EverNoteLoader: EvernoteIcon, - FacebookChatLoader: FBIcon, - GitbookLoader: GitBookIcon, - GoogleSearchAPIWrapper: GoogleIcon, - GoogleSearchResults: GoogleIcon, - GoogleSearchRun: GoogleIcon, - HNLoader: HackerNewsIcon, - HuggingFaceHub: HugginFaceIcon, - HuggingFaceEmbeddings: HugginFaceIcon, - IFixitLoader: IFixIcon, - Meta: MetaIcon, - Midjourney: MidjourneyIcon, - NotionDirectoryLoader: NotionIcon, - ChatOpenAI: OpenAiIcon, - OpenAI: OpenAiIcon, - OpenAIEmbeddings: OpenAiIcon, - Pinecone: PineconeIcon, - SupabaseVectorStore: SupabaseIcon, - MongoDBAtlasVectorSearch: MongoDBIcon, - // UnstructuredPowerPointLoader: PowerPointIcon, // word and powerpoint have differente styles - Qdrant: QDrantIcon, - // ReadTheDocsLoader: ReadTheDocsIcon, // does not work - Searx: SearxIcon, - SlackDirectoryLoader: SlackIcon, - // Weaviate: WeaviateIcon, // does not work - // WikipediaAPIWrapper: WikipediaIcon, - // WolframAlphaQueryRun: WolframIcon, - // WolframAlphaAPIWrapper: WolframIcon, - // UnstructuredWordDocumentLoader: WordIcon, // word and powerpoint have differente styles - agents: RocketLaunchIcon, - chains: LinkIcon, - memories: CpuChipIcon, - llms: LightBulbIcon, - prompts: CommandLineIcon, - tools: WrenchIcon, - advanced: ComputerDesktopIcon, - chat: Bars3CenterLeftIcon, - embeddings: FingerPrintIcon, - documentloaders: PaperClipIcon, - vectorstores: CircleStackIcon, - toolkits: WrenchScrewdriverIcon, - textsplitters: ScissorsIcon, - wrappers: GiftIcon, - utilities: Squares2X2Icon, - unknown: QuestionMarkCircleIcon, -}; - export const nodeIconsLucide: { [char: string]: React.ForwardRefExoticComponent< ComponentType> @@ -363,6 +286,9 @@ export const nodeIconsLucide: { utilities: Wand2 as React.ForwardRefExoticComponent< ComponentType> >, + retrievers: Search as React.ForwardRefExoticComponent< + ComponentType> + >, unknown: HelpCircle as React.ForwardRefExoticComponent< ComponentType> >,