Better image alt prompt

This commit is contained in:
Thomas Ricouard 2023-12-04 20:36:15 +01:00
parent 28ab417b0a
commit 4dbe04a5d4

View file

@ -96,7 +96,7 @@ public struct OpenAIClient {
case let .emphasize(input): case let .emphasize(input):
ChatRequest(content: "Make this text catchy, more fun: \(input)", temperature: 1) ChatRequest(content: "Make this text catchy, more fun: \(input)", temperature: 1)
case let .imageDescription(image): case let .imageDescription(image):
VisionRequest(messages: [.init(content: [.init(type: "text", text: "Whats in this image?", imageUrl: nil) VisionRequest(messages: [.init(content: [.init(type: "text", text: "Whats in this image? Be brief, it's for image alt description on a social network. Don't write in the first person.", imageUrl: nil)
, .init(type: "image_url", text: nil, imageUrl: .init(url: image))])]) , .init(type: "image_url", text: nil, imageUrl: .init(url: image))])])
} }
} }