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

chore: mark that /edits endpoints supports only text-davinci-edit-001 model #9

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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