code_executor
Solve computational tasks by iteratively writing and executing Python code in a stateful sandbox, producing numeric, data, or analysis answers.
Instructions
Solve a task by letting Grok run Python in a stateful sandbox.
The agent iteratively writes and executes Python (with common scientific
libraries) to arrive at a numeric, data, or analysis answer.
Args:
prompt: Task or question requiring computation.
model: Grok model driving the agent (default `grok-4.3`).
max_turns: Cap the number of reasoning/execution turns.
Returns:
Markdown with the final answer followed by each code execution block's stdout.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| model | No | grok-4.3 | |
| max_turns | No |