pub struct SystemLanguageModel;Expand description
The on-device default language model provided by the operating system.
FoundationModels exposes a single shared SystemLanguageModel.default;
this type mirrors that singleton and only carries availability queries.
To actually generate text, construct a crate::LanguageModelSession.
§Examples
use foundation_models::SystemLanguageModel;
if SystemLanguageModel::is_available() {
println!("Apple Intelligence model is ready.");
} else {
eprintln!("Unavailable: {:?}", SystemLanguageModel::availability());
}Implementations§
Source§impl SystemLanguageModel
impl SystemLanguageModel
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Convenience: availability() == Availability::Available.
Sourcepub fn availability() -> Availability
pub fn availability() -> Availability
Detailed availability state of the on-device model.
Trait Implementations§
Source§impl Clone for SystemLanguageModel
impl Clone for SystemLanguageModel
Source§fn clone(&self) -> SystemLanguageModel
fn clone(&self) -> SystemLanguageModel
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 SystemLanguageModel
impl Debug for SystemLanguageModel
impl Copy for SystemLanguageModel
Auto Trait Implementations§
impl Freeze for SystemLanguageModel
impl RefUnwindSafe for SystemLanguageModel
impl Send for SystemLanguageModel
impl Sync for SystemLanguageModel
impl Unpin for SystemLanguageModel
impl UnsafeUnpin for SystemLanguageModel
impl UnwindSafe for SystemLanguageModel
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