Update API for GPT4 Vision Preview
Closed this issue · 3 comments
zh4ngx commented
Describe the bug
When using the GPT 4 Vision Preview API, the finish_reason
field is missing. It needs to be optional, and a new finish_details
field needs to be added (and also optional).
To Reproduce
Follow the example in the Quickstart: https://platform.openai.com/docs/guides/vision/quick-start
- Start a completion using the
GPT4_VISION_PREVIEW
model - Use the text and image_url in the example
- Note the error about the missing field
Code snippets
let req = ChatCompletionRequest {
model: GPT4_VISION_PREVIEW.to_string(),
messages: vec![
chat_completion::ChatCompletionMessage {
role: MessageRole::user,
content: String::from(
r#"[
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]"#,
),
name: None,
function_call: None,
}],
functions: None,
function_call: None,
temperature: None,
top_p: None,
n: None,
response_format: None,
stream: None,
stop: None,
max_tokens: Some(300),
presence_penalty: None,
frequency_penalty: None,
logit_bias: None,
user: None,
};
OS
Linux
Rust version
Rust v1.73.0
Library version
openai-api-rs v2.1.1
dongri commented
@zh4ngx Thanks!
https://platform.openai.com/docs/api-reference/chat/object
It seems the document and the API response do not match.