pub struct GeminiMessage {
pub id: String,
pub timestamp: String,
pub role: GeminiRole,
pub content: GeminiContent,
pub thoughts: Option<Vec<Thought>>,
pub tokens: Option<Tokens>,
pub model: Option<String>,
pub tool_calls: Option<Vec<ToolCall>>,
pub extra: HashMap<String, Value>,
}Expand description
A single message within a chat file.
Fields§
§id: String§timestamp: String§role: GeminiRole"user" or "gemini".
content: GeminiContent§thoughts: Option<Vec<Thought>>None = field absent in source. Some(vec![]) = explicit empty array.
tokens: Option<Tokens>§model: Option<String>§tool_calls: Option<Vec<ToolCall>>None = field absent in source. Some(vec![]) = explicit empty array.
extra: HashMap<String, Value>Implementations§
Source§impl GeminiMessage
impl GeminiMessage
Sourcepub fn thoughts(&self) -> &[Thought]
pub fn thoughts(&self) -> &[Thought]
Borrow the thoughts list as a slice, regardless of whether the source had the field absent or present-but-empty.
Sourcepub fn tool_calls(&self) -> &[ToolCall]
pub fn tool_calls(&self) -> &[ToolCall]
Borrow the tool-calls list as a slice, regardless of whether the source had the field absent or present-but-empty.
Trait Implementations§
Source§impl Clone for GeminiMessage
impl Clone for GeminiMessage
Source§fn clone(&self) -> GeminiMessage
fn clone(&self) -> GeminiMessage
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 GeminiMessage
impl Debug for GeminiMessage
Source§impl<'de> Deserialize<'de> for GeminiMessage
impl<'de> Deserialize<'de> for GeminiMessage
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 GeminiMessage
impl RefUnwindSafe for GeminiMessage
impl Send for GeminiMessage
impl Sync for GeminiMessage
impl Unpin for GeminiMessage
impl UnsafeUnpin for GeminiMessage
impl UnwindSafe for GeminiMessage
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