EDIT: I found the solution (see below). I am leaving this post since it might be useful for other folks.
I have been observing this bug - ChatGPT giving an empty answer - for a while. This is happening inside a Custom GPT that uses code interpreter.
The GPT is an interactive fiction game with an instruction that tells it to run some Python code (input_parser
) right after each User’s input. The code takes as input a dictionary and does stuff; details are irrelevant for now.
The problem is that most of the time the code doesn’t run - no call to code interpreter. Instead I get an empty answer (see example below; I have dozens of these), followed by a textual continuation. I had to address many issues when writing this GPT, but this one emerged recently.
- This is not an error of running the code (I do get those occasionally, and they are very different). Plus, I can get GPT to run code upon triggering of certain conditions. And if I explicitly ask the GPT to run
input_parser
, most of the time it does it correctly. The code itself is fine. - This is also not about the GPT forgetting to run the code. Forgetting happens all the time - trust me, I have been dealing with plenty of that - but: (1) for normal forgetting I don’t get that weird empty line; and (2) I know the GPT is not just forgetting this because sometimes it explicitly writes things like: “It seems I could not execute the input parser. I will proceed…”
- For the record, in the rare case that I do not get this bug, then everything works fine, i.e. the GPT will remember to run
input_parser
first thing at every subsequent exchange with the user, and everything goes as planned. - This is not a temporary network thing. I get those, but again, they are very different (and they are connected to an explicit error that I can ask ChatGPT about). Instead, this seems to trigger a very robust behavior from ChatGPT.
- If I ask ChatGPT to explain what happened or report the error message, it doesn’t answer with anything meaningful; just confabulates some hypothetical inability to execute
input_parser
or some “technical problems”, but there is no real error message.
This is driving me crazy… Note that I have plenty of other code that runs fine in various circumstances. It’s this input_parser
thing which is somehow breaking the GPT.
I know my problem is fairly specific, but to try to understand this - has anyone observed the “empty answer” behavior? What was it linked to?