MacPaw / OpenAI

Swift community driven package for OpenAI public API
MIT License
2.08k stars 349 forks source link

add support for gpt-4-1106-preview model #112

Closed paulz closed 11 months ago

paulz commented 1 year ago

Is your feature request related to a problem? Please describe. OpenAI just released preview of updated model: gpt-4-1106-preview

Describe the solution you'd like Add new model to Models enum

Describe alternatives you've considered Stop using MacPaw/OpenAI? Use Swift Foundation for TCP/IP to OpenAI API

Additional context https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo

GPT-4 TurboNew The latest GPT-4 model with improved instruction following, JSON mode, reproducible outputs, parallel function calling, and more. Returns a maximum of 4,096 output tokens. This preview model is not yet suited for production traffic. Learn more.

similar to #111 but focusing on gpt-4-1106-preview

PallavAg commented 1 year ago

While waiting, you can also clone the repo and add the model to your local copy here: https://github.com/MacPaw/OpenAI/blob/c45f3320ffa760f043c0239f724850c0e4f8bde5/Sources/OpenAI/Public/Models/Models/Models.swift#L11

A useful video on how to clone and use a Swift Package is here.

arminasr commented 1 year ago

Feel free to extend the model in your project until the package is updated:

public extension Model {
    static let gpt4_1106 = "gpt-4-1106-preview"
}
kylan02 commented 1 year ago

I am also hoping to add model "dall-e-3" for the new image generation api. I'm assuming this will work:

public extension Model { static let dalle3 = "dall-e-3" }

But then how do I add the model to the image query without a model parameter?