#API: GPT-4o Audio bug with tools calls

1 messages · Page 1 of 1 (latest)

light sluiceBOT
#

Reported by @storm ginkgo

Bug Report: API: GPT-4o Audio bug with tools calls
`Steps to Reproduce`

If GPT answer audio at the same time than the tools call, the follow up will bug because the API throw an error if an assistant message have audio + tool_calls, the "tool_calls" are not read correctly and we get "Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls'."

`Expected Result`

The API must accept this format:

{
  "role": "assistant",
  "tool_calls": [
    {
      "id": "call_oHHuf6tqsySDjE6KIRSK1TvR",
      "type": "function",
      "function": {
        "name": "create_poll",
        "arguments": "{\"question\":\"Pain au chocolat ou beurre ?\",\"choices\":[\"Pain au chocolat\",\"Pain au beurre\"],\"duration\":300}"
      }
    }
  ],
  "audio": {
    "id": "audio_677a61d5d9d08190b1987ff1c1326c73"
  }
},
`Actual Result`

Actually we get error: "Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls'." as the "audio" seem to rewrite the assistant message under the hood

`Environment`

Any platform

#
Additional Information

Please provide relevant details to help resolve the issue, such as:

  • ChatGPT Shared Link (if applicable).
  • Screenshots or videos demonstrating the problem.

-# ➜ Need to contact support? Visit the OpenAI Help Center.