mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
update factory.py
This commit is contained in:
parent
4c7d94b2b4
commit
c85018c780
1 changed files with 2 additions and 2 deletions
|
|
@ -695,6 +695,8 @@ def anthropic_messages_pt_xml(messages: list):
|
|||
assistant_text = (
|
||||
messages[msg_i].get("content") or ""
|
||||
) # either string or none
|
||||
if assistant_text:
|
||||
assistant_content.append({"type": "text", "text": assistant_text})
|
||||
if messages[msg_i].get(
|
||||
"tool_calls", []
|
||||
): # support assistant tool invoke convertion
|
||||
|
|
@ -703,8 +705,6 @@ def anthropic_messages_pt_xml(messages: list):
|
|||
messages[msg_i]["tool_calls"]
|
||||
)
|
||||
)
|
||||
|
||||
assistant_content.append({"type": "text", "text": assistant_text})
|
||||
msg_i += 1
|
||||
|
||||
if assistant_content:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue