StoredMessage
class StoredMessage implements Arrayable, JsonSerializable
A conversation message as it was persisted, with its JSON columns decoded.
Message is what the model sees; this is what was stored, and it keeps the
identity and timestamps a rendered transcript needs.
Methods
Create a stored conversation message.
Reconstruct an instance from a stored row, decoding its JSON columns.
Get the instance as an array, in the shape it was stored in.
Get the JSON serializable representation of the message.
The tool calls made across every step of the turn, in step order.
The provider-hosted tool calls made across every step of the turn, in step order.
The tool results recorded across every step of the turn, in step order.
Decode a JSON column, tolerating null and malformed values.
Details
at line 30
__construct(string $id, string $role, string $content, CarbonInterface|null $createdAt = null, array $usage = [], array $meta = [], array $steps = [], MessageStatus $status = MessageStatus::Completed, array $attachments = [])
Create a stored conversation message.
at line 48
static StoredMessage
fromArray(array $record)
Reconstruct an instance from a stored row, decoding its JSON columns.
at line 68
array
toArray()
Get the instance as an array, in the shape it was stored in.
at line 88
array
jsonSerialize()
Get the JSON serializable representation of the message.
at line 98
array
toolCalls()
The tool calls made across every step of the turn, in step order.
at line 108
array
providerToolCalls()
The provider-hosted tool calls made across every step of the turn, in step order.
at line 118
array
toolResults()
The tool results recorded across every step of the turn, in step order.
at line 131
static protected array
decoded(mixed $value)
Decode a JSON column, tolerating null and malformed values.