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.
Trait Implementations§
Source§impl Clone for PromptModel
impl Clone for PromptModel
Source§fn clone(&self) -> PromptModel
fn clone(&self) -> PromptModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key.
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Instruments this type with the provided [
Span], returning an
Instrumented wrapper.§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§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Attaches the provided
Subscriber to this type, returning a
[WithDispatch] wrapper.