From 995fdc3415095bf5e60e25bafe57d46459a59826 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 29 Jun 2023 15:17:52 -0700 Subject: [PATCH] accept lists even when we asked for strings --- aider/coders/editblock_func_coder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/coders/editblock_func_coder.py b/aider/coders/editblock_func_coder.py index e579ec457..676952938 100644 --- a/aider/coders/editblock_func_coder.py +++ b/aider/coders/editblock_func_coder.py @@ -121,8 +121,10 @@ class EditBlockFunctionCoder(Coder): original = get_arg(edit, "original_lines") updated = get_arg(edit, "updated_lines") - if self.code_format == "list": + # gpt-3.5 returns lists even when instructed to return a string! + if self.code_format == "list" or type(original) == list: original = "\n".join(original) + if self.code_format == "list" or type(updated) == list: updated = "\n".join(updated) if original and not original.endswith("\n"):