๐ป Code Execution: Your AI that Programs and Calculates
What if, instead of just talking about data, YuIA could calculate, analyze, and visualize everything for you, right there in the chat? That's exactly what Code Execution does.
This feature transforms YuIA into much more than a text assistant. It becomes a true computing platform: it writes code, runs programs, generates charts, creates interactive visualizations, and even builds complete web pages. All within the conversation, without you needing to install anything or know how to program.
๐งฎ Code Interpreter: The AI that Calculates for Youโ
The Code Interpreter is like giving YuIA a super-powered calculator. When enabled, the AI can write and execute Python code automatically during the conversation, whenever it deems necessary.
In practice, this means you can ask things like:
- "Calculate how much I'll pay in compound interest over 12 months on $5,000 at 1.5% per month."
- "Analyze this spreadsheet I sent and tell me the top 5 best-selling products."
- "Create a bar chart showing sales by quarter."
The AI writes the code behind the scenes, executes it, and delivers the result (whether a number, a table, or a visual chart) directly in the chat. You see the final result, not the code.
๐ก To enable: Click the integrations button (โ) and enable the Code Interpreter.
Practical examplesโ
| What you ask | What the AI does |
|---|---|
| "Convert 500 dollars to Brazilian reais using today's exchange rate" | Calculates and presents the result |
| "Analyze the CSV I sent and identify trends" | Processes the spreadsheet and generates insights |
| "Generate a pie chart with monthly expenses" | Creates and displays the chart in the chat |
| "Calculate the mean, median, and standard deviation of these numbers" | Executes statistical code and shows the results |
โถ๏ธ Manual Code Executionโ
In addition to the automatic interpreter, you can execute code manually. When the AI generates a Python code block, a Run button appears in the corner of the block.
- Ask the AI to write a script (e.g., "Write Python code that calculates the first 20 Fibonacci numbers.").
- The AI generates the code in a formatted block.
- Click the Run button to run it directly in the browser.
- The result appears right below the code block.
This is perfect for:
- Testing and validating AI-generated scripts.
- Running quick experiments without leaving the chat.
- Learning programming interactively: ask the AI to explain each line while you run the code.
๐จ Interactive Artifactsโ
Artifacts are one of YuIA's most impressive features. When the AI generates visual content (such as an HTML page, an SVG chart, or a JavaScript visualization), it doesn't appear as raw code in the chat. Instead, it's rendered in an interactive panel next to the conversation.
What can be an Artifact?โ
- Complete web pages: Landing pages, forms, dashboards, with HTML, CSS, and JavaScript working.
- SVG graphics: Icons, vector illustrations, and infographics.
- 3D visualizations: Interactive scenes using libraries like Three.js.
- Data charts: Visualizations with D3.js and other libraries.
How to interact with Artifactsโ
- Versioning: Each edit creates a new version. Use the version selector in the bottom-left corner to navigate between them and compare changes.
- Full screen: Expand the artifact for full-screen viewing using the button in the bottom-right corner.
- Copy code: Copy the artifact's source code to use in other projects.
- Iterate with the AI: Request changes directly in the chat. E.g.: "Change the background color to blue" or "Add a contact button." The AI updates the artifact and a new version is created.
Everything in the chat: You don't need external tools. Ask "Create a landing page for my product" and YuIA delivers a functional page that you can view, iterate on, and copy, all without leaving the conversation.
๐บ๏ธ Mermaid Diagramsโ
Need to visualize a process, a structure, or a decision flow? Ask YuIA to create a Mermaid diagram and it will be automatically rendered as an interactive image in the chat.
What you can createโ
- Flowcharts: Business processes, approval flows, decision trees.
- Sequence diagrams: Interactions between systems or people over time.
- Gantt charts: Project timelines with tasks and deadlines.
- Mind maps: Visual organization of ideas and concepts.
- Class diagrams: Data structures and relationships.
How to useโ
Just ask naturally:
- "Create a flowchart of the onboarding process for a new employee."
- "Make a sequence diagram showing how an order is processed in e-commerce."
- "Build a Gantt chart for the product launch over the next 3 months."
YuIA generates the Mermaid code and the platform renders the visual diagram automatically. You can zoom and drag (pan) to explore large diagrams.
๐ Summaryโ
| Feature | What it does |
|---|---|
| Code Interpreter | The AI writes and executes code automatically for calculations, charts, and analyses |
| Manual Execution | Run button on code blocks for testing in the browser |
| Artifacts | Interactive panel that renders HTML pages, SVGs, and JavaScript visualizations |
| Mermaid Diagrams | Flowcharts, timelines, and diagrams rendered visually |
Try it now: Open YuIA with Code Interpreter enabled and ask something like "Create a chart showing the evolution of the dollar over the last 12 months." You'll be amazed by the result.