TextDelta
class TextDelta extends StreamEvent
Properties
| string|null | $invocationId | from StreamEvent |
Methods
array
toArray()
Get the event as an array.
void
broadcast(Channel|array $channels, bool $now = true)
Broadcast the stream event immediately or using the queue.
from
StreamEvent
withInvocationId(string $id)
Set the invocation ID associated with the event.
from
StreamEvent
__construct(string $id, string $messageId, string $delta, int $timestamp)
Create a text delta event.
static string
combine(Collection|array $events)
Combine the text deltas, starting a new paragraph only after a step that ran tools.
static string
Details
at line 52
array
toArray()
Get the event as an array.
in
StreamEvent at line 26
void
broadcast(Channel|array $channels, bool $now = true)
Broadcast the stream event immediately or using the queue.
in
StreamEvent at line 41
void
broadcastNow(Channel|array $channels)
Broadcast the stream event immediately.
in
StreamEvent at line 49
string
type()
Get the event's type.
in
StreamEvent at line 57
StreamEvent
withInvocationId(string $id)
Set the invocation ID associated with the event.
in
StreamEvent at line 67
string
__toString()
Get the string representation of the event.
at line 14
__construct(string $id, string $messageId, string $delta, int $timestamp)
Create a text delta event.
at line 25
static string
combine(Collection|array $events)
Combine the text deltas, starting a new paragraph only after a step that ran tools.
at line 40
static string
join(Collection|array $texts)
Join the text of each step, separating the steps with a blank line.