pub struct AgentCli { /* private fields */ }Expand description
A local CLI adapter. Each run starts a fresh process and returns one result.
Implementations§
Source§impl AgentCli
impl AgentCli
Sourcepub fn discover_with_context(provider: Provider) -> Result<Self, ProviderError>
pub fn discover_with_context(provider: Provider) -> Result<Self, ProviderError>
Discover a CLI while preserving its provider in any error.
Sourcepub fn with_binary_with_context(
provider: Provider,
binary: impl Into<PathBuf>,
) -> Result<Self, ProviderError>
pub fn with_binary_with_context( provider: Provider, binary: impl Into<PathBuf>, ) -> Result<Self, ProviderError>
Use an explicit CLI path while preserving its provider in any error.
pub fn discover(provider: Provider) -> Result<Self, Error>
pub fn with_binary( provider: Provider, binary: impl Into<PathBuf>, ) -> Result<Self, Error>
pub fn provider(&self) -> Provider
Sourcepub fn native_system_prompt(&self) -> bool
pub fn native_system_prompt(&self) -> bool
Whether this CLI supports RunRequest::system_prompt natively; see
Provider::native_system_prompt.
Sourcepub async fn run_with_context(
&self,
request: RunRequest,
) -> Result<RunResult, ProviderError>
pub async fn run_with_context( &self, request: RunRequest, ) -> Result<RunResult, ProviderError>
Run a request while preserving provider, exit code, and stderr in errors.
pub async fn run(&self, request: RunRequest) -> Result<RunResult, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentCli
impl RefUnwindSafe for AgentCli
impl Send for AgentCli
impl Sync for AgentCli
impl Unpin for AgentCli
impl UnsafeUnpin for AgentCli
impl UnwindSafe for AgentCli
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