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.
ToolCompletionPolicy
Section titled “ToolCompletionPolicy”from cayu import ToolCompletionPolicyComplete 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.
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 |
|---|---|---|
tool_names |
tuple[StrictStr, ...] |
Field(min_length=1, max_length=64) |
validate_tool_names (method)
Section titled “validate_tool_names (method)”ToolCompletionPolicy.validate_tool_names(value: object) -> tuple[str, ...]Release source · Runtime guarantees · Capability guides
ToolCompletionResult
Section titled “ToolCompletionResult”from cayu import ToolCompletionResultDetached host-rendering basis from the canonical published tool outcome.
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 |
|---|---|---|
reason |
Literal['host_rendered_tool'] |
'host_rendered_tool' |
status |
Literal['completed'] |
'completed' |
call |
ToolCallPart |
required |
effect |
ToolEffect |
required |
result |
ToolResultPart |
required |
detach_parts (method)
Section titled “detach_parts (method)”ToolCompletionResult.detach_parts(value: object) -> objectvalidate_success (method)
Section titled “validate_success (method)”ToolCompletionResult.validate_success() -> ToolCompletionResult