pub struct PromptModel { /* private fields */ }Expand description
A selectable model offered by a PromptBar.
Beyond its stable ID and label a model may carry a provider (options are grouped by it), a one-line description, and its context window, so the picker reads like a catalog rather than a bare list.
Implementations§
Source§impl PromptModel
impl PromptModel
Sourcepub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
pub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
Creates an enabled model with stable identity and a visible label.
Sourcepub fn provider(self, provider: impl Into<SharedString>) -> Self
pub fn provider(self, provider: impl Into<SharedString>) -> Self
Sets the provider the model is grouped under (for example “Anthropic”).
Sourcepub fn description(self, description: impl Into<SharedString>) -> Self
pub fn description(self, description: impl Into<SharedString>) -> Self
Adds a one-line description shown under the label.
Sourcepub fn context_window(self, tokens: u64) -> Self
pub fn context_window(self, tokens: u64) -> Self
Records the context window in tokens, shown compactly (200K).
Sourcepub fn provider_name(&self) -> Option<&SharedString>
pub fn provider_name(&self) -> Option<&SharedString>
Returns the provider name, when set.
Sourcepub fn description_text(&self) -> Option<&SharedString>
pub fn description_text(&self) -> Option<&SharedString>
Returns the description, when set.
Sourcepub fn context_window_tokens(&self) -> Option<u64>
pub fn context_window_tokens(&self) -> Option<u64>
Returns the context window in tokens, when set.
Sourcepub fn id(&self) -> &SharedString
pub fn id(&self) -> &SharedString
Returns the stable model identifier.
Sourcepub fn label(&self) -> &SharedString
pub fn label(&self) -> &SharedString
Returns the visible model label.
Trait Implementations§
Source§impl Clone for PromptModel
impl Clone for PromptModel
Source§impl Debug for PromptModel
impl Debug for PromptModel
impl Eq for PromptModel
Source§impl PartialEq for PromptModel
impl PartialEq for PromptModel
impl StructuralPartialEq for PromptModel
Auto Trait Implementations§
impl Freeze for PromptModel
impl RefUnwindSafe for PromptModel
impl Send for PromptModel
impl Sync for PromptModel
impl Unpin for PromptModel
impl UnsafeUnpin for PromptModel
impl UnwindSafe for PromptModel
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
Mutably borrows from an owned value. Read more
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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