I have an agent with tool use. Sometimes it outputs both a final response (using the structured output format I gave it) AND a function call.
The issue is that the Agent SDK thinks it is done once it sees this final output. So even though we call the function, the SDK never sends the output of the function back to the LLM, and thus the agent doesn't get the chance to correct any mistakes in the function call, or make further function calls, etc.
Is there a way in the SDK to make it so that if it returns both an output AND a function call, to ignore the output? Or any suggestions for making it not return both in one single API call?