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

Remove incorrect id and model properties from CreateEditResponse #16

Merged
merged 1 commit into from
Feb 22, 2023
Merged

Remove incorrect id and model properties from CreateEditResponse #16

merged 1 commit into from
Feb 22, 2023

Conversation

thejamescollins
Copy link
Contributor

@thejamescollins thejamescollins commented Feb 7, 2023

The id and model properties are defined in the CreateEditResponse schema, but these properties are not returned by the POST /edits endpoint.

These two properties are also listed as required, which causes issues with tools/libraries using this OpenAPI specification.

Your Postman Collection does not list these properties for the Create Edit response, it only lists object, created, choices and usage.

This pull request removes these id and model properties from the OpenAPI schema.

Example JSON response: from https://api.openai.com/v1/edits as of today:

{
  "object": "edit",
  "created": 1675740853,
  "choices": [
    {
      "text": "Write a tagline for an ice cream shop. sweetest place.\n",
      "index": 0
    }
  ],
  "usage": {
    "prompt_tokens": 27,
    "completion_tokens": 35,
    "total_tokens": 62
  }
}

The official API Reference does not mention either id or model in the response body:

{
  "object": "edit",
  "created": 1589478378,
  "choices": [
    {
      "text": "What day of the week is it?",
      "index": 0,
    }
  ],
  "usage": {
    "prompt_tokens": 25,
    "completion_tokens": 32,
    "total_tokens": 57
  }
}

So I believe these properties can be safely removed from the OpenAPI specification.

Fixes #7

Reported by @Netizine @janodev.

The `id` and `model` properties are not returned by the `POST` `/edits` endpoint.

Example JSON response from the `/edits` endpoint:

```
{
  "object": "edit",
  "created": 1675740853,
  "choices": [
    {
      "text": "Write a tagline for an ice cream shop. sweetest place.\n",
      "index": 0
    }
  ],
  "usage": {
    "prompt_tokens": 27,
    "completion_tokens": 35,
    "total_tokens": 62
  }
}
```

Reported in #7
@thejamescollins
Copy link
Contributor Author

Hi there @jeevnayak and @schnerd,

I'm wondering if you might be able to assist with this issue?

As far as I can tell, the response from the /edits POST endpoint has changed, with id and model properties no longer being returned.

If that's the case, would it be possible to merge this pull request so that the CreateEditResponse schema definition matches real API responses?

Thank you very much for your time.

@schnerd
Copy link
Collaborator

schnerd commented Feb 22, 2023

@om4james Thanks for opening this PR and sorry it took us a while to get back to you – things have been busy on our end. This changes looks correct, really appreciate the detailed description.

@thejamescollins
Copy link
Contributor Author

Thank you very much for this @schnerd 💯

thejamescollins added a commit to tectalichq/public-openai-client-js that referenced this pull request Feb 23, 2023
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

Successfully merging this pull request may close these issues.

Schema doesnt match response
2 participants