Skip to content

Commit eab237b

Browse files
committed
Add model enums for autocomplete
1 parent 23a3067 commit eab237b

File tree

1 file changed

+47
-11
lines changed

1 file changed

+47
-11
lines changed

openapi.yaml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.0
22
info:
33
title: OpenAI API
44
description: APIs for sampling from and fine-tuning language models
5-
version: '1.3.0'
5+
version: '1.3.1'
66
servers:
77
- url: https://api.openai.com/v1
88
tags:
@@ -2073,9 +2073,13 @@ components:
20732073
CreateCompletionRequest:
20742074
type: object
20752075
properties:
2076-
model: &model_configuration
2077-
description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
2078-
type: string
2076+
model:
2077+
description: &model_description |
2078+
ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
2079+
oneOf:
2080+
- type: string
2081+
- type: string
2082+
enum: ["text-davinci-003","text-davinci-002","text-davinci-001","code-davinci-002","text-curie-001","text-babbage-001","text-ada-001"]
20792083
prompt:
20802084
description: &completions_prompt_description |
20812085
The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays.
@@ -2411,7 +2415,11 @@ components:
24112415
properties:
24122416
model:
24132417
description: ID of the model to use. See the [model endpoint compatibility](/docs/models/model-endpoint-compatibility) table for details on which models work with the Chat API.
2414-
type: string
2418+
example: "gpt-3.5-turbo"
2419+
oneOf:
2420+
- type: string
2421+
- type: string
2422+
enum: ["gpt-4","gpt-4-0613","gpt-4-32k","gpt-4-32k-0613","gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-3.5-turbo-0613","gpt-3.5-turbo-16k-0613"]
24152423
messages:
24162424
description: A list of messages comprising the conversation so far. [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb).
24172425
type: array
@@ -2593,6 +2601,11 @@ components:
25932601
model:
25942602
description: ID of the model to use. You can use the `text-davinci-edit-001` or `code-davinci-edit-001` model with this endpoint.
25952603
type: string
2604+
example: "text-davinci-edit-001"
2605+
oneOf:
2606+
- type: string
2607+
- type: string
2608+
enum: ["text-davinci-edit-001","code-davinci-edit-001"]
25962609
input:
25972610
description:
25982611
The input text to use as a starting point for the edit.
@@ -2798,10 +2811,13 @@ components:
27982811
Two content moderations models are available: `text-moderation-stable` and `text-moderation-latest`.
27992812
28002813
The default is `text-moderation-latest` which will be automatically upgraded over time. This ensures you are always using our most accurate model. If you use `text-moderation-stable`, we will provide advanced notice before updating the model. Accuracy of `text-moderation-stable` may be slightly lower than for `text-moderation-latest`.
2801-
type: string
28022814
nullable: false
28032815
default: "text-moderation-latest"
28042816
example: "text-moderation-stable"
2817+
oneOf:
2818+
- type: string
2819+
- type: string
2820+
enum: ["text-moderation-latest","text-moderation-stable"]
28052821
required:
28062822
- input
28072823

@@ -3145,7 +3161,9 @@ components:
31453161
type: object
31463162
additionalProperties: false
31473163
properties:
3148-
model: *model_configuration
3164+
model:
3165+
description: ID of the model to use. You can use the [List models](/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](/docs/models/overview) for descriptions of them.
3166+
type: string
31493167
query:
31503168
description: Query to be classified.
31513169
type: string
@@ -3279,8 +3297,12 @@ components:
32793297
To learn more about these models, see the
32803298
[Models](https://platform.openai.com/docs/models) documentation.
32813299
default: "curie"
3282-
type: string
3300+
example: "curie"
32833301
nullable: true
3302+
oneOf:
3303+
- type: string
3304+
- type: string
3305+
enum: ["ada","babbage","curie","davinci"]
32843306
n_epochs:
32853307
description: |
32863308
The number of epochs to train the model for. An epoch refers to one
@@ -3416,7 +3438,13 @@ components:
34163438
type: object
34173439
additionalProperties: false
34183440
properties:
3419-
model: *model_configuration
3441+
model:
3442+
description: *model_description
3443+
example: "text-embedding-ada-002"
3444+
oneOf:
3445+
- type: string
3446+
- type: string
3447+
enum: ["text-embedding-ada-002"]
34203448
input:
34213449
description: |
34223450
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. Each input must not exceed the max input tokens for the model (8191 tokens for `text-embedding-ada-002`). [Example Python code](https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb) for counting tokens.
@@ -3501,7 +3529,11 @@ components:
35013529
model:
35023530
description: |
35033531
ID of the model to use. Only `whisper-1` is currently available.
3504-
type: string
3532+
example: whisper-1
3533+
oneOf:
3534+
- type: string
3535+
- type: string
3536+
enum: ["whisper-1"]
35053537
prompt:
35063538
description: |
35073539
An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should match the audio language.
@@ -3546,7 +3578,11 @@ components:
35463578
model:
35473579
description: |
35483580
ID of the model to use. Only `whisper-1` is currently available.
3549-
type: string
3581+
example: whisper-1
3582+
oneOf:
3583+
- type: string
3584+
- type: string
3585+
enum: ["whisper-1"]
35503586
prompt:
35513587
description: |
35523588
An optional text to guide the model's style or continue a previous audio segment. The [prompt](/docs/guides/speech-to-text/prompting) should be in English.

0 commit comments

Comments
 (0)