From 43e69f1f4575f8fb1136c5393a247b4ced311ae4 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 10 Jul 2023 16:29:39 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix(types.py):=20fix=20varia?= =?UTF-8?q?ble=20name=20in=20format=20method=20to=20correctly=20reference?= =?UTF-8?q?=20the=20'artifacts'=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/graph/vertex/types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/langflow/graph/vertex/types.py b/src/backend/langflow/graph/vertex/types.py index 9c02ef847..17481b8a0 100644 --- a/src/backend/langflow/graph/vertex/types.py +++ b/src/backend/langflow/graph/vertex/types.py @@ -225,7 +225,7 @@ class PromptVertex(Vertex): # so the prompt format doesn't break artifacts.pop("handle_keys", None) try: - return self._built_object.format(**self.artifacts) + return self._built_object.format(**artifacts) except KeyError: return super()._built_object_repr() else: From 5d42acf28d2e140727047b78e17527e886926a10 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Mon, 10 Jul 2023 16:41:23 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix(utils.ts):=20add=20optio?= =?UTF-8?q?nal=20chaining=20to=20reactFlowInstance.getNode()=20to=20handle?= =?UTF-8?q?=20cases=20where=20reactFlowInstance=20is=20null=20or=20undefin?= =?UTF-8?q?ed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/utils.ts b/src/frontend/src/utils.ts index 4fc7cb016..d44bdf5e6 100644 --- a/src/frontend/src/utils.ts +++ b/src/frontend/src/utils.ts @@ -598,7 +598,7 @@ export function isValidConnection( ) || targetHandle.split("|")[0] === "str" ) { - let targetNode = reactFlowInstance.getNode(target).data.node; + let targetNode = reactFlowInstance?.getNode(target)?.data?.node; if (!targetNode) { if ( !reactFlowInstance