Skip to content

Commit af74afc

Browse files
authored
fix: streaming response (#34)
1 parent 0cfd72a commit af74afc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ovos_solver_openai_persona/engines.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ def _do_streaming_api_request(self, messages):
219219
break
220220
if "content" not in chunk["choices"][0]["delta"]:
221221
continue
222-
yield chunk["choices"][0]["delta"]["content"]
222+
text = chunk["choices"][0]["delta"]["content"]
223+
if text is not None:
224+
yield text
223225

224226
def get_chat_history(self, system_prompt=None):
225227
"""

0 commit comments

Comments
 (0)