From dfac742324807b664a2cfee92a1b278a21957efa Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Wed, 13 Mar 2024 11:34:45 -0700 Subject: [PATCH] fix(factory.py): fix mistral api prompt formatting --- litellm/llms/prompt_templates/factory.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index 97caa9389c5..9be8970489f 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -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