Skip to main content

AgentBackend

Trait AgentBackend 

Source
pub trait AgentBackend: Send + Sync {
    // Required methods
    fn setup(&self, folder: &Path) -> Result<(), AgentBackendError>;
    fn build_command<'request>(
        &'request self,
        request: BuildCommandRequest<'request>,
    ) -> Result<Command, AgentBackendError>;
}
Expand description

Builds and configures external agent CLI commands.

Required Methods§

Source

fn setup(&self, folder: &Path) -> Result<(), AgentBackendError>

Performs one-time setup in an agent folder before first run.

§Errors

Returns an error when one-time backend setup cannot be completed.

Source

fn build_command<'request>( &'request self, request: BuildCommandRequest<'request>, ) -> Result<Command, AgentBackendError>

Builds one provider transport command.

CLI-backed providers return the per-turn subprocess command. App-server providers return the long-lived runtime command that owns later RPC turn execution.

§Errors

Returns an error when prompt rendering or provider argument construction fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§