fix(factory.py): fix mistral api prompt formatting

This commit is contained in:
Krrish Dholakia 2024-03-13 11:34:45 -07:00
parent ac867daadc
commit dfac742324

View file

@ -137,6 +137,8 @@ def mistral_api_pt(messages):
return messages
elif c["type"] == "text" and isinstance(c["text"], str):
texts += c["text"]
elif isinstance(m["content"], str):
texts = m["content"]
new_m = {"role": m["role"], "content": texts}
new_messages.append(new_m)
return new_messages