I am working on a spring boot application and i want to include the “detail” feature of the gpt-4o model in it, so that i can test my application and finalize if i should go with “low” or “high” detail feature.
I know it works in python if we include it in the message body but i need to know if we can do it in java or not.
here is the link for python implementation of it from the open ai docs
https://platform.openai.com/docs/guides/vision
I tried adding it in the same way i did for response format but it did not work out . Later I found that I need to include it in message construction body and tried to wrap it in the Media. But then another problem arose, which is, I cannot wrap 3 variables in the Media cause it accepts only 2 variables , either ( MimeType mimeType, URL url ) or ( MimeType mimeType, Resource resource ).
Hence i am stuck here..
I am new to spring boot, a complete beginner, so i do not know much about this.
This is my code snippet in which i have enabld json mode which is a feature of GPT-3.5-Turbo, GPT-4o and GPT-4-Turbo
private static final OpenAiChatOptions options = OpenAiChatOptions.builder()
.withModel(“gpt-4o”)
.withMaxTokens(400)
.withResponseFormat(new OpenAiApi.ChatCompletionRequest.ResponseFormat(“json_object”))
.build();