Merge pull request #58 from devchat-ai/fix_chunk_content_none
Fix empty content issue in create_chat_completion_content function
This commit is contained in:
commit
bcba74375b
@ -53,6 +53,6 @@ def create_chat_completion_content(client: Optional[OpenAI] = None, **kwargs) ->
|
|||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
if chunk.choices[0].finish_reason == "stop":
|
if chunk.choices[0].finish_reason == "stop":
|
||||||
break
|
break
|
||||||
results.append(chunk.choices[0].delta.content)
|
results.append(chunk.choices[0].delta.content or "")
|
||||||
|
|
||||||
return "".join(results)
|
return "".join(results)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user