(mut self, callback: F)
| 637 | } |
| 638 | |
| 639 | pub fn with_create_synthetic_message<F, Fut>(mut self, callback: F) -> Self |
| 640 | where |
| 641 | F: Fn(String, Option<String>, String) -> Fut + Send + Sync + 'static, |
| 642 | Fut: std::future::Future<Output = Result<(), ToolError>> + Send + 'static, |
| 643 | { |
| 644 | self.create_synthetic_message = Some(Arc::new(move |session_id, agent, text| { |
| 645 | Box::pin(callback(session_id, agent, text)) |
| 646 | })); |
| 647 | self |
| 648 | } |
| 649 | |
| 650 | pub async fn do_create_synthetic_message( |
| 651 | &self, |