Interface IPromptQueryConfig_UseSampling
-
public interface IPromptQueryConfig_UseSamplingMixin for aquery connection configuration modelthat allows the decide whether the model should use sampling or greedy decoding when generating text. If sampling is not used, the model uses greedy decoding, always picking the most likely next token. If sampling is used, the model samples from the probability distribution according to parameters such astemperatureortop-p, allowing for more diverse and creative outputs.Use of this mixin is optional, but ensures a consistent name for the property. When different prompt service handlers use the same property name, switching between different prompt service handlers preserves the configured system prompt.
See also the
<xp:useSampling/>Faces component from thehttp://www.xima.de/taglib/xfc/promptnamespace, which provides a user interface for editing the data defined by this mixin.- Since:
- 8.5.0
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_USE_SAMPLINGThe name of the use sampling attribute.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisUseSampling()Gets whether the model should use sampling or greedy decoding when generating text.voidsetUseSampling(boolean useSampling)Sets whether the model should use sampling or greedy decoding when generating text.
-
-
-
Field Detail
-
ATTR_USE_SAMPLING
static final String ATTR_USE_SAMPLING
The name of the use sampling attribute. If you implement a custom serialization / deserialization, use this name for the attribute to increase compatibility with other prompt service handlers.- See Also:
- Constant Field Values
-
-
Method Detail
-
isUseSampling
boolean isUseSampling()
Gets whether the model should use sampling or greedy decoding when generating text.- Returns:
- Whether to use sampling.
-
setUseSampling
void setUseSampling(boolean useSampling)
Sets whether the model should use sampling or greedy decoding when generating text.- Parameters:
useSampling- Whether to use sampling.
-
-