OpenInterpreter / open-interpreter

A natural language interface for computers
http://openinterpreter.com/
GNU Affero General Public License v3.0
50.66k stars 4.42k forks source link

VSCode terminal does not offer code execution y/n option #1209

Open jackokring opened 2 months ago

jackokring commented 2 months ago

Describe the bug

Python code is emitted, but no option to execute it.

Reproduce

  1. interpreter in the vs code terminal.

Expected behavior

Not this

πŸ’€ 70% ❯ i

β–Œ Model set to gpt-3.5-turbo                                                                                                                          

Open Interpreter will require approval before running code.                                                                                             

Use interpreter -y to bypass this.                                                                                                                      

Press CTRL-C to exit.                                                                                                                                   

> %%ls

> add the first 20 primes

                                                                          Plan                                                                          

   1 Write a program in Python to find the first 20 prime numbers.                                                                                      
   2 Execute the Python program to calculate and display the first 20 prime numbers.                                                                    

                                                                 Python Implementation                                                                  

   # Function to check if a number is prime                                                                                                             
   def is_prime(num):                                                                                                                                   
       if num < 2:                                                                                                                                      
           return False                                                                                                                                 
       for i in range(2, int(num**0.5)+1):                                                                                                              
           if num % i == 0:                                                                                                                             
               return False                                                                                                                             
       return True                                                                                                                                      

   # Find the first 20 prime numbers                                                                                                                    
   primes = []                                                                                                                                          
   num = 2                                                                                                                                              
   while len(primes) < 20:                                                                                                                              
       if is_prime(num):                                                                                                                                
           primes.append(num)                                                                                                                           
       num += 1                                                                                                                                         

   primes                                                                                                                                               

>

Screenshots

No response

Open Interpreter version

0.2.4

Python version

3.11.2

Operating System name and version

Chromebook Debian Bookworm arm64 vs code terminal

Additional context

No response