fix handle_openai_chat_completion_chunk

This commit is contained in:
Ishaan Jaff 2024-06-26 16:01:50 -07:00
parent eedbf8a016
commit 392d68e7b9

View file

@ -8301,7 +8301,7 @@ class CustomStreamWrapper:
logprobs = None
usage = None
original_chunk = None # this is used for function/tool calling
if len(str_line.choices) > 0:
if str_line and str_line.choices and len(str_line.choices) > 0:
if (
str_line.choices[0].delta is not None
and str_line.choices[0].delta.content is not None