Running code in Chat: spreadsheets, charts and files
The AI writes and runs Python in a sandbox with internet access. It analyzes Excel and CSV, draws charts and creates files. About 1 token per run.
Updated November 2, 20262 min read
Code runs when a task needs exact calculation or a file: totals from a spreadsheet, a chart, a cleaned-up CSV, an Excel report. You don't write code yourself. Describe the task, and the AI decides when to run code.
What the AI does with code
Analyzes tables: sums, averages, filters, grouping, finding duplicates in CSV and Excel files.
Builds charts. Simple ones appear as interactive charts in the answer, complex ones as a picture.
Creates files to download: Excel, CSV, Word, ZIP, JSON and others.
Works with PDF: merges and splits files, extracts pages and text.
Does precise calculations: loans, unit conversions, statistics.
PDF documents are created by a separate tool (status “Creating PDF”), which handles layout, fonts and right-to-left scripts such as Arabic and Hebrew. Ask “Make a PDF of this” and the AI chooses the right tool.
How to use it
In the Chat tab, tap + and attach the file, for example a sales spreadsheet.
Write the task: “Show revenue by month as a bar chart” or “Make an Excel file with only the rows where the amount is over 100”.
Wait while the status changes: “Preparing sandbox”, “Uploading files”, “Running code”, “Saving results”.
Get the answer with the result, a chart or a file card. Tap the card to save the file, see saving files from the chat.
Code works in any chat. In a project, data files from the knowledge base are also available to the code. If the code fails, the AI fixes it and tries again, up to two more times.
Where the code runs
The code is Python and runs in an isolated sandbox in the cloud. It has no access to your phone or computer. The sandbox sees only the files from this chat or project. It has internet access: the AI can install a missing library or download public data from a link.
Video and audio are not processed with code. For them the chat uses its own tools: video download and transcription.
How much it costs
Each run of code adds about 1 token to the price of the answer. The main part of the price is still the model: the larger the file and the longer the answer, the more it costs. Prices by model are in choosing a model.
Frequently asked questions
The AI answered without running code. How do I make it calculate exactly?
Ask directly: “Calculate this with code” or “Run the code and show the result”.
A file from an old answer does not open. Why?
If you see “This file is no longer available. Ask the assistant to generate it again.”, ask the AI in the same chat to create the file again.
Contact support
Describe the problem and we will reply by email. Add the file name or job ID if you have one.