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 (
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
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
::: Code interpreter with Python agent
:::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 pressEnter
- Wait for the code to be executed, and then you will see the result
::: Code interpreter with Claude 3.5 Sonnet agent
:::