diff --git a/Demo/DemoChat/Sources/UI/Images/ImageCreationView.swift b/Demo/DemoChat/Sources/UI/Images/ImageCreationView.swift index 11ba9ac3..06ca5416 100644 --- a/Demo/DemoChat/Sources/UI/Images/ImageCreationView.swift +++ b/Demo/DemoChat/Sources/UI/Images/ImageCreationView.swift @@ -13,9 +13,9 @@ public struct ImageCreationView: View { @State private var prompt: String = "" @State private var n: Int = 1 - @State private var size = ImagesQuery.Size.allCases.first! + @State private var size = ImagesQuery.Size._1024 - private var sizes = ImagesQuery.Size.allCases + private var sizes = ImagesQuery.Size.allCases.dropLast(2) public init(store: ImageStore) { self.store = store diff --git a/Sources/OpenAI/Public/Models/ImagesQuery.swift b/Sources/OpenAI/Public/Models/ImagesQuery.swift index fc479f16..dae7cba2 100644 --- a/Sources/OpenAI/Public/Models/ImagesQuery.swift +++ b/Sources/OpenAI/Public/Models/ImagesQuery.swift @@ -48,7 +48,7 @@ public enum ResponseFormat: String, Codable, Equatable { responseFormat: Self.ResponseFormat? = nil, size: Size? = nil, style: Self.Style? = nil, - user:String? = nil + user: String? = nil ) { self.prompt = prompt self.n = n @@ -85,7 +85,7 @@ public enum ResponseFormat: String, Codable, Equatable { case _256 = "256x256" case _512 = "512x512" case _1024 = "1024x1024" -// case _1792_1024 = "1792x1024" // for dall-e-3 models -// case _1024_1792 = "1024x1792" // for dall-e-3 models + case _1792_1024 = "1792x1024" // for dall-e-3 models + case _1024_1792 = "1024x1792" // for dall-e-3 models } } diff --git a/Sources/OpenAI/Public/Protocols/OpenAIProtocol.swift b/Sources/OpenAI/Public/Protocols/OpenAIProtocol.swift index 8c65b190..32859722 100644 --- a/Sources/OpenAI/Public/Protocols/OpenAIProtocol.swift +++ b/Sources/OpenAI/Public/Protocols/OpenAIProtocol.swift @@ -49,7 +49,7 @@ public protocol OpenAIProtocol { Example: ``` - let query = ImagesQuery(prompt: "White cat with heterochromia sitting on the kitchen table", n: 1, size: "1024x1024") + let query = ImagesQuery(prompt: "White cat with heterochromia sitting on the kitchen table", n: 1, size: ImagesQuery.Size._1024) openAI.images(query: query) { result in //Handle result here } @@ -66,7 +66,7 @@ public protocol OpenAIProtocol { Example: ``` - let query = ImagesEditQuery(image: "@whitecat.png", prompt: "White cat with heterochromia sitting on the kitchen table with a bowl of food", n: 1, size: "1024x1024") + let query = ImagesEditQuery(image: "@whitecat.png", prompt: "White cat with heterochromia sitting on the kitchen table with a bowl of food", n: 1, size: ImagesQuery.Size._1024) openAI.imageEdits(query: query) { result in //Handle result here } @@ -83,7 +83,7 @@ public protocol OpenAIProtocol { Example: ``` - let query = ImagesVariationQuery(image: "@whitecat.png", n: 1, size: "1024x1024") + let query = ImagesVariationQuery(image: "@whitecat.png", n: 1, size: ImagesQuery.Size._1024) openAI.imageVariations(query: query) { result in //Handle result here }