Record a human interaction.
(self, node_id: str, input_data: str = None, output: str = None,
duration: float = None, details: Dict[str, Any] = None)
| 206 | ) |
| 207 | |
| 208 | def record_human_interaction(self, node_id: str, input_data: str = None, output: str = None, |
| 209 | duration: float = None, details: Dict[str, Any] = None) -> None: |
| 210 | """Record a human interaction.""" |
| 211 | call_details = { |
| 212 | "input_data": input_data, |
| 213 | "output": output, |
| 214 | **(details or {}) |
| 215 | } |
| 216 | |
| 217 | self.info( |
| 218 | f"Human interaction for node {node_id}", |
| 219 | node_id=node_id, |
| 220 | event_type=EventType.HUMAN_INTERACTION, |
| 221 | details=call_details, |
| 222 | duration=duration |
| 223 | ) |
| 224 | |
| 225 | def record_model_call(self, node_id: str, model_name: str, |
| 226 | input_data: str = None, output: str = None, |