From 8e2bacad9a1acbe17b3497adc5024239e5f06779 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Thu, 8 Jun 2023 00:40:51 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(utils.py):=20add=20type=20ch?= =?UTF-8?q?eck=20for=20streaming=20and=20stream=20attributes=20before=20se?= =?UTF-8?q?tting=20them=20to=20True=20The=20code=20now=20checks=20if=20the?= =?UTF-8?q?=20streaming=20and=20stream=20attributes=20are=20boolean=20befo?= =?UTF-8?q?re=20setting=20them=20to=20True.=20This=20ensures=20that=20the?= =?UTF-8?q?=20attributes=20are=20not=20set=20to=20True=20if=20they=20are?= =?UTF-8?q?=20not=20boolean,=20which=20could=20cause=20errors=20in=20the?= =?UTF-8?q?=20code.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/interface/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/langflow/interface/utils.py b/src/backend/langflow/interface/utils.py index 3437df0ee..08d6ebde3 100644 --- a/src/backend/langflow/interface/utils.py +++ b/src/backend/langflow/interface/utils.py @@ -46,9 +46,9 @@ def try_setting_streaming_options(langchain_object, websocket): llm = langchain_object.llm_chain.llm if isinstance(llm, BaseLanguageModel): - if hasattr(llm, "streaming"): + if hasattr(llm, "streaming") and isinstance(llm.streaming, bool): llm.streaming = True - if hasattr(llm, "stream"): + elif hasattr(llm, "stream") and isinstance(llm.stream, bool): llm.stream = True return langchain_object