Function call response is empty despite completion tokens being used

When running a function call, the message is empty despite completion tokens being used and finish_reason = “tool_calls”

I am using the Azure OpenAI service.

Here is an example output

{
  "id": "----",
  "choices": [
    {
      "finish_reason": "tool_calls",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null
      },
      "content_filter_result": {
        "error": {
          "code": "content_filter_error",
          "message": "The contents are not filtered"
        }
      },
      "content_filter_results": {}
    }
  ],
  "created": 1704892312,
  "model": "gpt-35-turbo",
  "object": "chat.completion",
  "system_fingerprint": null,
  "usage": {
    "completion_tokens": 24,
    "prompt_tokens": 136,
    "total_tokens": 160
  },
  "prompt_filter_results": [
    {
      "prompt_index": 0,
      "content_filter_results": {}
    }
  ]
}
2 Likes

Looks like there’s an content_filter_error. Something in the prompt is blocked by Azure.

But it says

indicating that the filter is not active, not that it was filtered out.

BTW: This worked just yesterday with the same prompt and settings. It stopped literally today. I can also not see how the prompt could be sensitive for the model.

Im having a similar issue, without an errors:

chat_completion: {
  "id": "chatcmpl-8faxjy0rshfReryDkFV3jQUzWqzq3",
  "choices": [
    {
      "finish_reason": "tool_calls",
      "index": 0,
      "logprobs": null,
      "message": {
        "content": null,
        "role": "assistant",
        "function_call": null,
        "tool_calls": null
      },
      "content_filter_results": {}
    }
  ],
  "created": 1704924223,
  "model": "gpt-4",
  "object": "chat.completion",
  "system_fingerprint": null,
  "usage": {
    "completion_tokens": 140,
    "prompt_tokens": 88,
    "total_tokens": 228
  },
  "prompt_filter_results": [
    {
      "prompt_index": 0,
      "content_filter_results": {
        "hate": {
          "filtered": false,
          "severity": "safe"
        },
        "self_harm": {
          "filtered": false,
          "severity": "safe"
        },
        "sexual": {
          "filtered": false,
          "severity": "safe"
        },
        "violence": {
          "filtered": false,
          "severity": "safe"
        }
      }
    }
  ]
}

I am also in a same situation with something that was working as of yesterday.

1 Like

I had the exact same error. It only happened using the gpt-35-turbo 1106 model, when I downgraded to 0613 everything started to work again.

2 Likes

Same issue on GPT-4 1106, stopped working as of yesterday.

Same issue for me on GPT-4 1106. I deployed a GPT-35-turbo 0613 model which seems to work.

1 Like

We are having the same issue on GPT-4 1106, It stopped working yesterday

I have the exact same problem. Everything worked fine 2 days ago. Now the response is empty, throwing a content filter error. This is using GPT-4-1106. Switching to 3.5 1106 fixes it for me.

1 Like

Is everyone in this chat using Azure Open Ai?

I would have thought this issue would be annoying more people so i’m thinking it might just be an Azure thing.

1 Like

same for me… function calling returning null / empty…
stopped working today, was working yesterday

Yeah it’s just Azure (at least for me), switching over to OpenAI servers, everything works fine. It was nice to know it wasn’t just me though, I couldn’t find any mention of it on the Azure forums.

2 Likes

Hey thanks for that, So just to confirm, You have managed to get gpt-4 1106 working, but only using the official OpenAI endpoints?

Exactly. I suspect it’s a problem at the API schema layer on the Azure end, I’ve seen it a few times where it’s doesn’t match the OpenAI servers. I’ve usually found workarounds like upgrading the api_version or fiddling with the messages (in one example, I had to set the content on a message to an empty string), but not found a way around this yet apart from going back to functions instead of tools.

2 Likes

Thanks for the info :slight_smile: yea very flaky at the minute but i think we have to put up with it while its all moving so fast. Its also hard to tell what models go with which api-versions etc i haven’t been able to find a clear list or explanation

2 Likes

I see the issue has not been resolved yet. I posted the issue to the Azure OpenAI Forums. Can’t link here apparently due to policy, but the title is: Bug with Azure OpenAI Service calling GPT-4-1106 function: No content returned
Hope my post there will speed up the process

1 Like

I’ve been talking to Microsoft about this and they have been able to reproduce the problem and it appears to be region specific. I’m running in the UK South region and the problem is still active. They have confirmed they are looking into this issue. Fingers crossed it can be resolved soon.

4 Likes

I’m having the exact same issue. After returning from holidays, my chatbots stopped working with apparently no reason, because there were no code nor configuration changes since the last server update in december. System affected: Azure OpenAI chat completions with tools. Model name: gpt-4. Model version: 1106-Preview.

1 Like

Same issue for me, Microsoft has removed the tools call in the next release

1 Like