Skip to content

cayu.testing.ToolResult

Part of cayu.testing.base. Read the Python API overview and install the required extra.

from cayu.testing import ToolResult

Result 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.

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
ToolResult.copy_result_data(value, info)
ToolResult.freeze_result_data(value: Any) -> Any
ToolResult.serialize_structured(value: Mapping[str, Any] | None, handler: SerializerFunctionWrapHandler) -> dict[str, Any] | None
ToolResult.serialize_artifacts(value: Sequence[Mapping[str, Any]], handler: SerializerFunctionWrapHandler) -> list[dict[str, Any]]
ToolResult.validate_content(value: str) -> str
ToolResult.model_copy(*, update: Mapping[str, Any] | None=None, deep: bool=False) -> ToolResult

Release source · Runtime guarantees · Capability guides