Interface CompletionInput

CompletionInput represents the full potential input options for completion.

interface CompletionInput {
    frequencyPenalty?: number;
    inputExtension?: InputExtension;
    logitBias?: {
        [token: string]: number;
    };
    maxTokens?: number;
    model: string;
    outputExtension?: OutputExtension;
    presencePenalty?: number;
    prompt: string;
    stop?: string | string[];
    stream?: boolean;
    temperature?: number;
    topK?: number;
    topP?: number;
}

Properties

frequencyPenalty?: number

frequencyPenalty represents a value between -2.0 and 2.0 to penalize tokens based on frequency.

inputExtension?: InputExtension

inputExtension represents a set of optional pre-processing integrations.

logitBias?: {
    [token: string]: number;
}

logitBias modifies the likelihood of specified tokens appearing in a response.

Type declaration

  • [token: string]: number
maxTokens?: number

maxTokens represents the max number of tokens to return.

model: string

model represents the model to use.

outputExtension?: OutputExtension

outputExtension represents a set of optional post-processing integrations.

presencePenalty?: number

presencePenalty represents a value between -2.0 and 2.0 to penalize tokens based on presence.

prompt: string

prompt represents the prompt to process.

stop?: string | string[]

stop represents one or more sequences where the API will stop generating tokens.

stream?: boolean

stream represents whether to stream back the model response.

temperature?: number

temperature represents the randomness in GPT's output.

topK?: number

topK represents the variability of the generated text.

topP?: number

topP represents the diversity of the generated text.