(mut self, callback: F)
| 426 | } |
| 427 | |
| 428 | pub fn with_create_subsession<F, Fut>(mut self, callback: F) -> Self |
| 429 | where |
| 430 | F: Fn(String, Option<String>, Option<String>, Vec<String>) -> Fut + Send + Sync + 'static, |
| 431 | Fut: std::future::Future<Output = Result<String, ToolError>> + Send + 'static, |
| 432 | { |
| 433 | self.create_subsession = Some(Arc::new(move |agent, title, model, disabled_tools| { |
| 434 | Box::pin(callback(agent, title, model, disabled_tools)) |
| 435 | })); |
| 436 | self |
| 437 | } |
| 438 | |
| 439 | pub async fn do_create_subsession( |
| 440 | &self, |
no test coverage detected