go-gpt3 icon indicating copy to clipboard operation
go-gpt3 copied to clipboard

Migrate to new endpoints

Open dabdine opened this issue 2 years ago • 3 comments

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.

dabdine avatar Nov 18 '22 20:11 dabdine