ToolResult
class ToolResult implements Arrayable, JsonSerializable
Methods
Create a tool result.
Reconstruct an instance from a previously serialized toArray() payload.
Determine if the tool call ran and produced its own result.
Get the message explaining why the tool call did not succeed.
Get the result as a string suitable for sending back to a provider.
Get the instance as an array, only including the denied and failed keys when they apply.
Get the JSON serializable representation of the instance.
Details
at line 15
__construct(string $id, string $name, array $arguments, mixed $result, string|null $resultId = null, bool $denied = false, bool $failed = false)
Create a tool result.
at line 29
static ToolResult
fromArray(array $data)
Reconstruct an instance from a previously serialized toArray() payload.
at line 45
bool
successful()
Determine if the tool call ran and produced its own result.
at line 53
string|null
error()
Get the message explaining why the tool call did not succeed.
at line 61
string
text()
Get the result as a string suitable for sending back to a provider.
at line 73
array
toArray()
Get the instance as an array, only including the denied and failed keys when they apply.
at line 89
array
jsonSerialize()
Get the JSON serializable representation of the instance.