pub enum SDKMessage {
User(SDKUserMessage),
Assistant(SDKAssistantMessage),
System(SDKSystemMessage),
Result(SDKResultMessage),
PartialAssistant(SDKPartialAssistantMessage),
}Expand description
Enum wrapping all message types
Variants§
User(SDKUserMessage)
Assistant(SDKAssistantMessage)
System(SDKSystemMessage)
Result(SDKResultMessage)
PartialAssistant(SDKPartialAssistantMessage)
Implementations§
Source§impl SDKMessage
impl SDKMessage
pub fn session_id(&self) -> &str
pub fn message_type(&self) -> MessageType
Source§impl SDKMessage
impl SDKMessage
pub fn is_user_message(&self) -> bool
pub fn is_assistant_message(&self) -> bool
pub fn is_system_message(&self) -> bool
pub fn is_result_message(&self) -> bool
pub fn is_partial_assistant_message(&self) -> bool
Sourcepub fn from_assistant_text(content: &str) -> Self
pub fn from_assistant_text(content: &str) -> Self
Create an assistant message from text
Sourcepub fn from_result_value(result: Value) -> Self
pub fn from_result_value(result: Value) -> Self
Create a result message from JSON value
Trait Implementations§
Source§impl Clone for SDKMessage
impl Clone for SDKMessage
Source§fn clone(&self) -> SDKMessage
fn clone(&self) -> SDKMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SDKMessage
impl Debug for SDKMessage
Source§impl<'de> Deserialize<'de> for SDKMessage
impl<'de> Deserialize<'de> for SDKMessage
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 SDKMessage
impl RefUnwindSafe for SDKMessage
impl Send for SDKMessage
impl Sync for SDKMessage
impl Unpin for SDKMessage
impl UnsafeUnpin for SDKMessage
impl UnwindSafe for SDKMessage
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