openai-java
openai-java copied to clipboard
Add support for gpt-4-vision
support the content in chat completion with format https://platform.openai.com/docs/guides/vision
I would love it if this or #423 could be added
Excuse me , Do these code in class ChatCompletionResult
not need to be modified?
@JsonProperty("finish_reason")
String finishReason;
because I found that these changed to 'finish_details' in GPT-4V's return value, like:
"finish_details":{
"type":"stop",
"stop":"<|fim_suffix|>"
}
Excuse me , Do these code in class
ChatCompletionResult
not need to be modified?@JsonProperty("finish_reason") String finishReason;
because I found that these changed to 'finish_details' in GPT-4V's return value, like:
"finish_details":{ "type":"stop", "stop":"<|fim_suffix|>" }
Yes, I've noticed too, and I've already made the changes. Thank you very much for your suggestion.
I really don't like the parameterized ChatMessage, it completely breaks my entire code.
It'll be better with something like
@JsonInclude() // content should always exist in the call, even if it is null
Object content;
public ChatMessage(String role, List<ChatMessageContent> content) {
this.role = role;
this.content = content;
}
public ChatMessage(String role, List<ChatMessageContent> content, String name) {
this.role = role;
this.content = content;
this.name = name;
}
public ChatMessage(String role, String content) {
this.role = role;
this.content = content;
}
public ChatMessage(String role, String content, String name) {
this.role = role;
this.content = content;
this.name = name;
}
@JsonIgnore
public String getStringContent() {
return content instanceof String ? (String) content : null;
}
This atleast keeps the code compatible
when can we have this feature merged ?
I wonder if we could speed up the merger
@JanCong, is this ever going to be merged?