ferrin-provider-util
Shared infrastructure for Ferrin provider adapters.
Part of the Ferrin workspace. Design:
docs/01-architecture/14-http-and-security.md, docs/01-architecture/02-crates.md.
Contents
http: theHttpTransporttrait,HttpRequest/HttpResponse/RequestBody(raw bytes or hand-encoded multipart),TransportError, the reqwest-basedReqwestTransport(featurereqwest, on by default: rustls, HTTP/2, no automatic redirects, no default timeout, DNS pinning per request), the request helperspost_json/post_form/post_bytes/get/delete/send, and response handlers (JSON, JSON error, text, binary, binary stream, server-sent events, JSON Lines, status code).sse: incremental WHATWG server-sent-events decoder with per-event size limit and receive timestamps.secure_url:UrlPolicy(scheme allow-list, private-network rejection, trusted and credentialed origins, redirect and body limits),validate_urlwith DNS resolution and address pinning,fetch/fetch_with_headerswith manual validated redirects.settings:load_api_key,load_setting,load_optional_setting(the only environment lookups in the workspace).ids:IdGenerator,PrefixedIdGenerator,generate_id.media_type: magic-number detection for images, PDF, audio and video; extension mapping; partial media type resolution.reasoning: reasoning level to provider effort/budget mapping with warnings.tool_name_mapping,streaming_tool_call,provider_options,provider_reference,response_metadata,batch,base_url,headers,retry(status classification,Retry-Afterparsing).
Example
use ResponseHandlers;
use json_error_response_handler;
use json_response_handler;
use post_json;
use Headers;
use CancellationToken;
async
Features
| Feature | Default | Effect |
|---|---|---|
reqwest |
on | ReqwestTransport and default_transport() |
platform-verifier |
off | Re-exports rustls_platform_verifier for platform initialisation hooks |