in src/agents/models/chatcmpl_converter.py [0:0]
def flush_assistant_message() -> None:
nonlocal current_assistant_msg
if current_assistant_msg is not None:
# The API doesn't support empty arrays for tool_calls
if not current_assistant_msg.get("tool_calls"):
del current_assistant_msg["tool_calls"]
result.append(current_assistant_msg)
current_assistant_msg = None