Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to new endpoints #12

Open
dabdine opened this issue Nov 18, 2022 · 3 comments
Open

Migrate to new endpoints #12

dabdine opened this issue Nov 18, 2022 · 3 comments

Comments

@dabdine
Copy link
Contributor

dabdine commented Nov 18, 2022

OpenAI's /engine/{engine_id} endpoints have been deprecated. In fact, the concept of "engines" has been deprecated (https://help.openai.com/en/articles/6283125-what-happened-to-engines). Instead, OpenAI is using "model" now to reference what was previously an engine. As such, all newer API endpoints now no longer accept the engine name in the URI path and instead favor the model in the JSON payload.

Additionally, several API endpoints now accept a "user" parameter that can be used to store a unique identifier to trace requests when dealing with abuse complaints. Support for this parameter would be nice to add when migrating to the new endpoints.

I see a few options:

  1. Version this library (keep 1.x.x for the deprecated APIs, add a 2.x.x for the newer API endpoints). However, I'm not sure how long OpenAI will support them. They state "We will maintain backward compatibility for requests using ‘engine’ as a parameter, but recommend updating your implementation as soon as you can to prevent future confusion." on their blog post).
  2. Do nothing Their blog post doesn't set an end date to the deprecation warning. However, since documentation will reflect the latest version of the endpoints, it's likely that over time this library will use a mix of both the old deprecated APIs and new APIs, causing confusion (NOTE this is already happening with embeddings and edits).
  3. Migrate everything over to the new version, ditch the deprecated APIs fully - probably the least favorable option for folks using it in production.
@tylermann
Copy link
Contributor

@dabdine it seems like we could potentially just add support for both methods going forward and slowly deprecate the engine without needing to fully increment the major version.

For example, it seems like we could migrate all of the existing APIs, like:

https://api.openai.com/v1/engines/{engine_id}/completions -> https://api.openai.com/v1/completions

And do something like this:

if req.Model == "" {
  req.Model = engine
}

Additionally, several API endpoints now accept a "user" parameter that can be used to store a unique identifier to trace requests when dealing with abuse complaints. Support for this parameter would be nice to add when migrating to the new endpoints.

Yeah I agree here.

@tylermann
Copy link
Contributor

We could probably deprecate the *WithEngine variants of the APIs that exist today as a part of this change too.

@thehappydinoa
Copy link
Contributor

thehappydinoa commented Jan 21, 2023

Just added Models, Files, and FineTune API support in #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants