(session_id: impl Into<String>)
| 124 | } |
| 125 | |
| 126 | pub fn assistant(session_id: impl Into<String>) -> Self { |
| 127 | Self { |
| 128 | id: format!("msg_{}", uuid::Uuid::new_v4()), |
| 129 | session_id: session_id.into(), |
| 130 | role: MessageRole::Assistant, |
| 131 | parts: Vec::new(), |
| 132 | created_at: Utc::now(), |
| 133 | metadata: HashMap::new(), |
| 134 | usage: None, |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | pub fn add_text(&mut self, text: impl Into<String>) { |
| 139 | self.parts.push(MessagePart { |