pub struct RpcRunner { /* private fields */ }Expand description
RPC runner that owns the harness and processes commands.
Implementations§
Source§impl RpcRunner
impl RpcRunner
Sourcepub fn new(
provider: Box<dyn Provider>,
model: String,
config: OpiConfig,
workspace_root: PathBuf,
allow_mutating: bool,
tool_selection: ToolSelection,
user_system_prompt: Option<String>,
initial_messages: Vec<AgentMessage>,
) -> Result<Self, ToolPolicyError>
pub fn new( provider: Box<dyn Provider>, model: String, config: OpiConfig, workspace_root: PathBuf, allow_mutating: bool, tool_selection: ToolSelection, user_system_prompt: Option<String>, initial_messages: Vec<AgentMessage>, ) -> Result<Self, ToolPolicyError>
Create a new RPC runner.
Sourcepub fn system_prompt(&self) -> Option<&str>
pub fn system_prompt(&self) -> Option<&str>
Return the assembled system prompt while the runner is idle.
Sourcepub async fn run(&mut self) -> i32
pub async fn run(&mut self) -> i32
Run the RPC main loop over stdin/stdout. Returns an exit code.
Sourcepub async fn run_with_channels(
&mut self,
command_rx: UnboundedReceiver<SdkCommand>,
output_tx: UnboundedSender<Value>,
) -> i32
pub async fn run_with_channels( &mut self, command_rx: UnboundedReceiver<SdkCommand>, output_tx: UnboundedSender<Value>, ) -> i32
Run the RPC main loop with in-process command and output channels.
This is intended for tests and SDK-style embedders that already have
structured commands. Stdin parsing is covered by run.
Auto Trait Implementations§
impl !RefUnwindSafe for RpcRunner
impl !UnwindSafe for RpcRunner
impl Freeze for RpcRunner
impl Send for RpcRunner
impl Sync for RpcRunner
impl Unpin for RpcRunner
impl UnsafeUnpin for RpcRunner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more