pub struct Provider { /* private fields */ }Expand description
The model call for every API the Rust providers cover. A request whose signal is already aborted is not sent:
it ends as an empty aborted message. api_key fills requests that carry none (a subagent’s loop).
Implementations§
Source§impl Provider
impl Provider
pub fn new() -> Self
Sourcepub fn with_request_settings(self, request: RequestSettings) -> Self
pub fn with_request_settings(self, request: RequestSettings) -> Self
Requests take request’s settings where they set none (crate::request_settings).
Sourcepub fn with_live_settings(self, settings: SettingsReader) -> Self
pub fn with_live_settings(self, settings: SettingsReader) -> Self
Requests take the settings as settings reads them before each request, so a /settings change of
transport, httpIdleTimeoutMs (the request timeout and the transport’s idle timeout) or retry.provider
applies to the next request (TS harness.setStreamOptions). The process transport follows httpIdleTimeoutMs
too, until with_transport replaces it.
Sourcepub fn with_transport(self, transport: Arc<dyn Transport>) -> Self
pub fn with_transport(self, transport: Arc<dyn Transport>) -> Self
Requests go over transport (tests and embedders), whatever httpIdleTimeoutMs says.
Sourcepub fn stream_options(&self) -> Option<Value>
pub fn stream_options(&self) -> Option<Value>
The stream options requests carry now (an operation’s streamOptions in the session journal).
Sourcepub fn with_router(router: Arc<Router>, transport: Arc<dyn Transport>) -> Self
pub fn with_router(router: Arc<Router>, transport: Arc<dyn Transport>) -> Self
Provider::with_transport whose Claude subscription calls go through router.
pub fn with_key(api_key: Option<String>) -> Self
Sourcepub fn with_idle_timeout(idle: Option<Duration>) -> Self
pub fn with_idle_timeout(idle: Option<Duration>) -> Self
A provider whose requests fail when headers or the stream stall for idle (httpIdleTimeoutMs).