go-openai
go-openai copied to clipboard
support gpt-4-vision-preview model
Please provide support for the gpt-4-vision-preview model. The ChatCompletionMessage is currently not useful for gpt-4-vision-preview.
+1
Duplicates #539 Awaiting PR: #580
+1
yeapp, looking forward for vision support as well!
When will the new version be released?
@anhao it seems to have been merged https://github.com/sashabaranov/go-openai/pull/580
but no docs yet
Not sure if people have updated the docs, but here is a simple working example uploading a base64 image to the vision API!
Model: openai.GPT4VisionPreview,
MaxTokens: 1000,
Messages: []openai.ChatCompletionMessage{
{
Role: openai.ChatMessageRoleUser,
MultiContent: []openai.ChatMessagePart{
{
Type: openai.ChatMessagePartTypeText,
Text: "What's in this image?",
},
{
Type: openai.ChatMessagePartTypeImageURL,
ImageURL: &openai.ChatMessageImageURL{
URL: fmt.Sprintf("data:image/jpg;base64,%s", imgString),
Detail: openai.ImageURLDetailLow,
},
},
},
},
},
})```