WordPress\AiClient\Builders

PromptBuilder::withHistory │ public │ WP 0.1.0

Adds conversation history messages.

Historical messages are prepended to the beginning of the message list, before the current message being built.

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

Хуков нет.

Возвращает

self.

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

$PromptBuilder = new PromptBuilder();
$PromptBuilder->withHistory( Message ...$messages ): self;
Message ...$messages(обязательный)
.

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

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

Код PromptBuilder::withHistory() WP 7.1.2

public function withHistory(Message ...$messages): self
{
    // Prepend the history messages to the beginning of the messages array
    $this->messages = array_merge($messages, $this->messages);
    return $this;
}