Open hynek5 opened 4 months ago
Okay it seems that the serialization of the content is the issue. Following is the payload :
2024-02-12T11:17:50.118+01:00 INFO 13616 --- [ main] okhttp3.OkHttpClient : --> POST https://api.openai.com/v1/chat/completions
2024-02-12T11:17:50.119+01:00 INFO 13616 --- [ main] okhttp3.OkHttpClient : Content-Type: application/json; charset=UTF-8
2024-02-12T11:17:50.119+01:00 INFO 13616 --- [ main] okhttp3.OkHttpClient : Content-Length: 26315
2024-02-12T11:17:50.119+01:00 INFO 13616 --- [ main] okhttp3.OkHttpClient :
{
"model": "gpt-4-vision-preview",
"messages": [
{
"role": "user",
"content": "[{\"type\": \"text\",\"text\": \"What’s in this image?\"},\"{\"type\": \"image_url\",\"image_url\": {\"url\": \"data:image/jpeg;base64,/9j/4AAQS.....kZJRgABAQBQoUKhAUKFCoQ//Z\"}\"}\"]\""
}
],
"max_tokens": 500
}
It would be nice if it was possible to add json/json array to com.theokanning.openai.completion.chat.ChatMessage.content
I'm trying to analyze image following guidelines at https://platform.openai.com/docs/guides/vision?lang=curl
I cannot make my solution work, getting weird responses like : I cannot accurately identify the contents of the image as it is encoded in base64 format. Please provide a direct image link or describe the image. which is weird as example at open api docs using python works like a charm.
Anyone with working example or idea what could be an issue here? Or possible where to look during debug for serialization? I suspect that might be an issue but I was unable to find the right class.
Thanks a lot!