Function calling parameters sometimes ignored as AI asks for more info

I’m using function calling to define the JSON schema that I want the response in. Sometimes this works as expected, but other times the response is the AI asking for more information and in a different format.

This is probably a good thing for a chat app but my app has no way of providing the information being asked for. Is there a way to force the response to match a certain JSON schema?

I assumed this was the case when you specifed the tool_choice, but from experience it seems it isnt?

      tool_choice: {
        type: "function",
        function: { name: "my_function_name" }
      }