Adds conversation history messages.
Description
Historical messages are prepended to the beginning of the message list, before the current message being built.
Parameters
$messagesWordPressAiClientMessagesDTOMessagerequired- The messages to add to history.
Source
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;
}
Changelog
| Version | Description |
|---|---|
| 0.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.