From 7f8867f7878703fed617dd7f1a4fa4fc131068fd Mon Sep 17 00:00:00 2001 From: killian <63927363+KillianLucas@users.noreply.github.com> Date: Fri, 27 Oct 2023 01:29:48 -0700 Subject: [PATCH] run_code -> execute (function name) --- interpreter/core/core.py | 1 - interpreter/utils/convert_to_openai_messages.py | 4 ++-- tests/test_interpreter.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/interpreter/core/core.py b/interpreter/core/core.py index c744e33bea..c2dd58271a 100644 --- a/interpreter/core/core.py +++ b/interpreter/core/core.py @@ -11,7 +11,6 @@ from ..terminal_interface.terminal_interface import terminal_interface from ..terminal_interface.validate_llm_settings import validate_llm_settings from .generate_system_message import generate_system_message -import appdirs import os from datetime import datetime from ..rag.get_relevant_procedures_string import get_relevant_procedures_string diff --git a/interpreter/utils/convert_to_openai_messages.py b/interpreter/utils/convert_to_openai_messages.py index f31a391149..5e0d2ff873 100644 --- a/interpreter/utils/convert_to_openai_messages.py +++ b/interpreter/utils/convert_to_openai_messages.py @@ -15,7 +15,7 @@ def convert_to_openai_messages(messages, function_calling=True): if "code" in message: if function_calling: new_message["function_call"] = { - "name": "run_code", + "name": "execute", "arguments": json.dumps({ "language": message["language"], "code": message["code"] @@ -37,7 +37,7 @@ def convert_to_openai_messages(messages, function_calling=True): if function_calling: new_messages.append({ "role": "function", - "name": "run_code", + "name": "execute", "content": message["output"] }) else: diff --git a/tests/test_interpreter.py b/tests/test_interpreter.py index ad95506302..0a13a6deab 100644 --- a/tests/test_interpreter.py +++ b/tests/test_interpreter.py @@ -124,7 +124,7 @@ def test_math(): def test_delayed_exec(): interpreter.chat( - """Can you write a single block of code and run_code it that prints something, then delays 1 second, then prints something else? No talk just code. Thanks!""" + """Can you write a single block of code and execute it that prints something, then delays 1 second, then prints something else? No talk just code. Thanks!""" ) @pytest.mark.skip(reason="This works fine when I run it but fails frequently in Github Actions... will look into it after the hackathon")