Implement OpenAI July 2023 Updates (#427)

* Implement OpenAI July 2023 Updates

* fix: golangci-lint

* add comment

* fix: remove some model Deprecated
This commit is contained in:
Liu Shuang
2023-07-09 17:09:50 +08:00
committed by GitHub
parent 619ad71735
commit 7b22898f5d
3 changed files with 55 additions and 22 deletions

View File

@@ -30,7 +30,11 @@ type EditsResponse struct {
Choices []EditsChoice `json:"choices"`
}
// Perform an API call to the Edits endpoint.
// Edits Perform an API call to the Edits endpoint.
/* Deprecated: Users of the Edits API and its associated models (e.g., text-davinci-edit-001 or code-davinci-edit-001)
will need to migrate to GPT-3.5 Turbo by January 4, 2024.
You can use CreateChatCompletion or CreateChatCompletionStream instead.
*/
func (c *Client) Edits(ctx context.Context, request EditsRequest) (response EditsResponse, err error) {
req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/edits", fmt.Sprint(request.Model)), withBody(request))
if err != nil {