Code Interpreter
codeinterpreterCodeInterpreter extends Python-based coding environments with integrated data analysis, enabling developers to run scripts, visualize results, and prototype solutions inside supported platforms
Acciones disponibles (5)
Cada acción es una operación que el agente puede ejecutar contra este conector. Haz clic en una acción para ver sus parámetros.
Create SandboxCODEINTERPRETER_CREATE_SANDBOXAcciónCreate a sandbox to execute python code in a jupyter notebook cell. this is useful for agents to communicate, execute code, see output, read files, write files, etc. it's like you own personal computer, but in the cloud. use /home/user folder to write/read files.
CODEINTERPRETER_CREATE_SANDBOXAcciónCreate a sandbox to execute python code in a jupyter notebook cell. this is useful for agents to communicate, execute code, see output, read files, write files, etc. it's like you own personal computer, but in the cloud. use /home/user folder to write/read files.
Parámetros de entrada
keep_aliveintegerThe number of seconds to keep the sandbox alive after creation. Default is 300 seconds (5 minutes). Can be in between 0 and 3600.
Parámetros de salida
dataobjectObligatorioData from the action execution
errorstringError if any occurred during the execution of the action
successfulbooleanObligatorioWhether or not the action execution was successful or not
Execute CodeCODEINTERPRETER_EXECUTE_CODEAcciónExecute python code in a sandbox and return any result, stdout, stderr, and error. use /home/user folder to write/read files. try to not use plt.show() as the code is executed remotely. use files for image/chart output instead.
CODEINTERPRETER_EXECUTE_CODEAcciónExecute python code in a sandbox and return any result, stdout, stderr, and error. use /home/user folder to write/read files. try to not use plt.show() as the code is executed remotely. use files for image/chart output instead.
Parámetros de entrada
timeoutintegerThe timeout in seconds for the execution of the code.
keep_aliveintegerThe number of seconds to keep the sandbox alive after execution. Default is 300 seconds (5 minutes). Can be between 0 and 3600.
sandbox_idstringThe ID of the sandbox to execute the code in. Try to find an existing sandbox ID from context in order to access the previous modification session. In case not found, this value might be omitted, a new sandbox will be created.
code_to_executestringObligatorioThe python code to execute in a single cell. If a file is to be saved, it should be saved under /home/user/ directory. At the end of the code, a success message print is good to have.
Parámetros de salida
dataobjectObligatorioData from the action execution
errorstringError if any occurred during the execution of the action
successfulbooleanObligatorioWhether or not the action execution was successful or not
Get FileCODEINTERPRETER_GET_FILE_CMDAcciónGet a file from the sandbox and returns the file. the files should be read from /home/user folder.
CODEINTERPRETER_GET_FILE_CMDAcciónGet a file from the sandbox and returns the file. the files should be read from /home/user folder.
Parámetros de entrada
timeoutintegerThe timeout in seconds for the command to run.
file_pathstringObligatorioThe path(on the sandbox) of the file to get. Give absolute path. Should start with /home/user/
sandbox_idstringObligatorioThe ID of the sandbox where the file has been created.
Parámetros de salida
dataobjectObligatorioData from the action execution
errorstringError if any occurred during the execution of the action
successfulbooleanObligatorioWhether or not the action execution was successful or not
Run Terminal CommandCODEINTERPRETER_RUN_TERMINAL_CMDAcciónRun a command in the terminal and returns the stdout, stderr, and error code. use /home/user folder to write/read files.
CODEINTERPRETER_RUN_TERMINAL_CMDAcciónRun a command in the terminal and returns the stdout, stderr, and error code. use /home/user folder to write/read files.
Parámetros de entrada
commandstringObligatorioThe command to run in the terminal.
timeoutintegerThe timeout in seconds for the command to run.
keep_aliveintegerThe number of seconds to keep the sandbox alive after execution. Default is 300 seconds (5 minutes).
sandbox_idstringThe ID of the sandbox to execute the code in. Try to find an existing sandbox ID from contextinorder to access the previous modification session. In case not found, this value might be omitted, a new sandbox will be created.
Parámetros de salida
dataobjectObligatorioData from the action execution
errorstringError if any occurred during the execution of the action
successfulbooleanObligatorioWhether or not the action execution was successful or not
Upload FileCODEINTERPRETER_UPLOAD_FILE_CMDAcciónUpload a file to the sandbox environment. the files should be uploaded to the /home/user folder.
CODEINTERPRETER_UPLOAD_FILE_CMDAcciónUpload a file to the sandbox environment. the files should be uploaded to the /home/user folder.
Parámetros de entrada
fileobjectObligatorioThe file to upload, containing the file name and base64-encoded content.
overwritebooleanWhether to overwrite the file if it already exists.
sandbox_idstringObligatorioThe ID of the sandbox where the file will be uploaded.
destination_pathstringObligatorioThe destination path in the sandbox where the file will be saved. Provide an absolute path starting with /home/user/. The file name from 'file' will be appended if destination_path is a directory.
Parámetros de salida
dataobjectObligatorioData from the action execution
errorstringError if any occurred during the execution of the action
successfulbooleanObligatorioWhether or not the action execution was successful or not