Skip to main content

Module openai

Module openai 

Source
Expand description

OpenAI baseline contract.

Sources: Chat Completions and Completions, read on 2026-10-21. These are documented bounds, not hosted-server probes. All bounds are inclusive.

Constants§

MAX_BEST_OF
Upper bound for completion best_of.
MAX_FREQUENCY_PENALTY
Upper bound for frequency_penalty.
MAX_LOGIT_BIAS
Upper bound for one logit_bias value.
MAX_LOGPROBS
Upper bound for the integer completion logprobs.
MAX_N
Upper bound for n.
MAX_PRESENCE_PENALTY
Upper bound for presence_penalty.
MAX_TEMPERATURE
Upper bound for temperature.
MAX_TOP_LOGPROBS
Upper bound for chat top_logprobs.
MAX_TOP_P
Upper bound for top_p.
MIN_BEST_OF
Lower bound for completion best_of.
MIN_FREQUENCY_PENALTY
Lower bound for frequency_penalty.
MIN_LOGIT_BIAS
Lower bound for one logit_bias value.
MIN_LOGPROBS
Lower bound for the integer completion logprobs.
MIN_N
Lower bound for n.
MIN_PRESENCE_PENALTY
Lower bound for presence_penalty.
MIN_TEMPERATURE
Lower bound for temperature.
MIN_TOP_LOGPROBS
Lower bound for chat top_logprobs.
MIN_TOP_P
Lower bound for top_p.

Traits§

OpenAIValidation
Covered OpenAI request checks.

Functions§

validate_best_of
Accepts None or completion best_of in 0..=20.
validate_completion_logprobs
Accepts None or the integer /v1/completions logprobs in 0..=5.
validate_frequency_penalty
Accepts None or frequency_penalty in [-2, 2].
validate_logit_bias_value
Accepts one parsed logit_bias value in [-100, 100], without clamping.
validate_n
Accepts None or n in 1..=128.
validate_presence_penalty
Accepts None or presence_penalty in [-2, 2].
validate_temperature
Accepts None or temperature in [0, 2].
validate_top_logprobs
Accepts None or chat top_logprobs in 0..=20.
validate_top_p
Accepts None or top_p in [0, 1].