Skip to main content

RpcTransportClient

Struct RpcTransportClient 

Source
pub struct RpcTransportClient { /* private fields */ }
Expand description

Subprocess-backed SDK transport for pi --mode rpc.

Implementations§

Source§

impl RpcTransportClient

Source

pub fn connect(options: RpcTransportOptions) -> Result<Self>

Source

pub async fn request( &mut self, command: &str, payload: Map<String, Value>, ) -> Result<Value>

Source

pub async fn steer(&mut self, message: impl Into<String>) -> Result<()>

Source

pub async fn follow_up(&mut self, message: impl Into<String>) -> Result<()>

Source

pub async fn abort(&mut self) -> Result<()>

Source

pub async fn new_session( &mut self, parent_session: Option<&Path>, ) -> Result<RpcCancelledResult>

Source

pub async fn get_state(&mut self) -> Result<RpcSessionState>

Source

pub async fn get_session_stats(&mut self) -> Result<RpcSessionStats>

Source

pub async fn get_messages(&mut self) -> Result<Vec<Value>>

Source

pub async fn get_available_models(&mut self) -> Result<Vec<RpcModelInfo>>

Source

pub async fn set_model( &mut self, provider: &str, model_id: &str, ) -> Result<RpcModelInfo>

Source

pub async fn cycle_model(&mut self) -> Result<Option<RpcCycleModelResult>>

Source

pub async fn set_thinking_level(&mut self, level: ThinkingLevel) -> Result<()>

Source

pub async fn cycle_thinking_level( &mut self, ) -> Result<Option<RpcThinkingLevelResult>>

Source

pub async fn set_steering_mode(&mut self, mode: &str) -> Result<()>

Source

pub async fn set_follow_up_mode(&mut self, mode: &str) -> Result<()>

Source

pub async fn set_auto_compaction(&mut self, enabled: bool) -> Result<()>

Source

pub async fn set_auto_retry(&mut self, enabled: bool) -> Result<()>

Source

pub async fn abort_retry(&mut self) -> Result<()>

Source

pub async fn set_session_name(&mut self, name: impl Into<String>) -> Result<()>

Source

pub async fn get_last_assistant_text(&mut self) -> Result<Option<String>>

Source

pub async fn export_html( &mut self, output_path: Option<&Path>, ) -> Result<RpcExportHtmlResult>

Source

pub async fn bash( &mut self, command: impl Into<String>, ) -> Result<RpcBashResult>

Source

pub async fn abort_bash(&mut self) -> Result<()>

Source

pub async fn compact(&mut self) -> Result<RpcCompactionResult>

Source

pub async fn compact_with_instructions( &mut self, custom_instructions: Option<&str>, ) -> Result<RpcCompactionResult>

Source

pub async fn switch_session( &mut self, session_path: &Path, ) -> Result<RpcCancelledResult>

Source

pub async fn fork( &mut self, entry_id: impl Into<String>, ) -> Result<RpcForkResult>

Source

pub async fn get_fork_messages(&mut self) -> Result<Vec<RpcForkMessage>>

Source

pub async fn get_commands(&mut self) -> Result<Vec<RpcCommandInfo>>

Source

pub async fn extension_ui_response( &mut self, request_id: &str, response: RpcExtensionUiResponse, ) -> Result<bool>

Source

pub async fn prompt(&mut self, message: impl Into<String>) -> Result<Vec<Value>>

Source

pub async fn prompt_with_options( &mut self, message: impl Into<String>, images: Option<Vec<ImageContent>>, streaming_behavior: Option<&str>, ) -> Result<Vec<Value>>

Source

pub fn shutdown(&mut self) -> Result<()>

Trait Implementations§

Source§

impl Drop for RpcTransportClient

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ParallelSend for T

Source§

impl<T> Send for T
where T: ?Sized,

Source§

impl<T> Sync for T
where T: ?Sized,