Finish_reason: stop but have a tool_calls and no content

I got some output that had a “tool_calls” but the finish_reason is stop which isn’t great cause eariler I was checking if there was a tool_calls in my code to do different behavior based on the finish_reason.

I can’t tell if this is a bug cause there’s no natural stop point here cause there’s no content.

How do you reliably check if there’s a tool_calls in the api ?

I’m using python SDK btw.

{
    "id": "chatcmpl-9a6ZoOIgaT9AjIQO1YU7UmMajiX39",
    "choices": [
        {
            "finish_reason": "stop",
            "index": 0,
            "logprobs": "none",
            "message": {
                "content": "none",
                "role": "assistant",
                "function_call": "none",
                "tool_calls": [
                    {
                        "id": "call_vwpeVemUh8Xk34gXncMaHXGt",
                        "function": {
                            "arguments": "{"location":"Sunriver, OR","query":"schools"}",
                            "name": "google_nearby_places"
                        },
                        "type": "function"
                    }
                ]
            }
        }
    ],
    "created": 1718392116,
    "model": "gpt-3.5-turbo-0125",
    "object": "chat.completion",
    "system_fingerprint": "none",
    "usage": {
        "completion_tokens": 21,
        "prompt_tokens": 478,
        "total_tokens": 499
    }
}