pub struct CliProvider {
pub config: CliProviderConfig,
}Expand description
A CLI-based AI provider that spawns external tools.
Fields§
§config: CliProviderConfigImplementations§
Source§impl CliProvider
impl CliProvider
Sourcepub fn new(config: CliProviderConfig) -> Self
pub fn new(config: CliProviderConfig) -> Self
Create a new CLI provider from config.
Sourcepub fn from_parts(name: &str, binary: &str, args: Vec<&str>) -> Self
pub fn from_parts(name: &str, binary: &str, args: Vec<&str>) -> Self
Create from individual fields.
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if the binary exists and is accessible.
Sourcepub async fn call(&self, prompt: &str) -> Result<String>
pub async fn call(&self, prompt: &str) -> Result<String>
Call the CLI tool with a prompt and return the response.
Sourcepub fn detect_all() -> Vec<CliProvider>
pub fn detect_all() -> Vec<CliProvider>
Detect all known CLI tools on the system.
Trait Implementations§
Source§impl Clone for CliProvider
impl Clone for CliProvider
Source§fn clone(&self) -> CliProvider
fn clone(&self) -> CliProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CliProvider
impl RefUnwindSafe for CliProvider
impl Send for CliProvider
impl Sync for CliProvider
impl Unpin for CliProvider
impl UnsafeUnpin for CliProvider
impl UnwindSafe for CliProvider
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