properly yield non-streaming responses

This commit is contained in:
Mehmet Bektas 2024-04-25 14:46:49 -07:00 committed by Chris Weaver
parent 648f2d06bf
commit ee6b8b7f50

View File

@ -72,7 +72,8 @@ class LangChainChatLLM(LLM, abc.ABC):
self._log_prompt(prompt)
if DISABLE_LITELLM_STREAMING:
return [self.invoke(prompt)]
yield self.invoke(prompt)
return
output_tokens = []
for token in message_generator_to_string_generator(self.llm.stream(prompt)):