Skip to content

OfMessage/OfInputItemContentList cannot be used with assistant role #485

@adambaratz

Description

@adambaratz

It's possible to generate this JSON:

{
  "input": [
    {
      "content": [
        {
          "text": "write me a haiku about a sunset",
          "type": "input_text"
        }
      ],
      "role": "user"
    },
    {
      "content": [
        {
          "text": "Colors bleed and blend,  \nWhispers of the day retreat,  \nNight wraps the horizon.",
          "type": "input_text"
        }
      ],
      "role": "assistant"
    },
    {
      "content": [
        {
          "text": "mention the color red",
          "type": "input_text"
        }
      ],
      "role": "user"
    }
  ],
  "model": "gpt-4o-mini-2024-07-18"
}

Which in turn results in this error:

400 Bad Request { "message": "Invalid value: 'input_text'. Supported values are: 'output_text' and 'refusal'.", "type": "invalid_request_error", "param": "input[1].content[0]", "code": "invalid_value" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions