Skip to content

cayu.runtime.tool_completion

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu import ToolCompletionPolicy

Complete a single-call round from a designated successful tool.

The host renders the tool result. Eligible application tools declare NONE or IDEMPOTENT effects. Rounds with sibling calls continue through the ordinary model loop. Supply this policy on each new run or resumed turn; approval and crash recovery retain the admitted policy.

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
tool_names tuple[StrictStr, ...] Field(min_length=1, max_length=64)
ToolCompletionPolicy.validate_tool_names(value: object) -> tuple[str, ...]

Release source · Runtime guarantees · Capability guides

from cayu import ToolCompletionResult

Detached host-rendering basis from the canonical published tool outcome.

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
reason Literal['host_rendered_tool'] 'host_rendered_tool'
status Literal['completed'] 'completed'
call ToolCallPart required
effect ToolEffect required
result ToolResultPart required
ToolCompletionResult.detach_parts(value: object) -> object
ToolCompletionResult.validate_success() -> ToolCompletionResult

Release source · Runtime guarantees · Capability guides