mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-23 03:15:50 +02:00
properly yield non-streaming responses
This commit is contained in:
committed by
Chris Weaver
parent
648f2d06bf
commit
ee6b8b7f50
@@ -72,7 +72,8 @@ class LangChainChatLLM(LLM, abc.ABC):
|
|||||||
self._log_prompt(prompt)
|
self._log_prompt(prompt)
|
||||||
|
|
||||||
if DISABLE_LITELLM_STREAMING:
|
if DISABLE_LITELLM_STREAMING:
|
||||||
return [self.invoke(prompt)]
|
yield self.invoke(prompt)
|
||||||
|
return
|
||||||
|
|
||||||
output_tokens = []
|
output_tokens = []
|
||||||
for token in message_generator_to_string_generator(self.llm.stream(prompt)):
|
for token in message_generator_to_string_generator(self.llm.stream(prompt)):
|
||||||
|
Reference in New Issue
Block a user