adamrushy / OpenAISwift

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

OpenAIEndpointModelType that replaces the OpenAIModelType so only compatible models are available for each method #115

Open marcoboerner opened 10 months ago

marcoboerner commented 10 months ago

The current OpenAIModelType model enum and methods that have models as parameters could easily cause errors as any model could be chosen for any of those methods. By adding the new OpenAIEndpointModel type that corresponds to the compatibility list in the OpenAI docs, it’s much easier to select the fitting model. The new type does contain duplicate model strings, which is intended to make it easier to maintain.

Those suggested changes are added (with the new OpenAI models that are missing as well) to the #107 PR (fully backward compatible by wrapping the new methods and adding @available to the old ones.