open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

Claude 3.5 Sonnet cannot execute code

Open thecosmicskye opened this issue 1 year ago • 8 comments

Describe the bug

Code does not execute

Reproduce

  1. Run interpreter --context_window 200000 --max_tokens 4000 --model claude-3-5-sonnet-20240620 --api_key xxxx -y
  2. Say please run a test command for me

Expected behavior

Should execute the code

Screenshots

please run a test command for me

  Certainly! I'd be happy to run a test command for you. Let's start with a simple Python command to print a "Hello,
  World!" message. This will help us confirm that the code execution is working correctly.

  Here's the plan:

   1 Write a simple Python script to print "Hello, World!"
   2 Execute the script using the provided execute function
   3 Observe the output

  Let's proceed with the plan:


   execute("python", "print('Hello, World!')")


  This command should execute a Python script that prints "Hello, World!" to the console. Let's see the output.

  Now, let's recap the plan:

   1 We wrote a simple Python script to print "Hello, World!"
   2 We executed the script using the provided execute function
   3 We should now observe the output

  If you see "Hello, World!" printed in the output, it means the test command was successful, and the code execution
  is working as expected. Is there anything else you'd like me to test or any other commands you'd like me to run?

> didn't work, make sure you execute the code

  I apologize for the oversight. You're absolutely right, and I thank you for pointing that out. Let's correct this
  and actually execute the code.

  Here's our revised plan:

   1 Write a simple Python script to print "Hello, World!"
   2 Actually execute the script using the provided execute function
   3 Observe the output

  Now, let's execute the code:


   execute("python", "print('Hello, World!')")


  Let's recap our plan:

   1 We've written a simple Python script to print "Hello, World!"
   2 We've now actually executed the script using the execute function
   3 We should now be able to observe the output

  You should see "Hello, World!" printed in the output. This test command should confirm that code execution is
  working correctly.

  If you see the expected output, great! If not, or if you'd like me to try something else, please let me know, and
  I'll be happy to assist further.

>

Open Interpreter version

0.3.3

Python version

3.11.9

Operating System name and version

Ubuntu 22.04.4 LTS (GNU/Linux 5.15.153.1-microsoft-standard-WSL2 x86_64)

Additional context

No response

thecosmicskye avatar Jun 23 '24 18:06 thecosmicskye

try run with --no-llm_supports_functions

aj47 avatar Jun 24 '24 11:06 aj47

try run with --no-llm_supports_functions

Tried this, ran into more problems. See https://github.com/OpenInterpreter/open-interpreter/issues/1323

benjaminjamesbush avatar Jun 25 '24 06:06 benjaminjamesbush

still seems to be an ongoing issue :(

automationconsulting avatar Jul 10 '24 15:07 automationconsulting

I found that if you ask it to wrap the command in ``` it works. It appears code wrapped in backticks triggers the command execution script and the issue is due to claude not properly formatting the command to run, or trying to use some execute command directly (likely from misunderstanding the prompt or just making sh&%^ up).

transcendr avatar Jul 30 '24 09:07 transcendr

I'm struggling with 3.5 sonnet too. Even with your technics barely fail to execute code

thibaud57 avatar Aug 07 '24 20:08 thibaud57