async fn execute_harvest_conversation(&self, arguments: Value) -> Result<Value> {
let result = self.harvester_service.force_harvest().await?;
Ok(json!({"content": format!("Harvested: {}", result)}))
}
async fn execute_harvest_conversation(&self, arguments: Value) -> Result<Value> {
let harvest_id = Uuid::new_v4();
let harvester = self.harvester_service.clone();
tokio::spawn(async move {
harvester.force_harvest().await;
});
Ok(json!({
"content": [{
"type": "text",
"text": format!("Harvest started (ID: {})\nUse get_harvest_status to check progress", harvest_id)
}]
}))
}
async fn execute_get_harvest_status(&self, harvest_id: String) -> Result<Value> {
let status = self.get_harvest_progress(harvest_id).await?;
Ok(json!({
"content": [{
"type": "text",
"text": format!("Progress: {}%\nPatterns found: {}",
status.progress, status.patterns_found)
}]
}))
}