TextResponse
class TextResponse implements Stringable
Traits
Properties
| Response|null | $raw | The raw HTTP response, if available for the provider. |
from HasRawResponse |
| Message> | $messages | ||
| ToolCall> | $toolCalls | ||
| ToolResult> | $toolResults | ||
| Step> | $steps | ||
| PendingApproval> | $pendingApprovals | ||
| string | $reasoning |
Methods
Prepare the instance for serialization, discarding the unserializable raw HTTP response.
Provide the tool calls and results for the message.
Provide the reasoning emitted across every step of the response.
Determine whether the response has tool calls pending approval.
Get the string representation of the object.
Details
in
HasRawResponse at line 19
HasRawResponse
withRawResponse(Response|null $response)
Set the raw HTTP response.
in
HasRawResponse at line 29
array
__serialize()
Prepare the instance for serialization, discarding the unserializable raw HTTP response.
at line 44
__construct(string $text, TextUsage $usage, Meta $meta)
Create a new text response instance.
at line 58
TextResponse
withMessages(Collection $messages)
Provide the message context for the response.
at line 85
TextResponse
withToolCallsAndResults(Collection $toolCalls, Collection $toolResults)
Provide the tool calls and results for the message.
at line 100
TextResponse
withReasoning(string $reasoning)
Provide the reasoning emitted across every step of the response.
at line 112
TextResponse
withSteps(Collection $steps)
Provide the steps taken to generate the response.
at line 124
TextResponse
withPendingApprovals(Collection $pendingApprovals)
Mark the response as waiting for tool approval.
at line 134
bool
hasPendingApprovals()
Determine whether the response has tool calls pending approval.
at line 142
string
__toString()
Get the string representation of the object.