Providing accurate and valid information for each argument is crucial for successful text
generation by the generative AI model. If any parameter is incorrect, the function responds with an
error message based on the API feedback. To view all supported generative AI models, use the
function available.models
.
harm.category.dangerous.content
Optional. An integer, from 1 to 5 inclusive, representing the threshold for dangerous content,
with a higher value representing a lower probability of being blocked.
harm.category.harassment
Optional. An integer, from 1 to 5 inclusive, representing the threshold for harasment content,
with a higher value representing a lower probability of being blocked.
harm.category.hate.speech
Optional. An integer, from 1 to 5 inclusive, representing the threshold for hate speech and
content, with a higher value representing a lower probability of being blocked.
harm.category.sexually.explicit
Optional. An integer, from 1 to 5 inclusive, representing the threshold for sexually explicit
content, with a higher value representing a lower probability of being blocked.
stop.sequences
Optional. A list of character sequences (up to 5) that will stop output generation. If specified,
the API will stop at the first appearance of a stop sequence. The stop sequence will not be
included as part of the response.
max.output.tokens
Optional. An integer, value varies by model, representing maximum number of tokens to include
in a candidate.
temperature
Optional. A number, from 0.0 to 1.0 inclusive, controlling the randomness of the output.
top.p
Optional. A number, value varies by model, representing maximum cumulative probability of tokens
to consider when sampling.
top.k
Optional. A number, value varies by model, representing maximum number of tokens to consider when sampling.
frequency.penalty
Optional. A number from -2.0 to 2.0 inclusive. Positive values penalize new tokens based on their
existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
logit.bias
Optional. A map. Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object
that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to
100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact
effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection;
values like -100 or 100 should result in a ban or exclusive selection of the relevant token.
logprobs
Optional. A boolean value. Whether to return log probabilities of the output tokens or not. If true, returns the log
probabilities of each output token returned in the content of message
top.logprobs
Optional. An integer between 0 and 5 specifying the number of most likely tokens to return at each token
position, each with an associated log probability. logprobs
must be set to TRUE
if this
parameter is used.
max.tokens
Optional. An integer. The maximum number of tokens that can be generated in the chat completion. The total length of
input tokens and generated tokens is limited by the model's context length.
presence.penalty
Optional. A Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear
in the text so far, increasing the model's likelihood to talk about new topics.
response.format
Optional. An object specifying the format that the model must output. Compatible with GPT-4 Turbo and
all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106
.
seed
Optional. An integer. If specified, our system will make a best effort to sample deterministically, such that repeated
requests with the same seed and parameters should return the same result.
stop
Optional. A character string or list contains up to 4 sequences where the API will stop generating further tokens.
temperature
Optional. A number. What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output
more random, while lower values like 0.2 will make it more focused and deterministic.
top.p
Optional. A number. An alternative to sampling with temperature, called nucleus sampling, where the model considers
the results of the tokens with top.p
probability mass. So 0.1 means only the tokens comprising the top
10
tools
Optional. A list of tools the model may call. Currently, only functions are supported as a tool. Use this
to provide a list of functions the model may generate JSON inputs for.
tool.choice
Optional. A character string or object. Controls which (if any) function is called by the model. none
means
the model will not call a function and instead generates a message. auto
means the model can pick
between generating a message or calling a function.
user
Optional. A character string. A unique identifier representing your end-user, which can help OpenAI to monitor
and detect abuse.