WordPress\AiClient\Builders
PromptBuilder::usingTopLogprobs
Sets the top log probabilities configuration.
If $topLogprobs is null, enables log probabilities. If $topLogprobs has a value, enables log probabilities and sets the number of top log probabilities to return.
Method of the class: PromptBuilder{}
No Hooks.
Returns
self.
Usage
$PromptBuilder = new PromptBuilder(); $PromptBuilder->usingTopLogprobs( ?int $topLogprobs ): self;
- ?int $topLogprobs
- .
Default:null
Changelog
| Since 0.1.0 | Introduced. |
PromptBuilder::usingTopLogprobs() PromptBuilder::usingTopLogprobs code WP 7.0
public function usingTopLogprobs(?int $topLogprobs = null): self
{
// Always enable log probabilities
$this->modelConfig->setLogprobs(\true);
// If a specific number is provided, set it
if ($topLogprobs !== null) {
$this->modelConfig->setTopLogprobs($topLogprobs);
}
return $this;
}