adamrushy / OpenAISwift

This is a wrapper library around the ChatGPT and OpenAI HTTP API
MIT License
1.6k stars 242 forks source link

Implementation of Endpoints for Image Edit and Image Variation #101

Open MarkHoath opened 11 months ago

MarkHoath commented 11 months ago

I created another init() function which takes the old APIKEY and passes it to the new Config structure.

Because Images are handled by different libraries in IOS and MacOS, there is no error handling.

Images have to be the correct size (256x256, 512x512, 1024x1024 and less than 4MB)

Images must be png files and passed as image.pngData(). (same for the Mask in Image Edit endpoint)

For Editing, if no mask is supplied (its optional) then the image/png file MUST have an alpha channel. (RGBA).

Any of the above Failures result in "Success" results, but "Errors" in the response, which aren't handled by the Decoder.

MarkHoath commented 4 months ago

This update includes the Jan 2024 Endpoints and Models including gpt4-turbo.