Type Definitions
Answer
Type
-
Object
Properties
-
answers
Array.<String>
-
completion
String
|Completion
-
model
String
-
object
String
-
search_model
String
-
prompt
String
<optional>
-
selected_documents
Array.<AnswerDocument>
Source
AnswerBody
Type
-
Object
Properties
-
examples
Array.<Array.<String>>
List of (question, answer) pairs that will help steer the model towards the tone and answer format you'd like.
-
examples_context
String
A text snippet containing the contextual information used to generate the answers for the examples you provide.
-
documents
Array.<String>
<optional>
List of documents from which the answer for the input question should be derived.
-
file
String
<optional>
The ID of an uploaded file that contains documents to search over.
-
search_model
String
<optional>
ID of the engine to use for Search.
-
return_prompt
Boolean
<optional>
If set to true, the returned JSON will include a "prompt" field containing the final prompt that was used to request a completion.
-
expand
Array.<String>
<optional>
If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID.
-
max_rerank
Number
<optional>
The maximum number of documents to be ranked by Search when using file.
-
return_metadata
Boolean
<optional>
A special boolean flag for showing metadata.
-
max_tokens
Number
<optional>
The maximum number of tokens allowed for the generated answer.
-
temperature
Number
<optional>
What sampling temperature to use.
-
n
Number
<optional>
How many answers to generate for each question.
-
logprobs
Number
<optional>
Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens.
-
stop
String
|Array.<String>
<optional>
Up to 4 sequences where the API will stop generating further tokens.
-
logit_bias
Object
<optional>
Modify the likelihood of specified tokens appearing in the completion.
Source
AnswerDocument
Type
-
Object
Properties
-
document
Number
-
text
String
Source
Classification
Type
-
Object
Properties
-
completion
String
|Completion
-
label
String
-
model
String
-
object
String
-
search_model
String
-
prompt
String
<optional>
-
selected_examples
Array.<ClassificationExample>
Source
ClassificationBody
Type
-
Object
Properties
-
examples
Array.<Array.<String>>
<optional>
A list of examples with labels.
-
file
String
<optional>
The ID of the uploaded file that contains training examples.
-
labels
Array.<String>
<optional>
The set of categories being classified.
-
search_model
String
<optional>
ID of the engine to use for Search.
-
temperature
Number
<optional>
What sampling temperature to use.
-
logprobs
Number
<optional>
Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens.
-
max_examples
Number
<optional>
The maximum number of examples to be ranked by Search when using file.
-
logit_bias
Object
<optional>
Modify the likelihood of specified tokens appearing in the completion.
-
return_prompt
Boolean
<optional>
If set to true, the returned JSON will include a "prompt" field containing the final prompt that was used to request a completion.
-
return_metadata
Boolean
<optional>
A special boolean flag for showing metadata.
-
expand
Array.<String>
<optional>
If an object name is in the list, we provide the full information of the object; otherwise, we only provide the object ID.
Source
ClassificationExample
Type
-
Object
Properties
-
document
Number
-
label
String
-
text
String
Source
Completion
Type
-
Object
Properties
-
id
String
-
object
String
-
created
Number
|null
-
model
String
-
choices
array.<CompletionChoice>
Source
CompletionBody
Type
-
Object
Properties
-
max_tokens
Number
<optional>
The maximum number of tokens to generate.
-
temperature
Number
<optional>
What sampling temperature to use.
-
top_p
Number
<optional>
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
-
n
Number
<optional>
How many completions to generate for each prompt.
-
stream
Boolean
<optional>
Whether to stream back partial progress.
-
logprobs
Number
<optional>
Include the log probabilities on the logprobs most likely tokens, as well the chosen tokens.
-
echo
Boolean
<optional>
Echo back the prompt in addition to the completion
-
stop
String
|Array.<String>
<optional>
Up to 4 sequences where the API will stop generating further tokens.
-
presence_penalty
Number
<optional>
Number between 0 and 1 that penalizes new tokens based on whether they appear in the text so far.
-
frequency_penalty
Number
<optional>
Number between 0 and 1 that penalizes new tokens based on their existing frequency in the text so far.
-
best_of
Number
<optional>
Generates best_of completions server-side and returns the "best" (the one with the lowest log probability per token).
-
logit_bias
Object
<optional>
Modify the likelihood of specified tokens appearing in the completion.
Source
CompletionChoice
Type
-
Object
Properties
-
text
String
-
index
Number
-
logprobs
Number
|null
-
finish_reason
String
Source
DeletedFile
Type
-
Object
Properties
-
id
String
-
object
String
-
deleted
Boolean
Source
Engine
Type
-
Object
Properties
-
id
String
-
object
String
-
created
Number
|null
-
max_replicas
Number
|null
-
owner
String
-
permissions
any
-
ready
boolean
-
ready_replicas
boolean
|null
-
ready_replicas
any
Source
File
Type
-
Object
Properties
-
id
String
-
object
String
-
bytes
Number
-
created_at
Number
|null
-
filename
String
-
purpose
String
-
status
String
-
status_details
String
|null
Source
Search
Type
-
Object
Properties
-
document
Number
-
object
String
-
score
Number
Source
SearchBody
Type
-
Object
Properties
-
documents
Array.<String>
<optional>
Up to 200 documents to search over, provided as a list of strings.
-
file
String
<optional>
The ID of an uploaded file that contains documents to search over.
-
max_rerank
Number
<optional>
The maximum number of documents to be re-ranked and returned by search.
-
return_metadata
Boolean
<optional>
A special boolean flag for showing metadata.