Skip to content

Commit

Permalink
chore: mark that /edits endpoints supports only text-davinci-edit-001…
Browse files Browse the repository at this point in the history
… model (#9)
  • Loading branch information
0x9ef authored Mar 30, 2023
1 parent f65eb30 commit a258ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions edits.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ type EditResponse struct {

// Edit given a prompt and an instruction, the model will return an edited version of the prompt.
//
// Pay attention! This works only with text-davinci-edit-001
// See issue: https://community.openai.com/t/is-edit-endpoint-documentation-incorrect/23361/10
//
// Docs: https://beta.openai.com/docs/api-reference/edits
func (e *Engine) Edit(ctx context.Context, opts *EditOptions) (*EditResponse, error) {
if err := e.validate.StructCtx(ctx, opts); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion edits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func TestEdits(t *testing.T) {
e := New(os.Getenv("OPENAI_KEY"))
r, err := e.Edit(context.Background(), &EditOptions{
Model: DefaultModel,
Model: "text-davinci-edit-001", // works only with this model
Input: "Write a little bit of Wikipedia. What is that?",
Instruction: "Write huge text about Wikipedia in education format.",
})
Expand Down

0 comments on commit a258ec5

Please sign in to comment.