The TopP property returns or changes the nucleus sampling
value used when generating responses from the current model. Nucleus
sampling limits token selection to a subset of the most probable
tokens whose combined probability is less than or equal to the
specified value.
Lower values generally produce more focused and deterministic
responses by restricting token selection to a smaller set of highly
probable tokens. Higher values allow a broader range of token choices
and may produce more varied or creative responses.
Typical values range from 0.0 to 1.0. A value of 1.0 usually
indicates that nucleus sampling restrictions are disabled and the
provider should use the full probability distribution when selecting
tokens. The exact interpretation of this value may vary between
providers and models.
Support for nucleus sampling varies between providers and models.
Some providers may ignore this property entirely, use internal
defaults that cannot be overridden, or silently clamp values to a
supported range.
In most cases, applications should adjust only the
Temperature property and leave advanced sampling parameters
such as TopP and TopK at their default values unless
the application has specific requirements and understands how those
settings affect model behavior.
Changing the value of this property only affects subsequent
requests and does not modify existing messages or responses stored in
the conversation history.