forked from phoenix/litellm-mirror
Update utils.py
Fix for creating an empty choices if no choices passed in
This commit is contained in:
parent
9201c122e7
commit
79201449d2
1 changed files with 4 additions and 1 deletions
|
@ -497,7 +497,10 @@ class ModelResponse(OpenAIObject):
|
||||||
object = "embedding"
|
object = "embedding"
|
||||||
else:
|
else:
|
||||||
object = "chat.completion"
|
object = "chat.completion"
|
||||||
choices = [Choices(*choices)]
|
if choices:
|
||||||
|
choices = [Choices(*choices)]
|
||||||
|
else:
|
||||||
|
choices = [Choices()]
|
||||||
if id is None:
|
if id is None:
|
||||||
id = _generate_id()
|
id = _generate_id()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue