Fix formatting and remove unused imports
This commit is contained in:
parent
fb52f1368e
commit
c32a7f9f11
19 changed files with 85 additions and 112 deletions
|
|
@ -150,10 +150,9 @@ class OllamaLLM(CustomComponent):
|
|||
"top_k": top_k,
|
||||
"top_p": top_p,
|
||||
}
|
||||
|
||||
# None Value remove
|
||||
llm_params = {k: v for k, v in llm_params.items() if v is not None}
|
||||
|
||||
# None Value remove
|
||||
llm_params = {k: v for k, v in llm_params.items() if v is not None}
|
||||
|
||||
try:
|
||||
llm = Ollama(**llm_params)
|
||||
|
|
|
|||
|
|
@ -15,29 +15,21 @@ class VectaraSelfQueryRetriverComponent(CustomComponent):
|
|||
|
||||
display_name: str = "Vectara Self Query Retriever for Vectara Vector Store"
|
||||
description: str = "Implementation of Vectara Self Query Retriever"
|
||||
documentation = (
|
||||
"https://python.langchain.com/docs/integrations/retrievers/self_query/vectara_self_query"
|
||||
)
|
||||
documentation = "https://python.langchain.com/docs/integrations/retrievers/self_query/vectara_self_query"
|
||||
beta = True
|
||||
|
||||
field_config = {
|
||||
"code": {"show": True},
|
||||
"vectorstore": {
|
||||
"display_name": "Vector Store",
|
||||
"info": "Input Vectara Vectore Store"
|
||||
},
|
||||
"llm": {
|
||||
"display_name": "LLM",
|
||||
"info": "For self query retriever"
|
||||
},
|
||||
"document_content_description":{
|
||||
"display_name": "Document Content Description",
|
||||
"vectorstore": {"display_name": "Vector Store", "info": "Input Vectara Vectore Store"},
|
||||
"llm": {"display_name": "LLM", "info": "For self query retriever"},
|
||||
"document_content_description": {
|
||||
"display_name": "Document Content Description",
|
||||
"info": "For self query retriever",
|
||||
},
|
||||
},
|
||||
"metadata_field_info": {
|
||||
"display_name": "Metadata Field Info",
|
||||
"info": "Each metadata field info is a string in the form of key value pair dictionary containing additional search metadata.\nExample input: {\"name\":\"speech\",\"description\":\"what name of the speech\",\"type\":\"string or list[string]\"}.\nThe keys should remain constant(name, description, type)",
|
||||
},
|
||||
"display_name": "Metadata Field Info",
|
||||
"info": 'Each metadata field info is a string in the form of key value pair dictionary containing additional search metadata.\nExample input: {"name":"speech","description":"what name of the speech","type":"string or list[string]"}.\nThe keys should remain constant(name, description, type)',
|
||||
},
|
||||
}
|
||||
|
||||
def build(
|
||||
|
|
@ -47,24 +39,19 @@ class VectaraSelfQueryRetriverComponent(CustomComponent):
|
|||
llm: BaseLanguageModel,
|
||||
metadata_field_info: List[str],
|
||||
) -> BaseRetriever:
|
||||
|
||||
metadata_field_obj = []
|
||||
|
||||
for meta in metadata_field_info:
|
||||
meta_obj = json.loads(meta)
|
||||
if 'name' not in meta_obj or 'description' not in meta_obj or 'type' not in meta_obj :
|
||||
raise Exception('Incorrect metadata field info format.')
|
||||
if "name" not in meta_obj or "description" not in meta_obj or "type" not in meta_obj:
|
||||
raise Exception("Incorrect metadata field info format.")
|
||||
attribute_info = AttributeInfo(
|
||||
name = meta_obj['name'],
|
||||
description = meta_obj['description'],
|
||||
type = meta_obj['type'],
|
||||
name=meta_obj["name"],
|
||||
description=meta_obj["description"],
|
||||
type=meta_obj["type"],
|
||||
)
|
||||
metadata_field_obj.append(attribute_info)
|
||||
|
||||
return SelfQueryRetriever.from_llm(
|
||||
llm,
|
||||
vectorstore,
|
||||
document_content_description,
|
||||
metadata_field_obj,
|
||||
verbose=True
|
||||
)
|
||||
llm, vectorstore, document_content_description, metadata_field_obj, verbose=True
|
||||
)
|
||||
|
|
|
|||
|
|
@ -70,13 +70,7 @@ export default function ParameterComponent({
|
|||
const { setErrorData, modalContextOpen } = useContext(alertContext);
|
||||
const updateNodeInternals = useUpdateNodeInternals();
|
||||
const [position, setPosition] = useState(0);
|
||||
const {
|
||||
tabId,
|
||||
flows,
|
||||
nodes,
|
||||
edges,
|
||||
setNode,
|
||||
} = useContext(FlowsContext);
|
||||
const { tabId, flows, nodes, edges, setNode } = useContext(FlowsContext);
|
||||
|
||||
const flow = flows.find((flow) => flow.id === tabId)?.data?.nodes ?? null;
|
||||
|
||||
|
|
@ -133,8 +127,8 @@ export default function ParameterComponent({
|
|||
let newNode = cloneDeep(oldNode);
|
||||
|
||||
newNode.data = {
|
||||
...newNode.data
|
||||
}
|
||||
...newNode.data,
|
||||
};
|
||||
|
||||
newNode.data.node.template[name].value = newValue;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import { useContext, useState } from "react";
|
|||
import Loading from "../../../components/ui/loading";
|
||||
import { useSSE } from "../../../contexts/SSEContext";
|
||||
import { alertContext } from "../../../contexts/alertContext";
|
||||
import { typesContext } from "../../../contexts/typesContext";
|
||||
import { postBuildInit } from "../../../controllers/API";
|
||||
import { FlowType } from "../../../types/flow";
|
||||
|
||||
|
|
@ -36,10 +35,7 @@ export default function BuildTrigger({
|
|||
if (isBuilding) {
|
||||
return;
|
||||
}
|
||||
const errors = validateNodes(
|
||||
nodes,
|
||||
edges
|
||||
);
|
||||
const errors = validateNodes(nodes, edges);
|
||||
if (errors.length > 0) {
|
||||
setErrorData({
|
||||
title: "Oops! Looks like you missed something",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@ import { NodeType } from "../../types/flow";
|
|||
export default function Chat({ flow }: ChatType): JSX.Element {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [canOpen, setCanOpen] = useState(false);
|
||||
const { tabsState, isBuilt, setIsBuilt, isPending } = useContext(FlowsContext);
|
||||
const { tabsState, isBuilt, setIsBuilt, isPending } =
|
||||
useContext(FlowsContext);
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (event: KeyboardEvent) => {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import {
|
|||
updateFlowInDatabase,
|
||||
uploadFlowsToDatabase,
|
||||
} from "../controllers/API";
|
||||
import { APIClassType, APITemplateType } from "../types/api";
|
||||
import { APIClassType } from "../types/api";
|
||||
import { tweakType } from "../types/components";
|
||||
import {
|
||||
FlowType,
|
||||
|
|
@ -51,7 +51,6 @@ import {
|
|||
scapedJSONStringfy,
|
||||
updateEdgesHandleIds,
|
||||
updateIds,
|
||||
updateTemplate,
|
||||
} from "../utils/reactflowUtils";
|
||||
import {
|
||||
createRandomKey,
|
||||
|
|
@ -153,8 +152,7 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
|||
const onNodesChange = useCallback(
|
||||
(change: NodeChange[]) => {
|
||||
onNodesChangeInternal(change);
|
||||
if(!isPending)
|
||||
setPending(true);
|
||||
if (!isPending) setPending(true);
|
||||
},
|
||||
[onNodesChangeInternal, setPending, isPending]
|
||||
);
|
||||
|
|
@ -162,8 +160,7 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
|||
const onEdgesChange = useCallback(
|
||||
(edges: EdgeChange[]) => {
|
||||
onEdgesChangeInternal(edges);
|
||||
if(!isPending)
|
||||
setPending(true);
|
||||
if (!isPending) setPending(true);
|
||||
},
|
||||
[onEdgesChangeInternal, setPending, isPending]
|
||||
);
|
||||
|
|
@ -697,7 +694,11 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
|||
|
||||
const saveTimeoutId = useRef<NodeJS.Timeout | null>(null);
|
||||
|
||||
const saveCurrentFlow = (nodes: Node[], edges: Edge[], viewport: Viewport) => {
|
||||
const saveCurrentFlow = (
|
||||
nodes: Node[],
|
||||
edges: Edge[],
|
||||
viewport: Viewport
|
||||
) => {
|
||||
// Clear the previous timeout if it exists.
|
||||
if (saveTimeoutId.current) {
|
||||
clearTimeout(saveTimeoutId.current);
|
||||
|
|
@ -710,8 +711,7 @@ export function FlowsProvider({ children }: { children: ReactNode }) {
|
|||
saveFlow({ ...currentFlow, data: { nodes, edges, viewport } }, true);
|
||||
}
|
||||
}, 300); // Delay of 300ms.
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
async function saveFlow(flow?: FlowType, silent?: boolean) {
|
||||
let newFlow;
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ export function TypesProvider({ children }: { children: ReactNode }) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<typesContext.Provider
|
||||
value={{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import {
|
|||
useEffect,
|
||||
useState,
|
||||
} from "react";
|
||||
import { useReactFlow } from "reactflow";
|
||||
import {
|
||||
HistoryItem,
|
||||
UseUndoRedoOptions,
|
||||
|
|
@ -29,7 +28,8 @@ const defaultOptions: UseUndoRedoOptions = {
|
|||
export const undoRedoContext = createContext<undoRedoContextType>(initialValue);
|
||||
|
||||
export function UndoRedoProvider({ children }) {
|
||||
const { tabId, flows, setNodes, setEdges, nodes, edges } = useContext(FlowsContext);
|
||||
const { tabId, flows, setNodes, setEdges, nodes, edges } =
|
||||
useContext(FlowsContext);
|
||||
|
||||
const [past, setPast] = useState<HistoryItem[][]>(flows.map(() => []));
|
||||
const [future, setFuture] = useState<HistoryItem[][]>(flows.map(() => []));
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ import {
|
|||
} from "../../constants/constants";
|
||||
import { alertContext } from "../../contexts/alertContext";
|
||||
import { FlowsContext } from "../../contexts/flowsContext";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { NodeDataType } from "../../types/flow";
|
||||
import { FlowsState } from "../../types/tabs";
|
||||
import {
|
||||
convertObjToArray,
|
||||
convertValuesToNumbers,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import { Checkbox } from "../../components/ui/checkbox";
|
|||
import { EXPORT_DIALOG_SUBTITLE } from "../../constants/constants";
|
||||
import { alertContext } from "../../contexts/alertContext";
|
||||
import { FlowsContext } from "../../contexts/flowsContext";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { removeApiKeys } from "../../utils/reactflowUtils";
|
||||
import BaseModal from "../baseModal";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { useContext, useEffect, useRef, useState } from "react";
|
||||
import { alertContext } from "../../contexts/alertContext";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import { sendAllProps } from "../../types/api";
|
||||
import { ChatMessageType } from "../../types/chat";
|
||||
import { FlowType } from "../../types/flow";
|
||||
|
|
@ -383,10 +382,7 @@ export default function FormModal({
|
|||
}, [open]);
|
||||
|
||||
function sendMessage(): void {
|
||||
let nodeValidationErrors = validateNodes(
|
||||
nodes,
|
||||
edges
|
||||
);
|
||||
let nodeValidationErrors = validateNodes(nodes, edges);
|
||||
if (nodeValidationErrors.length === 0) {
|
||||
setLockChat(true);
|
||||
let inputs = tabsState[id.current].formKeysData.input_keys;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import { Checkbox } from "../../components/ui/checkbox";
|
|||
import { alertContext } from "../../contexts/alertContext";
|
||||
import { FlowsContext } from "../../contexts/flowsContext";
|
||||
import { StoreContext } from "../../contexts/storeContext";
|
||||
import { typesContext } from "../../contexts/typesContext";
|
||||
import {
|
||||
getStoreComponents,
|
||||
getStoreTags,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import ReactFlow, {
|
|||
SelectionDragHandler,
|
||||
addEdge,
|
||||
updateEdge,
|
||||
useReactFlow,
|
||||
} from "reactflow";
|
||||
import GenericNode from "../../../../CustomNodes/GenericNode";
|
||||
import Chat from "../../../../components/chatComponent";
|
||||
|
|
@ -29,7 +28,6 @@ import { typesContext } from "../../../../contexts/typesContext";
|
|||
import { undoRedoContext } from "../../../../contexts/undoRedoContext";
|
||||
import { APIClassType } from "../../../../types/api";
|
||||
import { FlowType, NodeType, targetHandleType } from "../../../../types/flow";
|
||||
import { FlowsState } from "../../../../types/tabs";
|
||||
import {
|
||||
generateFlow,
|
||||
generateNodeFromFlow,
|
||||
|
|
@ -72,7 +70,17 @@ export default function Page({
|
|||
const reactFlowWrapper = useRef<HTMLDivElement>(null);
|
||||
|
||||
const { takeSnapshot } = useContext(undoRedoContext);
|
||||
const { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange, setPending, saveFlow, isPending } = useContext(FlowsContext);
|
||||
const {
|
||||
nodes,
|
||||
edges,
|
||||
setNodes,
|
||||
setEdges,
|
||||
onNodesChange,
|
||||
onEdgesChange,
|
||||
setPending,
|
||||
saveFlow,
|
||||
isPending,
|
||||
} = useContext(FlowsContext);
|
||||
|
||||
const position = useRef({ x: 0, y: 0 });
|
||||
const [lastSelection, setLastSelection] =
|
||||
|
|
@ -136,11 +144,7 @@ export default function Page({
|
|||
document.removeEventListener("keydown", onKeyDown);
|
||||
document.removeEventListener("mousemove", handleMouseMove);
|
||||
};
|
||||
}, [
|
||||
lastCopiedSelection,
|
||||
lastSelection,
|
||||
takeSnapshot,
|
||||
]);
|
||||
}, [lastCopiedSelection, lastSelection, takeSnapshot]);
|
||||
|
||||
const [selectionMenuVisible, setSelectionMenuVisible] = useState(false);
|
||||
|
||||
|
|
@ -155,10 +159,12 @@ export default function Page({
|
|||
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
if(reactFlowInstance){
|
||||
if (reactFlowInstance) {
|
||||
reactFlowInstance.setNodes(flow?.data?.nodes ?? []);
|
||||
reactFlowInstance.setEdges(flow?.data?.edges ?? []);
|
||||
reactFlowInstance.setViewport(flow?.data?.viewport ?? { zoom: 1, x: 0, y: 0 });
|
||||
reactFlowInstance.setViewport(
|
||||
flow?.data?.viewport ?? { zoom: 1, x: 0, y: 0 }
|
||||
);
|
||||
}
|
||||
|
||||
// Clear the previous timeout
|
||||
|
|
@ -370,8 +376,7 @@ export default function Page({
|
|||
}, []);
|
||||
|
||||
const onMove = useCallback(() => {
|
||||
if(!isPending)
|
||||
setPending(true);
|
||||
if (!isPending) setPending(true);
|
||||
}, [setPending]);
|
||||
|
||||
return (
|
||||
|
|
@ -479,9 +484,7 @@ export default function Page({
|
|||
}}
|
||||
/>
|
||||
</ReactFlow>
|
||||
{!view && (
|
||||
<Chat flow={flow} />
|
||||
)}
|
||||
{!view && <Chat flow={flow} />}
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { cloneDeep } from "lodash";
|
||||
import { useContext, useEffect, useState } from "react";
|
||||
import { useReactFlow } from "reactflow";
|
||||
import ShadTooltip from "../../../../components/ShadTooltipComponent";
|
||||
import IconComponent from "../../../../components/genericIconComponent";
|
||||
import {
|
||||
|
|
@ -64,7 +63,16 @@ export default function NodeToolbarComponent({
|
|||
const isMinimal = canMinimize();
|
||||
const isGroup = data.node?.flow ? true : false;
|
||||
|
||||
const { paste, saveComponent, version, flows, nodes, edges, setNodes, setEdges } = useContext(FlowsContext);
|
||||
const {
|
||||
paste,
|
||||
saveComponent,
|
||||
version,
|
||||
flows,
|
||||
nodes,
|
||||
edges,
|
||||
setNodes,
|
||||
setEdges,
|
||||
} = useContext(FlowsContext);
|
||||
const { takeSnapshot } = useContext(undoRedoContext);
|
||||
const [showModalAdvanced, setShowModalAdvanced] = useState(false);
|
||||
const [showconfirmShare, setShowconfirmShare] = useState(false);
|
||||
|
|
@ -155,8 +163,10 @@ export default function NodeToolbarComponent({
|
|||
{
|
||||
x: 50,
|
||||
y: 10,
|
||||
paneX: nodes.find((node) => node.id === data.id)?.position.x,
|
||||
paneY: nodes.find((node) => node.id === data.id)?.position.y,
|
||||
paneX: nodes.find((node) => node.id === data.id)?.position
|
||||
.x,
|
||||
paneY: nodes.find((node) => node.id === data.id)?.position
|
||||
.y,
|
||||
}
|
||||
);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -19,16 +19,17 @@ type RFState = {
|
|||
onNodesChange: OnNodesChange;
|
||||
onEdgesChange: OnEdgesChange;
|
||||
onConnect: OnConnect;
|
||||
setEdges: (edges: Edge[]) => void;
|
||||
setNodes: (nodes: Node[]) => void;
|
||||
deleteNode: (nodeId: string) => void;
|
||||
deleteEdge: (edgeId: string) => void;
|
||||
isBuilt: boolean;
|
||||
};
|
||||
|
||||
// this is our useStore hook that we can use in our components to get parts of the store and call actions
|
||||
const useStore = create<RFState>((set, get) => ({
|
||||
nodes: [],
|
||||
edges: [],
|
||||
isBuilt: false,
|
||||
copiedSelection: { nodes: [], edges: [] },
|
||||
onNodesChange: (changes: NodeChange[]) => {
|
||||
set({
|
||||
nodes: applyNodeChanges(changes, get().nodes),
|
||||
|
|
@ -44,8 +45,6 @@ const useStore = create<RFState>((set, get) => ({
|
|||
edges: addEdge(connection, get().edges),
|
||||
});
|
||||
},
|
||||
setEdges: (edges) => set({ edges }),
|
||||
setNodes: (nodes) => set({ nodes }),
|
||||
deleteNode: (nodeId) => {
|
||||
set({
|
||||
nodes: get().nodes.filter((node) => node.id !== nodeId),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { FlowType } from "../flow";
|
||||
|
||||
export type ChatType = { flow: FlowType; };
|
||||
export type ChatType = { flow: FlowType };
|
||||
export type ChatMessageType = {
|
||||
message: string | Object;
|
||||
template?: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { XYPosition, Node, NodeChange, Edge, EdgeChange } from "reactflow";
|
||||
import { Edge, EdgeChange, Node, NodeChange, XYPosition } from "reactflow";
|
||||
import { tweakType } from "../components";
|
||||
import { FlowType, NodeDataType } from "../flow";
|
||||
import { Dispatch, SetStateAction } from "react";
|
||||
|
||||
type OnChange<ChangesType> = (changes: ChangesType[]) => void;
|
||||
|
||||
|
|
@ -46,7 +45,9 @@ export type FlowsContextType = {
|
|||
isPending: boolean;
|
||||
setPending: (pending: boolean) => void;
|
||||
tabsState: FlowsState;
|
||||
setTabsState: (update: FlowsState | ((oldState: FlowsState) => FlowsState)) => void;
|
||||
setTabsState: (
|
||||
update: FlowsState | ((oldState: FlowsState) => FlowsState)
|
||||
) => void;
|
||||
paste: (
|
||||
selection: { nodes: any; edges: any },
|
||||
position: { x: number; y: number; paneX?: number; paneY?: number }
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ export function unselectAllNodes({ updateNodes, data }: unselectAllNodesType) {
|
|||
export function isValidConnection(
|
||||
{ source, target, sourceHandle, targetHandle }: Connection,
|
||||
nodes: Node[],
|
||||
edges: Edge[],
|
||||
edges: Edge[]
|
||||
) {
|
||||
const targetHandleObject: targetHandleType = scapeJSONParse(targetHandle!);
|
||||
const sourceHandleObject: sourceHandleType = scapeJSONParse(sourceHandle!);
|
||||
|
|
@ -98,16 +98,12 @@ export function isValidConnection(
|
|||
) {
|
||||
let targetNode = nodes.find((node) => node.id === target!)?.data?.node;
|
||||
if (!targetNode) {
|
||||
if (
|
||||
!edges
|
||||
.find((e) => e.targetHandle === targetHandle)
|
||||
) {
|
||||
if (!edges.find((e) => e.targetHandle === targetHandle)) {
|
||||
return true;
|
||||
}
|
||||
} else if (
|
||||
(!targetNode.template[targetHandleObject.fieldName].list &&
|
||||
!edges
|
||||
.find((e) => e.targetHandle === targetHandle)) ||
|
||||
!edges.find((e) => e.targetHandle === targetHandle)) ||
|
||||
targetNode.template[targetHandleObject.fieldName].list
|
||||
) {
|
||||
return true;
|
||||
|
|
@ -505,7 +501,7 @@ export function generateFlow(
|
|||
edges: Edge[],
|
||||
name: string
|
||||
): generateFlowType {
|
||||
const newFlowData = {nodes, edges, viewport: { zoom: 1, x: 0, y: 0 }};
|
||||
const newFlowData = { nodes, edges, viewport: { zoom: 1, x: 0, y: 0 } };
|
||||
const uid = new ShortUniqueId({ length: 5 });
|
||||
/* remove edges that are not connected to selected nodes on both ends
|
||||
in future we can save this edges to when ungrouping reconect to the old nodes
|
||||
|
|
@ -539,14 +535,10 @@ export function generateFlow(
|
|||
export function filterFlow(
|
||||
selection: OnSelectionChangeParams,
|
||||
setNodes: (update: Node[] | ((oldState: Node[]) => Node[])) => void,
|
||||
setEdges: (update: Edge[] | ((oldState: Edge[]) => Edge[])) => void,
|
||||
setEdges: (update: Edge[] | ((oldState: Edge[]) => Edge[])) => void
|
||||
) {
|
||||
setNodes((nodes) =>
|
||||
nodes.filter((node) => !selection.nodes.includes(node))
|
||||
);
|
||||
setEdges((edges) =>
|
||||
edges.filter((edge) => !selection.edges.includes(edge))
|
||||
);
|
||||
setNodes((nodes) => nodes.filter((node) => !selection.nodes.includes(node)));
|
||||
setEdges((edges) => edges.filter((edge) => !selection.edges.includes(edge)));
|
||||
}
|
||||
|
||||
export function findLastNode({ nodes, edges }: findLastNodeType) {
|
||||
|
|
@ -572,7 +564,7 @@ export function updateFlowPosition(NewPosition: XYPosition, flow: FlowType) {
|
|||
export function concatFlows(
|
||||
flow: FlowType,
|
||||
setNodes: (update: Node[] | ((oldState: Node[]) => Node[])) => void,
|
||||
setEdges: (update: Edge[] | ((oldState: Edge[]) => Edge[])) => void,
|
||||
setEdges: (update: Edge[] | ((oldState: Edge[]) => Edge[])) => void
|
||||
) {
|
||||
const { nodes, edges } = flow.data!;
|
||||
setNodes((old) => [...old, ...nodes]);
|
||||
|
|
|
|||
|
|
@ -578,4 +578,4 @@ def test_async_task_processing_vector_store(client, added_vector_store, created_
|
|||
# Validate that the task completed successfully and the result is as expected
|
||||
assert "result" in task_status_json, task_status_json
|
||||
assert "output" in task_status_json["result"], task_status_json["result"]
|
||||
assert "Langflow" in task_status_json["result"]["output"], task_status_json["result"]
|
||||
assert "Langflow" in task_status_json["result"]["output"], task_status_json["result"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue