pub struct SimpleStreamOptionsPatch {
pub timeout: Option<Option<Duration>>,
pub max_retries: Option<Option<u32>>,
pub max_retry_delay: Option<Option<Duration>>,
pub headers: Option<BTreeMap<String, Option<String>>>,
pub metadata: Option<BTreeMap<String, Option<String>>>,
pub cache_retention: Option<Option<CacheRetention>>,
pub max_tokens: Option<Option<u64>>,
pub temperature: Option<Option<f64>>,
pub session_id: Option<Option<String>>,
}Expand description
A patch against SimpleStreamOptions returned by ProviderHooks::before_request.
Mirrors TS beforeRequest’s per-request overrides but targets the live
SimpleStreamOptions (the type stream_simple receives), not the harness
pinned subset. Option<Option<T>> semantics: outer None = “leave this
field”; inner Some(None) on the headers/metadata maps = “delete this key”.
This is distinct from the harness-side AgentHarnessStreamOptionsPatch
(which lives in rpi-harness and patches AgentHarnessStreamOptions). Both
exist; this one is the rpi-ai seam so provider hooks can be defined without
a rpi-harness cycle.
Fields§
§timeout: Option<Option<Duration>>§max_retries: Option<Option<u32>>§max_retry_delay: Option<Option<Duration>>§headers: Option<BTreeMap<String, Option<String>>>None = leave; Some(map) = merge, inner None deletes a key.
metadata: Option<BTreeMap<String, Option<String>>>None = leave; Some(map) = merge, inner None deletes a key.
cache_retention: Option<Option<CacheRetention>>§max_tokens: Option<Option<u64>>§temperature: Option<Option<f64>>§session_id: Option<Option<String>>Implementations§
Source§impl SimpleStreamOptionsPatch
impl SimpleStreamOptionsPatch
Sourcepub fn apply(&self, opts: &mut SimpleStreamOptions)
pub fn apply(&self, opts: &mut SimpleStreamOptions)
Apply this patch to opts in place. Mirrors the harness patch semantics:
outer None = leave the field; an explicit value replaces it; None
inside a map entry deletes that key.