WordPress\AiClient\Builders

PromptBuilder::usingModel │ public │ WP 0.1.0

Sets the model to use for generation.

The model's configuration will be merged with the builder's configuration, with the builder's configuration taking precedence for any overlapping settings.

Метод класса: PromptBuilder{}

Хуков нет.

Возвращает

self.

Использование

$PromptBuilder = new PromptBuilder();
$PromptBuilder->usingModel( $model ): self;
$model(ModelInterface) (обязательный)
The model to use.

Список изменений

С версии 0.1.0 Введена.

Код PromptBuilder::usingModel() WP 7.1.4

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;
}