(session_id: impl Into<String>)
| 105 | } |
| 106 | |
| 107 | pub fn assistant(session_id: impl Into<String>) -> Self { |
| 108 | Self { |
| 109 | id: format!("msg_{}", uuid::Uuid::new_v4()), |
| 110 | session_id: session_id.into(), |
| 111 | role: MessageRole::Assistant, |
| 112 | parts: Vec::new(), |
| 113 | created_at: Utc::now(), |
| 114 | metadata: HashMap::new(), |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | pub fn get_text(&self) -> String { |
| 119 | self.parts |