pub struct PiProjector {
pub cwd: Option<String>,
pub default_api: Option<String>,
pub default_provider: Option<String>,
}Expand description
Project a ConversationView into a Pi PiSession.
Config fields are optional. cwd overrides the source view’s
working directory (which is otherwise pulled from
Turn.environment.working_dir). Default API metadata fills in
api/provider for assistant turns coming from a non-Pi source.
§Example
use toolpath_convo::{ConversationProjector, ConversationView};
use toolpath_pi::project::PiProjector;
let view = ConversationView {
id: "session-uuid".into(),
provider_id: Some("pi".into()),
..Default::default()
};
let session = PiProjector::default().project(&view).unwrap();
assert_eq!(session.header.id, "session-uuid");Fields§
§cwd: Option<String>Override the session header’s cwd. When None, the projector
pulls it from the first turn’s environment (or falls back to
"/" if absent).
default_api: Option<String>Default api field for assistant turns when not present in
Turn.extra["pi"]["api"]. Defaults to "anthropic".
default_provider: Option<String>Default provider field for assistant turns when not present
in Turn.extra["pi"]["api"]. Defaults to "anthropic".
Implementations§
Trait Implementations§
Source§impl Clone for PiProjector
impl Clone for PiProjector
Source§fn clone(&self) -> PiProjector
fn clone(&self) -> PiProjector
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConversationProjector for PiProjector
impl ConversationProjector for PiProjector
Source§impl Debug for PiProjector
impl Debug for PiProjector
Source§impl Default for PiProjector
impl Default for PiProjector
Source§fn default() -> PiProjector
fn default() -> PiProjector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PiProjector
impl RefUnwindSafe for PiProjector
impl Send for PiProjector
impl Sync for PiProjector
impl Unpin for PiProjector
impl UnsafeUnpin for PiProjector
impl UnwindSafe for PiProjector
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