cayu.testing.ToolResult
Part of cayu.testing.base. Read the Python API overview and install the required extra.
from cayu.testing import ToolResultResult returned from a tool call.
content is the model-facing summary. structured and artifacts are
for dashboards, workflows, storage, and downstream tools.
Frozen: results own their payloads (copied at construction) and are treated as read-only once returned from a tool.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
content |
str |
'' |
structured |
Mapping[str, Any] | None |
None |
artifacts |
Sequence[Mapping[str, Any]] |
Field(default_factory=list) |
is_error |
StrictBool |
False |
copy_result_data (method)
Section titled “copy_result_data (method)”ToolResult.copy_result_data(value, info)freeze_result_data (method)
Section titled “freeze_result_data (method)”ToolResult.freeze_result_data(value: Any) -> Anyserialize_structured (method)
Section titled “serialize_structured (method)”ToolResult.serialize_structured(value: Mapping[str, Any] | None, handler: SerializerFunctionWrapHandler) -> dict[str, Any] | Noneserialize_artifacts (method)
Section titled “serialize_artifacts (method)”ToolResult.serialize_artifacts(value: Sequence[Mapping[str, Any]], handler: SerializerFunctionWrapHandler) -> list[dict[str, Any]]validate_content (method)
Section titled “validate_content (method)”ToolResult.validate_content(value: str) -> strmodel_copy (method)
Section titled “model_copy (method)”ToolResult.model_copy(*, update: Mapping[str, Any] | None=None, deep: bool=False) -> ToolResult