Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Code interpreter enables Copilot Studio agents to generate and execute Python code when needed to respond to user prompts. Code interpreter supports tasks such as data preparation, statistical analysis, table joins, forecasting, and chart generation. These tasks work with structured files like CSV and Excel. Code interpreter supports the GPT-4.1 model.
Note
This capability is in an "experimental" stage.
The value proposition of using Code interpreter to analyze structured data files is:
- Unlock trustworthy analysis inside agents and prompts by employing deterministic, reproducible computation instead of best-effort large language model (LLM) reasoning for data questions.
- Lower the skill barrier for advanced analytics by letting users ask analytic questions in natural language.
- Generate tables and visualizations of results programmatically that users can see, download, and reuse.
An agent in Copilot Studio can ingest a structured data file in two ways:
- As an uploaded file, in an agent chat.
- As a referenced knowledge source in SharePoint Documents library.
This feature is tailored for developers, business analysts, and low-code makers. Code generation and execution integrate seamlessly with the Copilot Studio ecosystem to create powerful, AI-driven solutions.
Requirements
Licensing: Microsoft Copilot Studio billing and licensing. Code generation and execution count as text and generative AI tools (premium) features.
Supported regions: Available for all public clouds. Sovereign clouds aren't currently supported.
Use code interpreter for analysis of a user-uploaded structured data file
In Copilot Studio, select Settings > Generative AI. Under Knowledge, turn off all toggles.
Under File processing capabilities, turn on the Code interpreter toggle.
Under Search, turn on the Tenant graph grounding with semantic search toggle.
Select Save.
In your test pane, write a prompt that requires code to operate on the data in a structured data file to answer, and include the data file as an attachment to the prompt.
Use code interpreter for analysis of a structured data file as a Sharepoint knowledge source
If your agent doesn't already have a SharePoint structured data file as a knowledge source, add this SharePoint file as a knowledge source now.
In Copilot Studio, select Settings > Generative AI. Under Knowledge, turn off all toggles.
Under File processing capabilities, turn on the Code interpreter toggle.
Under Search, turn on the Tenant graph grounding with semantic search toggle.
Select Save.
If you added a SharePoint file in the first step, publish your agent.
Test your agent.