Sets the model to use for generation.
Description
The model’s configuration will be merged with the builder’s configuration, with the builder’s configuration taking precedence for any overlapping settings.
Parameters
$modelWordPressAiClientProvidersModelsContractsModelInterfacerequired- The model to use.
Source
public function usingModel(ModelInterface $model): self
{
$this->model = $model;
// Merge model's config with builder's config, with builder's config taking precedence
$modelConfigArray = $model->getConfig()->toArray();
$builderConfigArray = $this->modelConfig->toArray();
$mergedConfigArray = array_merge($modelConfigArray, $builderConfigArray);
$this->modelConfig = ModelConfig::fromArray($mergedConfigArray);
return $this;
}
Changelog
| Version | Description |
|---|---|
| 0.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.