Chat
class Chat implements AgentInput
Methods
Create a chat input.
Get the newest user message, if the input contains one.
Get the tool approval decisions from the newest assistant message, if the input contains any.
Get every turn before the one this input resolves to.
Get the ID of the assistant message the response continues, if any.
Get the stream protocol for the chat.
Get the raw messages preceding the turn this input resolves to.
Get the newest of the given messages when it matches the given role.
Details
at line 20
__construct(array $messages)
Create a chat input.
at line 27
UserMessage|null
message()
Get the newest user message, if the input contains one.
at line 39
Decisions|null
decisions()
Get the tool approval decisions from the newest assistant message, if the input contains any.
at line 53
array
history()
Get every turn before the one this input resolves to.
at line 61
string|null
messageId()
Get the ID of the assistant message the response continues, if any.
at line 71
VercelDataProtocol
protocol()
Get the stream protocol for the chat.
at line 81
protected array
precedingMessages()
Get the raw messages preceding the turn this input resolves to.
at line 94
static protected array|null
latestOfRole(array $messages, string $role)
Get the newest of the given messages when it matches the given role.