mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix(factory.py): handle assistant null content
This commit is contained in:
parent
75ed22d391
commit
6333b04be3
1 changed files with 3 additions and 1 deletions
|
|
@ -1705,7 +1705,9 @@ def cohere_messages_pt_v2(
|
|||
for m in messages[msg_i]["content"]:
|
||||
if m.get("type", "") == "text":
|
||||
assistant_content += m["text"]
|
||||
else:
|
||||
elif messages[msg_i].get("content") is not None and isinstance(
|
||||
messages[msg_i]["content"], str
|
||||
):
|
||||
assistant_content += messages[msg_i]["content"]
|
||||
if messages[msg_i].get(
|
||||
"tool_calls", []
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue