Expand description
Tools for Troupekit agents: one Tool trait, a registry that checks
arguments against each tool’s JSON Schema, typed tools from serde
structs, an SSRF-guarded HTTP client, web fetch, web search and
declarative HTTP tools. Third-party text is always fenced as untrusted.
Re-exports§
pub use declarative::http_toolkit_from_toml;pub use fetch::web_fetch;pub use http::is_public_ip;pub use http::receive;pub use http::HttpLimits;pub use http::Received;pub use http::GuardedHttp;pub use registry::compile_schema;pub use registry::schema_errors;pub use registry::valid_tool_name;pub use registry::ToolRegistry;pub use registry::Toolkit;pub use search::BraveSearch;pub use search::SearchHit;pub use search::SearchProvider;pub use search::SearchToolkit;pub use search::SearxngSearch;pub use secrets::EnvSecrets;pub use secrets::SecretSource;pub use text::cap_chars;pub use text::fence_capped;pub use text::fence_untrusted;pub use text::html_to_text;pub use text::response_text;pub use text::MAX_TEXT_CHARS;pub use tool::hosted;pub use tool::Tool;pub use tool::ToolContext;pub use tool::ToolError;pub use tool::ToolOutput;pub use typed::typed_tool;pub use typed::TypedTool;
Modules§
Structs§
- Http
Error - A failed transport call: its kind and a message without secrets.
Converts into
ProviderErrorhere and into tool errors in the tools crate, keeping the message. Displays as the message. - Http
Request - One outgoing HTTP request for any transport.
acceptlists the media types a 2xx answer may have (empty accepts any; guarded transports enforce it). Debug prints header names only, so a request holding an API key can be logged safely. - Http
Response - An HTTP reply: status, final URL after redirects, headers, a body still
to be read, and
truncatedwhen the transport cut the body at its own size limit. Header names keep the case the transport saw. - Tool
Spec - A tool as a model sees it: its name, what it does and a JSON Schema
for its arguments.
hostedmarks a tool a vendor may run server-side; wires without that send it as a plain tool and the local one runs.
Enums§
- Hosted
Tool - A server-side tool a vendor can run itself instead of the local tool
of the same name.
max_usescaps calls per agent run; fetch also caps the page tokens it reads. Serializes with akindtag in snake case. - Http
Error Kind - Kind of a failed transport call.
Invalidis a malformed request,Blockeda refused address or scheme,Rejecteda reply that broke a request rule,Timeouta time limit. - Method
- HTTP method of a request.
Deserializes from upper-case names such as
GETandPOST;as_strgives the same upper-case name for the wire.
Traits§
- Transport
- Sends HTTP requests. HTTP clients, guarded clients, proxies and test
fakes implement it, so models and tools never own an HTTP stack.
Returns
Okfor any status the server sent andErrwhen the request was refused, failed in transport or broke a limit.