pub trait BaseMessage: Send + Sync {
// Required methods
fn content(&self) -> &MessageContent;
fn message_type(&self) -> &str;
fn additional_kwargs(&self) -> &HashMap<String, Value>;
fn response_metadata(&self) -> &HashMap<String, Value>;
fn name(&self) -> Option<&str>;
fn id(&self) -> Option<&str>;
// Provided methods
fn text(&self) -> String { ... }
fn is_human(&self) -> bool { ... }
fn is_ai(&self) -> bool { ... }
fn is_system(&self) -> bool { ... }
fn is_tool(&self) -> bool { ... }
}
Expand description
Base message trait that all message types implement
Required Methods§
Sourcefn content(&self) -> &MessageContent
fn content(&self) -> &MessageContent
Get the content of the message
Sourcefn message_type(&self) -> &str
fn message_type(&self) -> &str
Get the message type
Sourcefn additional_kwargs(&self) -> &HashMap<String, Value>
fn additional_kwargs(&self) -> &HashMap<String, Value>
Get additional kwargs
Sourcefn response_metadata(&self) -> &HashMap<String, Value>
fn response_metadata(&self) -> &HashMap<String, Value>
Get response metadata