pub struct RpcTransportClient { /* private fields */ }Expand description
Subprocess-backed SDK transport for pi --mode rpc.
Implementations§
Source§impl RpcTransportClient
impl RpcTransportClient
pub fn connect(options: RpcTransportOptions) -> Result<Self>
pub async fn request( &mut self, command: &str, payload: Map<String, Value>, ) -> Result<Value>
pub async fn steer(&mut self, message: impl Into<String>) -> Result<()>
pub async fn follow_up(&mut self, message: impl Into<String>) -> Result<()>
pub async fn abort(&mut self) -> Result<()>
pub async fn new_session( &mut self, parent_session: Option<&Path>, ) -> Result<RpcCancelledResult>
pub async fn get_state(&mut self) -> Result<RpcSessionState>
pub async fn get_session_stats(&mut self) -> Result<RpcSessionStats>
pub async fn get_messages(&mut self) -> Result<Vec<Value>>
pub async fn get_available_models(&mut self) -> Result<Vec<RpcModelInfo>>
pub async fn set_model( &mut self, provider: &str, model_id: &str, ) -> Result<RpcModelInfo>
pub async fn cycle_model(&mut self) -> Result<Option<RpcCycleModelResult>>
pub async fn set_thinking_level(&mut self, level: ThinkingLevel) -> Result<()>
pub async fn cycle_thinking_level( &mut self, ) -> Result<Option<RpcThinkingLevelResult>>
pub async fn set_steering_mode(&mut self, mode: &str) -> Result<()>
pub async fn set_follow_up_mode(&mut self, mode: &str) -> Result<()>
pub async fn set_auto_compaction(&mut self, enabled: bool) -> Result<()>
pub async fn set_auto_retry(&mut self, enabled: bool) -> Result<()>
pub async fn abort_retry(&mut self) -> Result<()>
pub async fn set_session_name(&mut self, name: impl Into<String>) -> Result<()>
pub async fn get_last_assistant_text(&mut self) -> Result<Option<String>>
pub async fn export_html( &mut self, output_path: Option<&Path>, ) -> Result<RpcExportHtmlResult>
pub async fn bash( &mut self, command: impl Into<String>, ) -> Result<RpcBashResult>
pub async fn abort_bash(&mut self) -> Result<()>
pub async fn compact(&mut self) -> Result<RpcCompactionResult>
pub async fn compact_with_instructions( &mut self, custom_instructions: Option<&str>, ) -> Result<RpcCompactionResult>
pub async fn switch_session( &mut self, session_path: &Path, ) -> Result<RpcCancelledResult>
pub async fn fork( &mut self, entry_id: impl Into<String>, ) -> Result<RpcForkResult>
pub async fn get_fork_messages(&mut self) -> Result<Vec<RpcForkMessage>>
pub async fn get_commands(&mut self) -> Result<Vec<RpcCommandInfo>>
pub async fn extension_ui_response( &mut self, request_id: &str, response: RpcExtensionUiResponse, ) -> Result<bool>
pub async fn prompt(&mut self, message: impl Into<String>) -> Result<Vec<Value>>
pub async fn prompt_with_options( &mut self, message: impl Into<String>, images: Option<Vec<ImageContent>>, streaming_behavior: Option<&str>, ) -> Result<Vec<Value>>
pub fn shutdown(&mut self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RpcTransportClient
impl RefUnwindSafe for RpcTransportClient
impl Send for RpcTransportClient
impl Sync for RpcTransportClient
impl Unpin for RpcTransportClient
impl UnsafeUnpin for RpcTransportClient
impl UnwindSafe for RpcTransportClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).
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