hi, in OpenAI Agents SDK, is there a way to monitor token output in real time to monitor it for errors, and cut it off early before it's potentially used as input into a tool call?
i have these agents connected to some database search tools, and it occasionally generates a very repetitive search string (such as what's attached). this is both a massive waste of tokens generated, it takes extra time for the LLM to produce (plus the search won't work anyway), and i would like to be able to detect this early and throw an exception with a message instructing the agent not to do that.
i'm unable to find anything in the OpenAI Agents SDK documentation about detecting this on-the-fly. does anybody have any advice for this?