mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): fix streaming delta content being none edge-case
This commit is contained in:
parent
b01f31c41f
commit
60cc3d6b30
1 changed files with 4 additions and 1 deletions
|
@ -7487,7 +7487,10 @@ class CustomStreamWrapper:
|
|||
logprobs = None
|
||||
original_chunk = None # this is used for function/tool calling
|
||||
if len(str_line.choices) > 0:
|
||||
if str_line.choices[0].delta.content is not None:
|
||||
if (
|
||||
str_line.choices[0].delta is not None
|
||||
and str_line.choices[0].delta.content is not None
|
||||
):
|
||||
text = str_line.choices[0].delta.content
|
||||
else: # function/tool calling chunk - when content is None. in this case we just return the original chunk from openai
|
||||
original_chunk = str_line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue