Finish_reason = function_call, but with no arguments (null)

I am implementing a chat with gtp4, and when using functions something, I think, unexpected happens.

{
    "finish_reason": "function_call",
    "index": 0,
    "message": {
      "role": "assistant",
      "content": null,
      "function_call": {
        "name": "bienvenida_2",
        "arguments": "{}"
      }
    },
    "content_filter_results": {},
    "logprobs": null
  }

finish_reason tells me that it is due to function_call, but without arguments. Is this behavior normal?

Thank you in advance for your help.

Hey there and welcome to the community!

What is the error you’re getting precisely? If you show us the exact error, we should be able to figure out how we can adjust your code so it works :slightly_smiling_face:

1 Like

That’s the response you get when they call a function. They don’t actually guarantee that they will follow the schema you provided when they call your function so you need to be prepared to get missing or even invalid arguments. They don’t actually even guarantee that they’ll call a valid function.

Can you show us the list of functions you sent and the user message?

1 Like