The code execution feature in Gemini 1.5 Pro/Flash 002 is not functioning correctly. Upon enabling the feature and submitting any prompt, an “Internal Error Occurred” message is displayed. Different browsers and devices have been tested, and the issue persists.
I also have this error, tried relogging unsuccessfully. Execution works for Gemini 1.5 Flash but no others.
Hello @notlin4 and @ethanh, welcome to the forums.
This does seem to be an issue for me too, however try debugging this yourself and see what happens.
If you’re on a Personal Computer (which I’m not on a device that supports what im about to say next, so I can’t figure out the issue), go to Inspect Element, then the Network Tab. Try making a request and finding the request that seems to be breaking, check out the response and see what it has to say.
Happy coding!
Hat
Code execution just showed up, like Google grounding. Google grounding is paid API @ $35; code execution doesn’t have any plan mention.
I’ve got a feeling that execution is being simulated for you, not actually run.
Flash is extremely bad at following instructions. Enough guidance and you can get it to “work”:
And how does python code work? And why is your system prompt not being followed well and less useful? Because Google is talking to the AI as you:
You are a helpful AI assistant. I will ask you some questions, when answering the questions, report your thoughts, gather information, present evidence and your findings in an accurate and concise form.
You have access to general python tool use. They can be called within special python code blocks marked by `tool_code`, for example you can call sympy to solve equations with
```tool_code
import sympy
y = sympy.Symbol(“y”)
roots = sympy.solve(y ** 2 - 2 * y - 15, y)
print(f’{roots=}')
```
```Code execution output
roots=[-3, 5]
```
The tool calls will be automatically executed and return the output printed a `tool_outputs` block. Remember, each tool call is independent so you need to add imports every time.
Do ask clarifying questions when you don’t have sufficient information to understand the user’s requirement.
So there it is. The stupid forum software is overwriting tool code (with underscore) as the markdown fenced code block keyword.
Not a stateful notebook, and without storage. I think Google also messed up instructions to AI by not putting the closing backticks of “tool_code” markdown container on its own line, so when the AI writes it, it has a tendency to not be closed correctly.
I have the same error if I input your exact command. After taking it through a couple of steps, one at a time it is able to reproduce the results properly. Just by asking it to do handle crashes gracefully and break it down into a one response per turn.
Code execution is very high potential yet very finicky due to security and safety requirements. This is one of the reasons you have to sometimes walk your way through the different steps that it’s unfolding. Of course, it’s also in development in the ways that it performs its primary tasks, most of the issues that I find encountering are based upon measures that must be in place to prevent misuse.
It seems Google has fixed the problem.