Skip to content

cayu.tools.discovery

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.tools import TOOL_DISCOVERY_INSPECTION_MAX_GRANTS
TOOL_DISCOVERY_INSPECTION_MAX_GRANTS = TOOL_DISCOVERY_MAX_GRANTS

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryGrantInspection

Content-minimized discovery grant state safe for control-plane reads.

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
schema_version Literal[1] TOOL_DISCOVERY_SCHEMA_VERSION
tool_id str required
tool_name str required
descriptor_version str required
schema_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
created_at datetime required
discovered_revision StrictInt Field(ge=1, le=TOOL_DISCOVERY_MAX_GRANTS)
ToolDiscoveryGrantInspection.validate_schema_version(value: object) -> object
ToolDiscoveryGrantInspection.validate_tool_id(value: str) -> str
ToolDiscoveryGrantInspection.validate_tool_name(value: str) -> str
ToolDiscoveryGrantInspection.validate_descriptor_version(value: str) -> str
ToolDiscoveryGrantInspection.normalize_created_at(value: datetime) -> datetime

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryGrantRecord

One persistent, branch-local addressability grant created by search.

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
schema_version Literal[1] TOOL_DISCOVERY_SCHEMA_VERSION
grant_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
tool_ref str Field(pattern=TOOL_DISCOVERY_REFERENCE_PATTERN)
tool_id str required
tool_name str required
catalogue_revision str required
descriptor_version str required
schema_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
origin_query_sha256 str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
origin_model_step_id str required
created_at datetime required
discovered_revision StrictInt Field(ge=1, le=TOOL_DISCOVERY_MAX_GRANTS)
ToolDiscoveryGrantRecord.validate_schema_version(value: object) -> object
ToolDiscoveryGrantRecord.validate_tool_ref(value: str) -> str
ToolDiscoveryGrantRecord.validate_bounded_text(value: str, info) -> str
ToolDiscoveryGrantRecord.validate_tool_id(value: str) -> str
ToolDiscoveryGrantRecord.validate_catalogue_revision(value: str) -> str
ToolDiscoveryGrantRecord.validate_descriptor_version(value: str) -> str
ToolDiscoveryGrantRecord.normalize_created_at(value: datetime) -> datetime

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryMode

Application-selected tool-discovery delivery policy.

Bases: StrEnum.

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
SEARCH_TOOLS class attribute SEARCH_TOOLS_NAME
OPENAI_TOOL_SEARCH_CLIENT class attribute 'openai_tool_search_client'
OPENAI_TOOL_SEARCH_CLIENT_OR_SEARCH_TOOLS class attribute 'openai_tool_search_client_or_search_tools'
OPENAI_TOOL_SEARCH_HOSTED class attribute 'openai_tool_search_hosted'
OPENAI_TOOL_SEARCH_HOSTED_OR_SEARCH_TOOLS class attribute 'openai_tool_search_hosted_or_search_tools'

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryProjectionKind

One concrete provider projection selected for an invocation.

Bases: StrEnum.

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
SEARCH_TOOLS class attribute SEARCH_TOOLS_NAME
OPENAI_TOOL_SEARCH_CLIENT class attribute 'openai_tool_search_client'
OPENAI_TOOL_SEARCH_HOSTED class attribute 'openai_tool_search_hosted'

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoverySearchMatch

Bounded model-facing descriptor returned by search_tools.

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_ref str Field(pattern=TOOL_DISCOVERY_REFERENCE_PATTERN)
tool_id str required
name str required
description str required
input_schema Mapping[str, Any] required
descriptor_version str required
schema_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
readiness Literal['registered'] 'registered'
ToolDiscoverySearchMatch.validate_tool_ref(value: str) -> str
ToolDiscoverySearchMatch.validate_tool_id(value: str) -> str
ToolDiscoverySearchMatch.validate_name(value: str) -> str
ToolDiscoverySearchMatch.validate_description(value: str) -> str
ToolDiscoverySearchMatch.copy_schema(value: object) -> dict[str, Any]
ToolDiscoverySearchMatch.freeze_schema(value: Mapping[str, Any]) -> Mapping[str, Any]
ToolDiscoverySearchMatch.serialize_schema(value: Mapping[str, Any]) -> dict[str, Any]
ToolDiscoverySearchMatch.validate_descriptor_version(value: str) -> str
ToolDiscoverySearchMatch.validate_schema_fingerprint() -> ToolDiscoverySearchMatch

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoverySearchResult

Deterministic result and durable view revision from one catalogue search.

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
schema_version Literal[1] TOOL_DISCOVERY_SCHEMA_VERSION
query str required
matches tuple[ToolDiscoverySearchMatch, ...] required
view_revision StrictInt Field(ge=0)
truncated StrictBool False
ToolDiscoverySearchResult.validate_schema_version(value: object) -> object
ToolDiscoverySearchResult.validate_query(value: str) -> str
ToolDiscoverySearchResult.bound_matches(value: object) -> object
ToolDiscoverySearchResult.bound_serialized_result() -> ToolDiscoverySearchResult

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryViewInconsistentError

Raised when durable view state conflicts with current session authority.

Bases: RuntimeError.

This type’s implementation and inherited behavior are available in the linked release source.

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryViewInitialization

Typed authority needed to initialize one session-local discovery view.

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
session_id str required
agent_name str required
catalogue_revision str required
ceiling_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
ToolDiscoveryViewInitialization.validate_required_text(value: str, info) -> str
ToolDiscoveryViewInitialization.validate_catalogue_revision(value: str) -> str

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryViewInspection

Bounded current-view projection without schemas or callable references.

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
schema_version Literal[1] TOOL_DISCOVERY_SCHEMA_VERSION
session_id str required
generation_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
agent_name str required
catalogue_revision str required
ceiling_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
revision StrictInt Field(ge=0, le=TOOL_DISCOVERY_MAX_GRANTS)
grant_count StrictInt Field(ge=0, le=TOOL_DISCOVERY_MAX_GRANTS)
grants tuple[ToolDiscoveryGrantInspection, ...] ()
grants_truncated StrictBool required
ToolDiscoveryViewInspection.validate_schema_version(value: object) -> object
ToolDiscoveryViewInspection.validate_required_text(value: str, info) -> str
ToolDiscoveryViewInspection.validate_catalogue_revision(value: str) -> str
ToolDiscoveryViewInspection.bound_grants(value: object) -> object
ToolDiscoveryViewInspection.validate_projection() -> ToolDiscoveryViewInspection

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryViewNotEnabledError

Raised when a session has no configured discovery view.

Bases: RuntimeError.

This type’s implementation and inherited behavior are available in the linked release source.

Release source · Runtime guarantees · Capability guides

from cayu.tools import ToolDiscoveryViewState

Versioned durable tool view for one session branch.

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
schema_version Literal[1] TOOL_DISCOVERY_SCHEMA_VERSION
session_id str required
generation_id str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
agent_name str required
catalogue_revision str required
ceiling_fingerprint str Field(pattern=TARGETED_TOOL_DIGEST_PATTERN)
revision StrictInt Field(ge=0, le=TOOL_DISCOVERY_MAX_GRANTS)
grants tuple[ToolDiscoveryGrantRecord, ...] ()
ToolDiscoveryViewState.validate_schema_version(value: object) -> object
ToolDiscoveryViewState.validate_required_text(value: str, info) -> str
ToolDiscoveryViewState.validate_catalogue_revision(value: str) -> str
ToolDiscoveryViewState.bound_grants(value: object) -> object
ToolDiscoveryViewState.validate_grants() -> ToolDiscoveryViewState
ToolDiscoveryViewState.record_for_reference(tool_ref: str) -> ToolDiscoveryGrantRecord | None

Resolve an exact opaque reference inside this view.

Release source · Runtime guarantees · Capability guides