Closed zh4ngx closed 11 months ago
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).
finish_reason
finish_details
Follow the example in the Quickstart: https://platform.openai.com/docs/guides/vision/quick-start
GPT4_VISION_PREVIEW
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, };
Linux
Rust v1.73.0
openai-api-rs v2.1.1
I have a PR: #46
@zh4ngx Thanks! https://platform.openai.com/docs/api-reference/chat/object It seems the document and the API response do not match.
https://github.com/dongri/openai-api-rs/pull/46 Merged
Describe the bug
When using the GPT 4 Vision Preview API, the
finish_reason
field is missing. It needs to be optional, and a newfinish_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
GPT4_VISION_PREVIEW
modelCode snippets
OS
Linux
Rust version
Rust v1.73.0
Library version
openai-api-rs v2.1.1