pub struct ProviderSummary {
pub name: String,
pub provider_type: String,
pub model: Option<String>,
pub base_url: Option<String>,
pub max_tokens: Option<u32>,
pub embedding_model: Option<String>,
pub stt_model: Option<String>,
pub default: bool,
pub active: bool,
}Expand description
Read-only, secret-free summary of a single [[llm.providers]] entry for the TUI
settings view (issue #6024).
Built by explicit whitelist-copying of safe fields from ProviderEntry — never
by cloning the entry and redacting afterward — so a future secret field added to
ProviderEntry cannot silently leak through this struct (NFR-002/FR-010 of
/specs/061-tui-settings-editor-parity/spec.md). Secret-bearing fields
(api_key, cocoon_access_hash, candle.hf_token) are intentionally absent.
Fields§
§name: StringEffective provider name (ProviderEntry::effective_name).
provider_type: StringProvider backend type as a lowercase string (e.g. "claude", "openai").
model: Option<String>Configured model identifier, if any.
base_url: Option<String>API base URL with any embedded userinfo credentials redacted.
max_tokens: Option<u32>Configured max output tokens, if any.
embedding_model: Option<String>Configured embedding model, if any.
stt_model: Option<String>Configured STT model, if any.
default: boolWhether this entry is the configured default chat provider.
active: boolWhether this entry is the currently active provider for the running agent.
Implementations§
Source§impl ProviderSummary
impl ProviderSummary
Sourcepub fn build_pool(
pool: &[ProviderEntry],
active_provider_name: &str,
) -> Arc<[Self]>
pub fn build_pool( pool: &[ProviderEntry], active_provider_name: &str, ) -> Arc<[Self]>
Build the whitelist-copied, secret-free summary list for the settings view.
Explicitly copies only the safe field whitelist from each ProviderEntry rather
than cloning the entry and redacting it afterward, so a future secret field added
to ProviderEntry cannot silently leak through this struct — see the type-level
doc for the full rationale. base_url has any embedded userinfo credentials
(https://user:pass@host) stripped via zeph_db::redact_url.
active_provider_name should already be resolved to the effective active name
(callers typically fall back to the running provider’s own name when the config’s
active_provider_name field is empty, mirroring provider_cmd.rs’s own pattern).
§Examples
use zeph_config::ProviderEntry;
use zeph_core::metrics::ProviderSummary;
let entry = ProviderEntry {
name: Some("fast".to_owned()),
model: Some("gpt-4o-mini".to_owned()),
default: true,
api_key: Some("sk-should-never-appear".to_owned()),
..ProviderEntry::default()
};
let summaries = ProviderSummary::build_pool(&[entry], "fast");
assert_eq!(summaries[0].name, "fast");
assert!(summaries[0].active);Trait Implementations§
Source§impl Clone for ProviderSummary
impl Clone for ProviderSummary
Source§fn clone(&self) -> ProviderSummary
fn clone(&self) -> ProviderSummary
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderSummary
impl Debug for ProviderSummary
Source§impl Default for ProviderSummary
impl Default for ProviderSummary
Source§fn default() -> ProviderSummary
fn default() -> ProviderSummary
Auto Trait Implementations§
impl Freeze for ProviderSummary
impl RefUnwindSafe for ProviderSummary
impl Send for ProviderSummary
impl Sync for ProviderSummary
impl Unpin for ProviderSummary
impl UnsafeUnpin for ProviderSummary
impl UnwindSafe for ProviderSummary
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request