From aa575119e63defba7cc2deebe3b1a91396bdb965 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 22 Jan 2024 04:38:43 -0800 Subject: [PATCH] API: minor fix --- extensions/openai/completions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/openai/completions.py b/extensions/openai/completions.py index 810583e1..bbc291f4 100644 --- a/extensions/openai/completions.py +++ b/extensions/openai/completions.py @@ -154,7 +154,7 @@ def convert_history(history): system_message = "" # Multimodal: convert OpenAI format to multimodal extension format - if any(isinstance(entry['content'], list) for entry in history): + if any('content' in entry and isinstance(entry['content'], list) for entry in history): new_history = [] for entry in history: if isinstance(entry['content'], list):