From fb30f18fc21c0062655ab2c290cd61fa34a80809 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Thu, 18 Jan 2024 17:59:37 -0300 Subject: [PATCH] Add flowPool, outputTypes, inputTypes, inputIds, and outputIds to FlowStoreType --- src/frontend/src/stores/flowStore.ts | 5 ++++ src/frontend/src/types/zustand/flow/index.ts | 27 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/src/frontend/src/stores/flowStore.ts b/src/frontend/src/stores/flowStore.ts index 85c7ec60f..c993d87d0 100644 --- a/src/frontend/src/stores/flowStore.ts +++ b/src/frontend/src/stores/flowStore.ts @@ -36,6 +36,11 @@ const useFlowStore = create((set, get) => ({ isBuilt: false, reactFlowInstance: null, lastCopiedSelection: null, + flowPool: {}, + outputTypes: [], + inputTypes: [], + inputIds: [], + outputIds: [], setPending: (isPending) => { set({ isPending }); }, diff --git a/src/frontend/src/types/zustand/flow/index.ts b/src/frontend/src/types/zustand/flow/index.ts index 1555b82c2..20987704d 100644 --- a/src/frontend/src/types/zustand/flow/index.ts +++ b/src/frontend/src/types/zustand/flow/index.ts @@ -9,7 +9,34 @@ import { } from "reactflow"; import { FlowState } from "../../tabs"; +export type chatInputType = { + result: string; +}; + +export type ChatOutputType = { + message: string; + sender: string; + sender_name: string; +}; + +export type FlowPoolObjectType = { + timestamp: string; + valid: boolean; + params: any; + data: { artifacts: any; results: any | ChatOutputType | chatInputType }; + id: string; +}; + +export type FlowPoolType = { + [key: string]: Array; +}; + export type FlowStoreType = { + flowPool: FlowPoolType; + inputTypes: string[]; + outputTypes: string[]; + inputIds: string[]; + outputIds: string[]; updateSSEData: (sseData: object) => void; sseData: object; isBuilding: boolean;