Some APIs use multitype fields, such as stop prompt, which can be either a string or a string list. This type of API makes it harder to consume the API with type-safe languages, but it is fairly easy to avoid before introducing a new API.
As seen in the GPT-4 demo video, the new chat API accepts a string or a list of strings, as well as objects that have an image byte array as a field. I had a nightmare about this yesterday. Please consider making changes before releasing it.
Here’s an alternative suggestion that can make things easier.
{
"model": "gpt-3.5-turbo",
"messages":
[
{ "role": "user", "content":
[
{ "text" : "Hello!" },
{ "image" : b|....(byte array) },
]
}
]
}