Gemini 2.0 Flash (exp): Unsupported content part type:3; Error rais

When I send the following request to Gemini 1.5 Flash, it works as expected:

{
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "inline_data": {
            "mime_type": "audio/wav",
            "data": "base64_encoded_audio_data"
          }
        }
      ]
    }
  ]
}

When I send the same data to Gemini 2.0 Flash (exp), it fails:

{
  "clientContent": {
    "turns": [
      {
        "parts": [
          {
            "inline_data": {
              "mime_type": "audio/wav",
              "data": "base64_encoded_audio_data"
            }
          }
        ],
        "role": "user"
      }
    ]
  }
}

With the error:

Request trace id: 40b236fcefc20b16, [ORIGINAL ERROR] generic::invalid_argument: Unsupported content part type:3; Error rais

Is there something wrong with the format of my request?
I’m able to send text to Gemini 2.0 Flash (exp) via this format:

{
  "clientContent": {
    "turns": [
      {
        "parts": [
          {
            "text": "Hello world!"
          }
        ],
        "role": "user"
      }
    ]
  }
}

I just can’t seem to get audio to also work via BidiGenerateContentClientContent.

Only text work with BidiGenerateContentClientContent but in the typescript types it says you also supprot audio and image , it is a bug

You can only send text via BidiGenerateContentClientContent. Audio and video will need to go through RealtimeInput: Multimodal Live API  |  Gemini API  |  Google AI for Developers .
The documentation will be updated to clarify this.

1 Like