Skip to content

Commit 2de4c80

Browse files
committed
check that the message content is a string before calling strip()
1 parent 38a95aa commit 2de4c80

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

interpreter/core/llm/utils/convert_to_openai_messages.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ def convert_to_openai_messages(
170170
else:
171171
raise Exception(f"Unable to convert this message type: {message}")
172172

173-
new_message["content"] = new_message["content"].strip()
173+
if isinstance(new_message["content"], str):
174+
new_message["content"] = new_message["content"].strip()
174175

175176
new_messages.append(new_message)
176177

0 commit comments

Comments
 (0)