pub enum PiMessage {
User {
content: Value,
timestamp: f64,
attachments: Vec<Value>,
extra: Map<String, Value>,
},
Assistant {
content: Vec<ContentBlock>,
api: String,
provider: String,
model: String,
usage: Option<Usage>,
stop_reason: String,
timestamp: f64,
extra: Map<String, Value>,
},
ToolResult {
tool_call_id: String,
tool_name: String,
content: Value,
usage: Option<Usage>,
is_error: bool,
timestamp: f64,
extra: Map<String, Value>,
},
BashExecution {
command: String,
output: String,
exit_code: Option<i64>,
cancelled: bool,
truncated: bool,
full_output_path: Option<String>,
timestamp: f64,
extra: Map<String, Value>,
},
}Expand description
A conversation message, discriminated on role. This is pi’s
AgentMessage union plus the RPC-only bashExecution role.
Variants§
User
Fields
Assistant
Fields
§
content: Vec<ContentBlock>ToolResult
Fields
BashExecution
Created by the RPC bash command, never by LLM tool calls. On the
next prompt it is rewritten into a user message for the model.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PiMessage
impl<'de> Deserialize<'de> for PiMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for PiMessage
Auto Trait Implementations§
impl Freeze for PiMessage
impl RefUnwindSafe for PiMessage
impl Send for PiMessage
impl Sync for PiMessage
impl Unpin for PiMessage
impl UnsafeUnpin for PiMessage
impl UnwindSafe for PiMessage
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