Skip to main content

Code Interpreter

The Code Interpreter allows you to execute code within the code blocks provided by agents in the CodeGPT chat.

How to configure:

  • Go to Marketplace on VSCode Extension
  • Search and install agents with this icon (for instance, Python, Claude 3.5 Sonnet, GPT-4o)
  • Back to the Main Menu
  • Choose CodeGPT Plus as Provider
  • Select the agent with the Code Interpreter functions installed in the previous step

How to use

CodeGPT: Refactor CodeGPT

To use this feature, log in with your CodeGPT account, and you will have limited daily free interactions. You can subscribe to one of our plans to get many more interactions and access the selected AI models without worrying about creating API keys or accounts with each provider (we make it easy for you!). In case you want to use CodeGPT for free, you must add your own API key from the desired provider (e.g., Anthropic, OpenAI) and you will pay for the consumption directly to them.

Case 1: Select code from the editor and then ask the Agent to create code. For example, Violin plot.

  • Select the code from Workspace. Example:
#Context:
import numpy as np
# Sample data for three categories
category1 = np.random.normal(loc=0, scale=1, size=100) # Normal distribution centered at 0
category2 = np.random.normal(loc=5, scale=1.5, size=100) # Normal distribution centered at 5
category3 = np.random.normal(loc=10, scale=2, size=100) # Normal distribution centered at 10

data = [category1, category2, category3]
  • Make a prompt on CodeGPT chat. Example: create a Violin plot
  • Wait for the code to be executed and click on Run icon

:::

Case 2: Using the slash icon / on the chat box

  • On the chat box, write / to show the Code-Interpreter option
  • Send the request or press Enter
  • Wait for the code to be executed, and then you will see the result

::: Code interpreter with Claude 3.5 Sonnet agent

:::