cayu.tools.result_projection
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.
ARTIFACT_EXTERNALIZING_TOOL_RESULT_POLICY_ID
Section titled “ARTIFACT_EXTERNALIZING_TOOL_RESULT_POLICY_ID”from cayu.tools import ARTIFACT_EXTERNALIZING_TOOL_RESULT_POLICY_IDARTIFACT_EXTERNALIZING_TOOL_RESULT_POLICY_ID = 'cayu.artifact_externalizing_tool_result.v1'Release source · Runtime guarantees · Capability guides
ArtifactExternalizingToolResultPolicy
Section titled “ArtifactExternalizingToolResultPolicy”from cayu.tools import ArtifactExternalizingToolResultPolicyExternalize oversized redacted text through the configured ArtifactStore.
Decorators: @dataclass(frozen=True, slots=True, init=False).
Bases: ToolResultProjectionPolicy.
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 |
|---|---|---|
max_inline_bytes |
int | None |
required |
max_inline_token_estimate |
int | None |
required |
preview_bytes |
int |
required |
chars_per_token |
int |
required |
identity (property)
Section titled “identity (property)”ArtifactExternalizingToolResultPolicy.identity() -> strproject (method)
Section titled “project (method)”async ArtifactExternalizingToolResultPolicy.project(request: ToolResultProjectionRequest) -> ToolResultProjectioninit (method)
Section titled “init (method)”ArtifactExternalizingToolResultPolicy.__init__(*, max_inline_bytes: int | None=DEFAULT_TOOL_RESULT_MAX_INLINE_BYTES, max_inline_token_estimate: int | None=DEFAULT_TOOL_RESULT_MAX_INLINE_TOKEN_ESTIMATE, preview_bytes: int=DEFAULT_TOOL_RESULT_PREVIEW_BYTES, chars_per_token: int=DEFAULT_TOOL_RESULT_ESTIMATE_CHARS_PER_TOKEN) -> Nonetoken_estimation_method (property)
Section titled “token_estimation_method (property)”ArtifactExternalizingToolResultPolicy.token_estimation_method() -> strreadback_max_bytes (property)
Section titled “readback_max_bytes (property)”ArtifactExternalizingToolResultPolicy.readback_max_bytes() -> intLargest generated text read guaranteed to stay inline under this policy.
estimate_tokens (method)
Section titled “estimate_tokens (method)”ArtifactExternalizingToolResultPolicy.estimate_tokens(text: str) -> intRelease source · Runtime guarantees · Capability guides
copy_tool_result_projection_policy
Section titled “copy_tool_result_projection_policy”from cayu.tools import copy_tool_result_projection_policyValidate a policy collaborator; the built-in policy is immutable.
copy_tool_result_projection_policy(policy: ToolResultProjectionPolicy | None) -> ToolResultProjectionPolicy | NoneRelease source · Runtime guarantees · Capability guides
DEFAULT_TOOL_RESULT_ESTIMATE_CHARS_PER_TOKEN
Section titled “DEFAULT_TOOL_RESULT_ESTIMATE_CHARS_PER_TOKEN”from cayu.tools import DEFAULT_TOOL_RESULT_ESTIMATE_CHARS_PER_TOKENDEFAULT_TOOL_RESULT_ESTIMATE_CHARS_PER_TOKEN = 4Release source · Runtime guarantees · Capability guides
DEFAULT_TOOL_RESULT_MAX_INLINE_BYTES
Section titled “DEFAULT_TOOL_RESULT_MAX_INLINE_BYTES”from cayu.tools import DEFAULT_TOOL_RESULT_MAX_INLINE_BYTESDEFAULT_TOOL_RESULT_MAX_INLINE_BYTES = 32 * 1024Release source · Runtime guarantees · Capability guides
DEFAULT_TOOL_RESULT_MAX_INLINE_TOKEN_ESTIMATE
Section titled “DEFAULT_TOOL_RESULT_MAX_INLINE_TOKEN_ESTIMATE”from cayu.tools import DEFAULT_TOOL_RESULT_MAX_INLINE_TOKEN_ESTIMATEDEFAULT_TOOL_RESULT_MAX_INLINE_TOKEN_ESTIMATE = 8 * 1024Release source · Runtime guarantees · Capability guides
DEFAULT_TOOL_RESULT_PREVIEW_BYTES
Section titled “DEFAULT_TOOL_RESULT_PREVIEW_BYTES”from cayu.tools import DEFAULT_TOOL_RESULT_PREVIEW_BYTESDEFAULT_TOOL_RESULT_PREVIEW_BYTES = 2 * 1024Release source · Runtime guarantees · Capability guides
MAX_PROJECTED_TOOL_RESULT_CONTENT_BYTES
Section titled “MAX_PROJECTED_TOOL_RESULT_CONTENT_BYTES”from cayu.tools import MAX_PROJECTED_TOOL_RESULT_CONTENT_BYTESMAX_PROJECTED_TOOL_RESULT_CONTENT_BYTES = 64 * 1024Release source · Runtime guarantees · Capability guides
MAX_TOOL_RESULT_ARTIFACT_REFERENCE_BYTES
Section titled “MAX_TOOL_RESULT_ARTIFACT_REFERENCE_BYTES”from cayu.tools import MAX_TOOL_RESULT_ARTIFACT_REFERENCE_BYTESMAX_TOOL_RESULT_ARTIFACT_REFERENCE_BYTES = 4 * 1024Release source · Runtime guarantees · Capability guides
MAX_TOOL_RESULT_PREVIEW_BYTES
Section titled “MAX_TOOL_RESULT_PREVIEW_BYTES”from cayu.tools import MAX_TOOL_RESULT_PREVIEW_BYTESMAX_TOOL_RESULT_PREVIEW_BYTES = MAX_PROJECTED_TOOL_RESULT_CONTENT_BYTES - 4 * 1024Release source · Runtime guarantees · Capability guides
TOOL_RESULT_ARTIFACT_TYPE
Section titled “TOOL_RESULT_ARTIFACT_TYPE”from cayu.tools import TOOL_RESULT_ARTIFACT_TYPETOOL_RESULT_ARTIFACT_TYPE = 'cayu.tool_result_artifact.v1'Release source · Runtime guarantees · Capability guides
TOOL_RESULT_TOKEN_ESTIMATION_METHOD
Section titled “TOOL_RESULT_TOKEN_ESTIMATION_METHOD”from cayu.tools import TOOL_RESULT_TOKEN_ESTIMATION_METHODTOOL_RESULT_TOKEN_ESTIMATION_METHOD = 'unicode_codepoints_divided_by_4_ceiling_v1'Release source · Runtime guarantees · Capability guides
ToolResultProjection
Section titled “ToolResultProjection”from cayu.tools import ToolResultProjectionDecorators: @dataclass(frozen=True, slots=True).
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 |
|---|---|---|
result |
ToolResult |
required |
record |
ToolResultProjectionRecord |
required |
Release source · Runtime guarantees · Capability guides
ToolResultProjectionPolicy
Section titled “ToolResultProjectionPolicy”from cayu.tools import ToolResultProjectionPolicyProjects final redacted tool results before durable terminal publication.
Bases: ABC.
identity (property)
Section titled “identity (property)”ToolResultProjectionPolicy.identity() -> strStable, version-identifiable policy name used in durable evidence.
project (method)
Section titled “project (method)”async ToolResultProjectionPolicy.project(request: ToolResultProjectionRequest) -> ToolResultProjectionReturn a bounded model-facing result and content-free projection record.
Release source · Runtime guarantees · Capability guides
ToolResultProjectionRecord
Section titled “ToolResultProjectionRecord”from cayu.tools import ToolResultProjectionRecordBounded, content-free evidence for one configured projection decision.
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 |
|---|---|---|
schema_version |
Literal[1] |
1 |
status |
ToolResultProjectionStatus |
required |
policy_id |
str |
required |
original_bytes |
StrictInt |
Field(ge=0) |
projected_bytes |
StrictInt |
Field(ge=0) |
original_token_estimate |
StrictInt |
Field(ge=0) |
projected_token_estimate |
StrictInt |
Field(ge=0) |
token_estimation_method |
str |
required |
artifact_id |
str | None |
None |
artifact_sha256 |
str | None |
None |
logical_identity_sha256 |
str | None |
None |
tool_call_id_sha256 |
str | None |
None |
failure_type |
str | None |
None |
store_id_bytes |
StrictInt | None |
Field(default=None, ge=0) |
store_id_max_bytes |
StrictInt | None |
Field(default=None, ge=1) |
artifact_write_settlement |
ArtifactWriteSettlementEvidence | None |
None |
validate_identity_fields (method)
Section titled “validate_identity_fields (method)”ToolResultProjectionRecord.validate_identity_fields(value: str, info) -> strvalidate_optional_identity_fields (method)
Section titled “validate_optional_identity_fields (method)”ToolResultProjectionRecord.validate_optional_identity_fields(value: str | None, info) -> str | Nonecopy_settlement_evidence (method)
Section titled “copy_settlement_evidence (method)”ToolResultProjectionRecord.copy_settlement_evidence(value: object) -> ArtifactWriteSettlementEvidence | Nonevalidate_status_fields (method)
Section titled “validate_status_fields (method)”ToolResultProjectionRecord.validate_status_fields() -> ToolResultProjectionRecordRelease source · Runtime guarantees · Capability guides
ToolResultProjectionRequest
Section titled “ToolResultProjectionRequest”from cayu.tools import ToolResultProjectionRequestFinal redacted tool result plus the durable identity needed for projection.
Decorators: @dataclass(frozen=True, slots=True).
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 |
|---|---|---|
result |
ToolResult |
required |
session_id |
str |
required |
agent_name |
str |
required |
environment_name |
str | None |
required |
tool_call_id |
str |
required |
artifact_store |
ArtifactStore | None |
required |
Release source · Runtime guarantees · Capability guides
ToolResultProjectionStatus
Section titled “ToolResultProjectionStatus”from cayu.tools import ToolResultProjectionStatusBases: StrEnum.
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 |
|---|---|---|
UNCHANGED |
class attribute |
'unchanged' |
EXTERNALIZED |
class attribute |
'externalized' |
FAILED |
class attribute |
'failed' |