forked from phoenix/litellm-mirror
fix: add missing tool_calls and function name to messages in mistral_api_pt
This commit is contained in:
parent
fa8a9568aa
commit
a3f90ab735
1 changed files with 6 additions and 0 deletions
|
@ -145,6 +145,12 @@ def mistral_api_pt(messages):
|
||||||
elif isinstance(m["content"], str):
|
elif isinstance(m["content"], str):
|
||||||
texts = m["content"]
|
texts = m["content"]
|
||||||
new_m = {"role": m["role"], "content": texts}
|
new_m = {"role": m["role"], "content": texts}
|
||||||
|
|
||||||
|
if new_m["role"] == "tool" and m.get("name"):
|
||||||
|
new_m["name"] = m["name"]
|
||||||
|
if m.get("tool_calls"):
|
||||||
|
new_m["tool_calls"] = m["tool_calls"]
|
||||||
|
|
||||||
new_messages.append(new_m)
|
new_messages.append(new_m)
|
||||||
return new_messages
|
return new_messages
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue