cayu.tools.web
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.
HttpxWebFetchTransport
Section titled “HttpxWebFetchTransport”from cayu.tools import HttpxWebFetchTransportStreaming HTTPX transport that connects to an already admitted IP address.
init (method)
Section titled “init (method)”HttpxWebFetchTransport.__init__(*, transport: httpx.AsyncBaseTransport | None=None) -> Nonefetch (method)
Section titled “fetch (method)”async HttpxWebFetchTransport.fetch(request: WebFetchHttpRequest) -> WebFetchHttpResponseRelease source · Runtime guarantees · Capability guides
SystemWebFetchResolver
Section titled “SystemWebFetchResolver”from cayu.tools import SystemWebFetchResolverResolve destinations with the local operating system resolver.
resolve (method)
Section titled “resolve (method)”async SystemWebFetchResolver.resolve(hostname: str, port: int) -> tuple[str, ...]Release source · Runtime guarantees · Capability guides
WebFetchAdapter
Section titled “WebFetchAdapter”from cayu.tools import WebFetchAdapterHigh-level execution adapter for the stable web_fetch tool contract.
Decorators: @runtime_checkable.
Bases: Protocol.
fetch (method)
Section titled “fetch (method)”async WebFetchAdapter.fetch(ctx: ToolContext, request: WebFetchAdapterRequest) -> ToolResultRelease source · Runtime guarantees · Capability guides
WebFetchAdapterRequest
Section titled “WebFetchAdapterRequest”from cayu.tools import WebFetchAdapterRequestCanonical bounded request passed to a selected web-fetch adapter.
Decorators: @dataclass(frozen=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 |
|---|---|---|
requested_url |
str |
required |
max_response_bytes |
int |
required |
max_content_bytes |
int |
required |
timeout_seconds |
float |
required |
max_redirects |
int |
required |
Release source · Runtime guarantees · Capability guides
WebFetchHttpRequest
Section titled “WebFetchHttpRequest”from cayu.tools import WebFetchHttpRequestOne admitted, DNS-pinned HTTPS request made by WebFetchTool.
Decorators: @dataclass(frozen=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 |
|---|---|---|
url |
str |
required |
pinned_url |
str |
required |
host_header |
str |
required |
server_hostname |
str |
required |
max_response_bytes |
int |
required |
timeout_seconds |
float |
required |
Release source · Runtime guarantees · Capability guides
WebFetchHttpResponse
Section titled “WebFetchHttpResponse”from cayu.tools import WebFetchHttpResponseBounded response returned by a web-fetch HTTP transport.
Decorators: @dataclass(frozen=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 |
|---|---|---|
status_code |
int |
required |
headers |
Mapping[str, str] |
required |
body |
bytes |
required |
Release source · Runtime guarantees · Capability guides
WebFetchHttpTransport
Section titled “WebFetchHttpTransport”from cayu.tools import WebFetchHttpTransportFetches one admitted HTTPS hop without following redirects.
Decorators: @runtime_checkable.
Bases: Protocol.
fetch (method)
Section titled “fetch (method)”async WebFetchHttpTransport.fetch(request: WebFetchHttpRequest) -> WebFetchHttpResponseRelease source · Runtime guarantees · Capability guides
WebFetchResolver
Section titled “WebFetchResolver”from cayu.tools import WebFetchResolverResolves every destination immediately before its request hop.
Decorators: @runtime_checkable.
Bases: Protocol.
resolve (method)
Section titled “resolve (method)”async WebFetchResolver.resolve(hostname: str, port: int) -> Sequence[str]Release source · Runtime guarantees · Capability guides
WebFetchTool
Section titled “WebFetchTool”from cayu.tools import WebFetchToolFetch bounded text from public HTTPS pages in the trusted Cayu process.
Bases: Tool.
init (method)
Section titled “init (method)”WebFetchTool.__init__(*, adapter: WebFetchAdapter | None=None, resolver: WebFetchResolver | None=None, transport: WebFetchHttpTransport | None=None, max_response_bytes: int=DEFAULT_WEB_FETCH_MAX_RESPONSE_BYTES, max_content_bytes: int=DEFAULT_WEB_FETCH_MAX_CONTENT_BYTES, timeout_seconds: float=DEFAULT_WEB_FETCH_TIMEOUT_SECONDS, max_redirects: int=DEFAULT_WEB_FETCH_MAX_REDIRECTS, execution_profile_identity: ExecutionProfileBehaviorIdentity | None=None, spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”WebFetchTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”WebFetchTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”WebFetchTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”WebFetchTool.description() -> strschema (property)
Section titled “schema (property)”WebFetchTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async WebFetchTool.run(ctx: ToolContext, args: dict[str, Any]) -> ToolResultRelease source · Runtime guarantees · Capability guides
WebSearchAdapter
Section titled “WebSearchAdapter”from cayu.tools import WebSearchAdapterHigh-level execution adapter for the stable web_search contract.
Decorators: @runtime_checkable.
Bases: Protocol.
search (method)
Section titled “search (method)”async WebSearchAdapter.search(ctx: ToolContext, request: WebSearchAdapterRequest) -> ToolResultRelease source · Runtime guarantees · Capability guides
WebSearchAdapterRequest
Section titled “WebSearchAdapterRequest”from cayu.tools import WebSearchAdapterRequestCanonical bounded request passed to a selected web-search adapter.
Decorators: @dataclass(frozen=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 |
|---|---|---|
query |
str |
required |
max_results |
int |
required |
max_snippet_bytes |
int |
required |
max_total_snippet_bytes |
int |
required |
timeout_seconds |
float |
required |
restrictions |
WebSearchRestrictions |
field(default_factory=WebSearchRestrictions) |
Release source · Runtime guarantees · Capability guides
WebSearchRestrictions
Section titled “WebSearchRestrictions”from cayu.tools import WebSearchRestrictionsApplication-owned restrictions for provider-backed web search.
These settings never enter the model-facing tool schema. Adapters must
either enforce every non-empty field or return unsupported_semantics;
silently broadening a restricted search is not permitted.
Decorators: @dataclass(frozen=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 |
|---|---|---|
include_domains |
tuple[str, ...] |
() |
exclude_domains |
tuple[str, ...] |
() |
published_on_or_after |
date | None |
None |
country |
str | None |
None |
locale |
str | None |
None |
content_types |
tuple[str, ...] |
() |
Release source · Runtime guarantees · Capability guides
WebSearchTool
Section titled “WebSearchTool”from cayu.tools import WebSearchToolSearch through one explicitly selected hosted-provider adapter.
Bases: Tool.
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 |
|---|---|---|
spec |
class attribute |
_web_search_tool_spec(default_results=DEFAULT_WEB_SEARCH_RESULTS, max_results=DEFAULT_WEB_SEARCH_MAX_RESULTS) |
init (method)
Section titled “init (method)”WebSearchTool.__init__(*, adapter: WebSearchAdapter, default_results: int=DEFAULT_WEB_SEARCH_RESULTS, max_results: int=DEFAULT_WEB_SEARCH_MAX_RESULTS, max_snippet_bytes: int=DEFAULT_WEB_SEARCH_MAX_SNIPPET_BYTES, max_total_snippet_bytes: int=DEFAULT_WEB_SEARCH_MAX_TOTAL_SNIPPET_BYTES, timeout_seconds: float=DEFAULT_WEB_SEARCH_TIMEOUT_SECONDS, restrictions: WebSearchRestrictions | None=None, execution_profile_identity: ExecutionProfileBehaviorIdentity | None=None, spec: ToolSpec | None=None) -> Nonename (property)
Section titled “name (property)”WebSearchTool.name() -> strexecution_profile_identity (property)
Section titled “execution_profile_identity (property)”WebSearchTool.execution_profile_identity() -> ExecutionProfileBehaviorIdentity | NoneReturn the stable behavior declaration frozen with this tool’s spec.
retain_arguments_for_model (property)
Section titled “retain_arguments_for_model (property)”WebSearchTool.retain_arguments_for_model() -> boolRetain bounded redacted original inputs privately for the same profile.
Independent of audit publication; oversized and compacted-away inputs may be omitted. This does not grant knowledge read or activation rights.
description (property)
Section titled “description (property)”WebSearchTool.description() -> strschema (property)
Section titled “schema (property)”WebSearchTool.schema() -> dict[str, Any]run (method)
Section titled “run (method)”async WebSearchTool.run(ctx: ToolContext, args: dict[str, Any]) -> ToolResult