pub enum Message {
User {
content: String,
},
Assistant {
content: String,
},
ToolCall {
id: String,
name: String,
status: String,
},
Plan {
entries: Vec<PlanEntry>,
},
TaskFinish {
reason: Option<String>,
},
Error {
code: i32,
message: String,
details: Option<HashMap<String, Value>>,
},
}Expand description
Message types for communication with iFlow
These are the various message types that can be exchanged with iFlow during a session.
Variants§
User
User message
Assistant
Assistant message
ToolCall
Tool call message
Plan
Plan message
TaskFinish
Task finish message
Error
Error message
Implementations§
Source§impl Message
impl Message
Sourcepub fn is_task_finish(&self) -> bool
pub fn is_task_finish(&self) -> bool
Check if this is a task finish message
Sourcepub fn get_text(&self) -> Option<&str>
pub fn get_text(&self) -> Option<&str>
Get the text content of the message if it has any
§Returns
Some(&str) containing the text content if the message has text content,
None otherwise
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
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
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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