Fixed type errors on GenericNode
This commit is contained in:
parent
ee0eee5346
commit
94fec39865
5 changed files with 13 additions and 10 deletions
|
|
@ -3,11 +3,11 @@ import { VertexBuildTypeAPI } from "../../types/api";
|
||||||
import { isErrorLog } from "../../types/utils/typeCheckingUtils";
|
import { isErrorLog } from "../../types/utils/typeCheckingUtils";
|
||||||
|
|
||||||
const useValidationStatusString = (
|
const useValidationStatusString = (
|
||||||
validationStatus: VertexBuildTypeAPI,
|
validationStatus: VertexBuildTypeAPI | null,
|
||||||
setValidationString,
|
setValidationString,
|
||||||
) => {
|
) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (validationStatus?.data?.logs) {
|
if (validationStatus && validationStatus.data?.logs) {
|
||||||
// if it is not a string turn it into a string
|
// if it is not a string turn it into a string
|
||||||
let newValidationString = "";
|
let newValidationString = "";
|
||||||
Object.values(validationStatus?.data?.logs).forEach((log: any) => {
|
Object.values(validationStatus?.data?.logs).forEach((log: any) => {
|
||||||
|
|
|
||||||
|
|
@ -434,7 +434,7 @@ const useFlowStore = create<FlowStoreType>((set, get) => ({
|
||||||
input_value?: string;
|
input_value?: string;
|
||||||
files?: string[];
|
files?: string[];
|
||||||
silent?: boolean;
|
silent?: boolean;
|
||||||
setLockChat: (lock: boolean) => void;
|
setLockChat?: (lock: boolean) => void;
|
||||||
}) => {
|
}) => {
|
||||||
get().setIsBuilding(true);
|
get().setIsBuilding(true);
|
||||||
const currentFlow = useFlowsManagerStore.getState().currentFlow;
|
const currentFlow = useFlowsManagerStore.getState().currentFlow;
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ export type VertexDataTypeAPI = {
|
||||||
timedelta?: number;
|
timedelta?: number;
|
||||||
duration?: string;
|
duration?: string;
|
||||||
artifacts?: any | ChatOutputType | ChatInputType;
|
artifacts?: any | ChatOutputType | ChatInputType;
|
||||||
message: ChatOutputType | ChatInputType;
|
message?: ChatOutputType | ChatInputType;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CodeErrorDataTypeAPI = {
|
export type CodeErrorDataTypeAPI = {
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ export type FlowStoreType = {
|
||||||
silent,
|
silent,
|
||||||
setLockChat,
|
setLockChat,
|
||||||
}: {
|
}: {
|
||||||
setLockChat: (lock: boolean) => void;
|
setLockChat?: (lock: boolean) => void;
|
||||||
startNodeId?: string;
|
startNodeId?: string;
|
||||||
stopNodeId?: string;
|
stopNodeId?: string;
|
||||||
input_value?: string;
|
input_value?: string;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import { isErrorLogType } from "../types/utils/typeCheckingUtils";
|
||||||
import { VertexLayerElementType } from "../types/zustand/flow";
|
import { VertexLayerElementType } from "../types/zustand/flow";
|
||||||
|
|
||||||
type BuildVerticesParams = {
|
type BuildVerticesParams = {
|
||||||
setLockChat: (lock: boolean) => void;
|
setLockChat?: (lock: boolean) => void;
|
||||||
flowId: string; // Assuming FlowType is the type for your flow
|
flowId: string; // Assuming FlowType is the type for your flow
|
||||||
input_value?: any; // Replace any with the actual type if it's not any
|
input_value?: any; // Replace any with the actual type if it's not any
|
||||||
files?: string[];
|
files?: string[];
|
||||||
|
|
@ -33,7 +33,7 @@ function getInactiveVertexData(vertexId: string): VertexBuildTypeAPI {
|
||||||
// Build VertexBuildTypeAPI
|
// Build VertexBuildTypeAPI
|
||||||
let inactiveData = {
|
let inactiveData = {
|
||||||
results: {},
|
results: {},
|
||||||
logs: [],
|
logs: {},
|
||||||
messages: [],
|
messages: [],
|
||||||
inactive: true,
|
inactive: true,
|
||||||
};
|
};
|
||||||
|
|
@ -46,6 +46,9 @@ function getInactiveVertexData(vertexId: string): VertexBuildTypeAPI {
|
||||||
top_level_vertices: [],
|
top_level_vertices: [],
|
||||||
inactive_vertices: null,
|
inactive_vertices: null,
|
||||||
valid: false,
|
valid: false,
|
||||||
|
params: null,
|
||||||
|
messages: [],
|
||||||
|
artifacts: null,
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: new Date().toISOString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -54,7 +57,7 @@ function getInactiveVertexData(vertexId: string): VertexBuildTypeAPI {
|
||||||
|
|
||||||
export async function updateVerticesOrder(
|
export async function updateVerticesOrder(
|
||||||
flowId: string,
|
flowId: string,
|
||||||
setLockChat: (lock: boolean) => void,
|
setLockChat?: (lock: boolean) => void,
|
||||||
startNodeId?: string | null,
|
startNodeId?: string | null,
|
||||||
stopNodeId?: string | null,
|
stopNodeId?: string | null,
|
||||||
nodes?: Node[],
|
nodes?: Node[],
|
||||||
|
|
@ -82,7 +85,7 @@ export async function updateVerticesOrder(
|
||||||
list: [error.response?.data?.detail ?? "Unknown Error"],
|
list: [error.response?.data?.detail ?? "Unknown Error"],
|
||||||
});
|
});
|
||||||
useFlowStore.getState().setIsBuilding(false);
|
useFlowStore.getState().setIsBuilding(false);
|
||||||
setLockChat(false);
|
setLockChat && setLockChat(false);
|
||||||
throw new Error("Invalid nodes");
|
throw new Error("Invalid nodes");
|
||||||
}
|
}
|
||||||
// orderResponse.data.ids,
|
// orderResponse.data.ids,
|
||||||
|
|
@ -141,7 +144,7 @@ export async function buildVertices({
|
||||||
onValidateNodes(verticesOrderResponse.verticesToRun);
|
onValidateNodes(verticesOrderResponse.verticesToRun);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
useFlowStore.getState().setIsBuilding(false);
|
useFlowStore.getState().setIsBuilding(false);
|
||||||
setLockChat(false);
|
setLockChat && setLockChat(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue