🐛 fix(utils.py): fix try_setting_streaming_options function to correctly set streaming attribute
The try_setting_streaming_options function now correctly sets the streaming attribute of the llm object to True if it is an instance of BaseLanguageModel and has the streaming attribute. This fixes a bug where the streaming attribute was not being set correctly.
This commit is contained in:
parent
4848759aeb
commit
5f25bb0d58
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue