I am unable to get the output of the `code_interpreter`

tool.

When asking the model something like:

calculate the first 10 Fibonacci numbers with code

The assistant (using `gpt-4o`

) will create code that looks like this:

```
# Define a function to calculate the first ten Fibonacci numbers
def first_n_fibonacci(n):
fibonacci = [0, 1]
while len(fibonacci) < n:
next_fib = fibonacci[-1] + fibonacci[-2]
fibonacci.append(next_fib)
return fibonacci[:n]
# Calculate the first ten Fibonacci numbers
first_ten_fibonacci = first_n_fibonacci(10)
first_ten_fibonacci
```

This code will obviously produce an output like this:

```
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
```

I am, however, unable to capture that output anywhere. The tool call that is surfaced through the streaming api (`on_tool_call_done`

) does not contain any output:

```
tool_call: {
"id": "call_Emd7wTr3ajvWWmyUDQUYzw7S",
"code_interpreter": {
"input": "# Define a function to calculate the first ten Fibonacci numbers\ndef first_n_fibonacci(n):\n fibonacci = [0, 1]\n while len(fibonacci) < n:\n next_fib = fibonacci[-1] + fibonacci[-2]\n fibonacci.append(next_fib)\n return fibonacci[:n]\n\n# Calculate the first ten Fibonacci numbers\nfirst_ten_fibonacci = first_n_fibonacci(10)\nfirst_ten_fibonacci",
"outputs": []
},
"type": "code_interpreter",
"index": 0
}
```

The same is the case when iterating through the run steps â€“ the associated run step also has not output:

```
{
"id": "step_Zn3d0x96pT5pcLs0Mq3sePcZ",
"assistant_id": "asst_KYmXGbetJhWA7orV7NO2nOhX",
"cancelled_at": null,
"completed_at": 1719834747,
"created_at": 1719834745,
"failed_at": null,
"last_error": null,
"object": "thread.run.step",
"run_id": "run_5v6fQsDyAtwRS0znW84tQ3ZF",
"status": "completed",
"step_details": {
"tool_calls": [
{
"id": "call_Emd7wTr3ajvWWmyUDQUYzw7S",
"code_interpreter": {
"input": "# Define a function to calculate the first ten Fibonacci numbers\ndef first_n_fibonacci(n):\n fibonacci = [0, 1]\n while len(fibonacci) < n:\n next_fib = fibonacci[-1] + fibonacci[-2]\n fibonacci.append(next_fib)\n return fibonacci[:n]\n\n# Calculate the first ten Fibonacci numbers\nfirst_ten_fibonacci = first_n_fibonacci(10)\nfirst_ten_fibonacci",
"outputs": []
},
"type": "code_interpreter"
}
],
"type": "tool_calls"
},
"thread_id": "thread_pwxd0jWxHQ2WE6hjiG8QJqQY",
"type": "tool_calls",
"usage": {
"completion_tokens": 96,
"prompt_tokens": 0,
"total_tokens": 96
},
"expires_at": null
}
```

Somehow, the assistant gets the output and then gives me the right answer, but I want to provide debug capabilities and show the user what exactly the `code_interpreter`

returned.

Is this a bug or what am I missing here?