pub struct Ai { /* private fields */ }Expand description
Plugin builder — install with app.install(Ai::…).
Implementations§
Source§impl Ai
impl Ai
pub fn new() -> Self
Sourcepub fn model<M: LanguageModel>(self, model: M) -> Self
pub fn model<M: LanguageModel>(self, model: M) -> Self
Default language model (OpenAI, Anthropic, FakeAi, …).
Sourcepub fn fake(fake: FakeAi) -> Self
pub fn fake(fake: FakeAi) -> Self
Install a recording fake (tests). Same as .model(fake) plus client.fake().
Sourcepub fn system(self, system: impl Into<String>) -> Self
pub fn system(self, system: impl Into<String>) -> Self
Default system prompt prepended when a bound call does not set .system().
pub fn into_client(self) -> Result<AiClient, AiError>
Trait Implementations§
Source§impl Plugin for Ai
impl Plugin for Ai
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable plugin identifier used for dependency checks and
crate::App::has_plugin. Read moreSource§fn meta(&self) -> PluginMeta
fn meta(&self) -> PluginMeta
Display name, description, and declared
PluginMeta::sdk version.Auto Trait Implementations§
impl !RefUnwindSafe for Ai
impl !UnwindSafe for Ai
impl Freeze for Ai
impl Send for Ai
impl Sync for Ai
impl Unpin for Ai
impl UnsafeUnpin for Ai
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