We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello. The com.aallam.openai library treats content as a string, not as an array of JSON objects. As a result, the attached image is not parsed.
fun analyzeImageWithGPT(apiKey: String, imageUrl: String): String = runBlocking { val openAI = OpenAI(apiKey) val request = ChatCompletionRequest( model = ModelId("gpt-4o-mini"), messages = listOf( ChatMessage( role = ChatRole.User, content = """ [ { "type": "text", "text": "What is in this image?" }, { "type": "image_url", "image_url": { "url": "$imageUrl" } } ] """.trimIndent() ) ), maxTokens = 300 ) val response = openAI.chatCompletion(request) response.choices.firstOrNull()?.message?.content ?: "No response" } Maybe I'm not making the request correctly, please tell me?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello. The com.aallam.openai library treats content as a string, not as an array of JSON objects.
As a result, the attached image is not parsed.
The text was updated successfully, but these errors were encountered: