From 5f25bb0d580de827722043b85a408bbf1812d6c5 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sun, 28 May 2023 17:25:27 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(utils.py):=20fix=20try=5Fset?= =?UTF-8?q?ting=5Fstreaming=5Foptions=20function=20to=20correctly=20set=20?= =?UTF-8?q?streaming=20attribute=20The=20try=5Fsetting=5Fstreaming=5Foptio?= =?UTF-8?q?ns=20function=20now=20correctly=20sets=20the=20streaming=20attr?= =?UTF-8?q?ibute=20of=20the=20llm=20object=20to=20True=20if=20it=20is=20an?= =?UTF-8?q?=20instance=20of=20BaseLanguageModel=20and=20has=20the=20stream?= =?UTF-8?q?ing=20attribute.=20This=20fixes=20a=20bug=20where=20the=20strea?= =?UTF-8?q?ming=20attribute=20was=20not=20being=20set=20correctly.?= 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 7368fda3e..2b7c5acd1 100644 --- a/src/backend/langflow/interface/utils.py +++ b/src/backend/langflow/interface/utils.py @@ -44,7 +44,7 @@ def try_setting_streaming_options(langchain_object, websocket): langchain_object.llm_chain, "llm" ): llm = langchain_object.llm_chain.llm - if isinstance(llm, BaseLanguageModel): - llm.streaming = bool(hasattr(llm, "streaming")) + if isinstance(llm, BaseLanguageModel) and hasattr(llm, "streaming"): + llm.streaming = True return langchain_object