Fix issue with empty content in create_chat_completion_content function

This commit is contained in:
bobo 2024-01-29 16:19:31 +08:00
parent 5d156e55b2
commit c83058cbea

View File

@ -53,6 +53,6 @@ def create_chat_completion_content(client: Optional[OpenAI] = None, **kwargs) ->
for chunk in chunks:
if chunk.choices[0].finish_reason == "stop":
break
results.append(chunk.choices[0].delta.content)
results.append(chunk.choices[0].delta.content or "")
return "".join(results)