mirror of
https://github.com/onyx-dot-app/documentation.git
synced 2026-07-25 13:46:14 -04:00
39 lines
1.6 KiB
Plaintext
39 lines
1.6 KiB
Plaintext
---
|
|
title: "Code Execution"
|
|
description: "Safe and sandboxed Python runtime available to the LLM"
|
|
icon: "code"
|
|
---
|
|
|
|
The code execution action gives Onyx's LLMs the ability to write and execute Python code,
|
|
unlocking capabilities such as performing complex calculations, running data analysis on uploaded files,
|
|
and generating or modifying documents.
|
|
|
|
<Tip>
|
|
The code execution action is built-in functionality available to all deployments without any configuration needed.
|
|
</Tip>
|
|
|
|
<img className="rounded-image" src="/assets/overview/core_features/code_interpreter.png" alt="Code Execution"/>
|
|
|
|
<Info>
|
|
The LLM determines when to use code execution based on the user's query — no explicit invocation is needed.
|
|
It can also be attached to custom [Agents](/admins/agents/overview), giving the LLM the option to use it as needed.
|
|
</Info>
|
|
|
|
## Features
|
|
|
|
The code execution action runs in a secure,
|
|
sandboxed Python environment with all dangerous functionality removed (such as network access and filesystem access
|
|
outside of the sandbox).
|
|
|
|
- **Libraries**: Comes with pre-installed libraries such as numpy, pandas, scipy, matplotlib, and more.
|
|
- **File Input**: Pass arbitrary file types along with the code to run against them.
|
|
- **File Output**: Files can be created and provided back to the user.
|
|
- **STDIN/STDOUT Capture**: All program outputs are captured and displayed to the user.
|
|
- **Graph Rendering**: The Onyx [Chat UI](/overview/core_features/chat)
|
|
renders returned graphs and other visualizations directly in the conversation.
|
|
|
|
## Configuration
|
|
|
|
To learn more about managing the code execution server,
|
|
see the [admin configuration guide](/admins/actions/code_interpreter).
|