From 5ec118cc6f460a5250a62e725539924c737fc64e Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 26 Sep 2023 20:06:38 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(custom=5Fcomponent.py):=20im?= =?UTF-8?q?prove=20error=20message=20formatting=20for=20type=20hint=20erro?= =?UTF-8?q?r=20in=20build=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error message for a type hint error in the build method was improved to provide clearer instructions. The traceback message was updated to suggest using PromptTemplate instead of Prompt type. This change improves the readability and usability of the error message. --- src/backend/langflow/interface/custom/custom_component.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/interface/custom/custom_component.py b/src/backend/langflow/interface/custom/custom_component.py index b0c4f8752..ccc0b08b2 100644 --- a/src/backend/langflow/interface/custom/custom_component.py +++ b/src/backend/langflow/interface/custom/custom_component.py @@ -102,7 +102,10 @@ class CustomComponent(Component, extra=Extra.allow): status_code=400, detail={ "error": "Type hint Error", - "traceback": "Prompt type is not supported in the build method. Try using PromptTemplate instead.", + "traceback": ( + "Prompt type is not supported in the build method." + " Try using PromptTemplate instead." + ), }, ) return args