interface SamplingParams {
    max_completion_tokens?: number;
    response_format?: ResponseFormatJSONSchema | ResponseFormatText | ResponseFormatJSONObject;
    seed?: number;
    temperature?: number;
    tools?: ChatCompletionTool[];
    top_p?: number;
}

Properties

max_completion_tokens?: number

The maximum number of tokens in the generated output.

response_format?: ResponseFormatJSONSchema | ResponseFormatText | ResponseFormatJSONObject

An object specifying the format that the model must output.

Setting to { "type": "json_schema", "json_schema": {...} } enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the Structured Outputs guide.

Setting to { "type": "json_object" } enables the older JSON mode, which ensures the message the model generates is valid JSON. Using json_schema is preferred for models that support it.

seed?: number

A seed value to initialize the randomness, during sampling.

temperature?: number

A higher temperature increases randomness in the outputs.

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. A max of 128 functions are supported.

top_p?: number

An alternative to temperature for nucleus sampling; 1.0 includes all tokens.