Parse the common base fields and build a TurnEvent with the session ID and transcript path populated.
(
&self,
hook_type: HookType,
conversation_id: Option<String>,
transcript_path: Option<String>,
)
| 201 | /// Parse the common base fields and build a TurnEvent with the session |
| 202 | /// ID and transcript path populated. |
| 203 | fn base_event( |
| 204 | &self, |
| 205 | hook_type: HookType, |
| 206 | conversation_id: Option<String>, |
| 207 | transcript_path: Option<String>, |
| 208 | ) -> TurnEvent { |
| 209 | let session_id = conversation_id |
| 210 | .filter(|s| !s.is_empty()) |
| 211 | .unwrap_or_else(|| "unknown".to_string()); |
| 212 | |
| 213 | let mut event = TurnEvent::new(&session_id, hook_type); |
| 214 | if let Some(path) = transcript_path { |
| 215 | event = event.with_transcript_path(path); |
| 216 | } |
| 217 | event |
| 218 | } |
| 219 | } |
| 220 | |
| 221 | // AgentHook Implementation |
no test coverage detected