pub struct ProviderBuildContext { /* private fields */ }Expand description
Bounded inputs for constructing a single provider instance.
§Secret scoping
At most one provider-scoped API key may be present. Factories must not
receive a bag of every vendor credential. Callers (engine / CLI) select the
key for the factory being built before invoking [TranscriptionProviderFactory::build]
/ [SynthesisProviderFactory::build].
Implementations§
Source§impl ProviderBuildContext
impl ProviderBuildContext
Sourcepub fn new(cache_dir: impl Into<PathBuf>) -> Self
pub fn new(cache_dir: impl Into<PathBuf>) -> Self
Minimal context: cache root only (process-global pools used by factories if needed).
pub fn with_local_only(self, local_only: bool) -> Self
Sourcepub fn with_api_key(self, key: Option<SecretString>) -> Self
pub fn with_api_key(self, key: Option<SecretString>) -> Self
Attach a single provider-scoped secret (already selected by the caller).
pub fn with_base_url(self, base_url: Option<String>) -> Self
pub fn with_allow_custom_endpoint(self, allow: bool) -> Self
pub fn with_use_system_proxy(self, use_proxy: bool) -> Self
pub fn with_show_progress(self, show: bool) -> Self
pub fn with_stt_mode(self, mode: OpenRouterSttMode) -> Self
pub fn with_tts_max_chars(self, n: Option<usize>) -> Self
pub fn with_stt_pool(self, pool: Arc<SttContextPool>) -> Self
pub fn with_governor(self, gov: Arc<ResourceGovernor>) -> Self
pub fn with_metrics(self, metrics: Arc<Metrics>) -> Self
pub fn with_tts_pool(self, pool: Arc<TtsSessionPool>) -> Self
pub fn cache_dir(&self) -> &Path
pub fn local_only(&self) -> bool
pub fn base_url(&self) -> Option<&str>
pub fn allow_custom_endpoint(&self) -> bool
pub fn use_system_proxy(&self) -> bool
pub fn show_progress(&self) -> bool
pub fn stt_mode(&self) -> OpenRouterSttMode
pub fn tts_max_chars(&self) -> Option<usize>
pub fn stt_pool(&self) -> Option<&Arc<SttContextPool>>
pub fn governor(&self) -> Option<&Arc<ResourceGovernor>>
pub fn metrics(&self) -> Option<&Arc<Metrics>>
pub fn tts_pool(&self) -> Option<&Arc<TtsSessionPool>>
Sourcepub fn api_key(&self) -> Option<&SecretString>
pub fn api_key(&self) -> Option<&SecretString>
Borrow the scoped API key for provider construction (JOE-1980).
Returns SecretString — not a plaintext String. Providers must retain
the redacting type until the final Authorization/xi-api-key header build.
Sourcepub fn api_key_cloned(&self) -> Option<SecretString>
pub fn api_key_cloned(&self) -> Option<SecretString>
Clone the scoped secret (still redacting) for factory ownership transfer.
Sourcepub fn has_api_key(&self) -> bool
pub fn has_api_key(&self) -> bool
Whether a scoped key is present (without revealing it).
Sourcepub fn api_key_exposed(&self) -> Option<SecretString>
👎Deprecated: use api_key_cloned() — does not return plaintext
pub fn api_key_exposed(&self) -> Option<SecretString>
use api_key_cloned() — does not return plaintext
Deprecated alias: prefer Self::api_key_cloned.
Trait Implementations§
Source§impl Clone for ProviderBuildContext
impl Clone for ProviderBuildContext
Source§fn clone(&self) -> ProviderBuildContext
fn clone(&self) -> ProviderBuildContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProviderBuildContext
impl RefUnwindSafe for ProviderBuildContext
impl Send for ProviderBuildContext
impl Sync for ProviderBuildContext
impl Unpin for ProviderBuildContext
impl UnsafeUnpin for ProviderBuildContext
impl UnwindSafe for ProviderBuildContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more