Expand description
§aimux-provider-utils
Shared utilities for provider implementations.
Provides one-exchange HTTP helpers, response handlers, API key loading,
header management, and URL utilities — the Rust equivalents of
@ai-sdk/provider-utils. Operation retry and timeout live in aimux-core.
Re-exports§
pub use api_key::load_api_key;pub use get_from_api::get_from_api;pub use headers::with_user_agent_suffix;pub use http::ExchangeContext;pub use http::HttpBody;pub use http::HttpRequest;pub use http::ProxyConfig;pub use http::init_proxy;pub use http::sleep_or_abort;pub use logging::body_logging_enabled;pub use logging::init_logging;pub use logging::redact_body;pub use logging::redact_error_context;pub use multipart::MultipartForm;pub use multipart::media_type_to_extension;pub use post_to_api::post_form_data_to_api;pub use post_to_api::post_json_to_api;pub use post_to_api::post_to_api;pub use response_handler::ProviderErrorParts;pub use response_handler::ResponseHandler;pub use response_handler::ResponseHandlerInput;pub use response_handler::ResponseHandlerOutput;pub use response_handler::create_binary_response_handler;pub use response_handler::create_event_source_response_handler;pub use response_handler::create_json_error_response_handler;pub use response_handler::create_json_response_handler;pub use response_handler::create_standard_json_error_response_handler;pub use response_handler::create_status_code_error_response_handler;pub use response_handler::stream_error_api_call;pub use url::validate_base_url;pub use url::without_trailing_slash;pub use url::without_trailing_slash_opt;
Modules§
- api_key
- API key loading (from parameter or environment variable).
- extract_
response_ headers - Response header extraction for public error context.
- get_
from_ api - Single-exchange GET helper aligned with AI SDK.
- handle_
fetch_ error - Fetch error normalization.
- headers
- HTTP header utilities.
- http
- One shared HTTP client and one-exchange request transport.
- logging
- Unified logging (RFC-0014): connect the declared-but-unused
tracingdep. - multipart
- A simple multipart/form-data body builder.
- post_
to_ api - Single-exchange POST helpers aligned with AI SDK.
- read_
response_ with_ size_ limit - Bounded response reads.
- response_
handler - Successful and failed response handlers, aligned with AI SDK.
- retry
- Compatibility exports for retry configuration.
- url
- URL utilities.
Structs§
- Retry
Config - Default retry settings for model operations.
Functions§
- same_
origin - Compare scheme, host, and effective port. Unparseable inputs are never
same-origin. Public so providers can build credential allowlists on top
of it (AI SDK’s
isSameOrigin).