ok conditional logic good

This commit is contained in:
dal 2025-02-21 16:20:19 -07:00
parent 242f648d85
commit e1c4c6ba41
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
4 changed files with 15 additions and 13 deletions

View File

@ -1,7 +1,8 @@
use anyhow::Result;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use std::sync::Arc;
use tokio::sync::mpsc::Receiver;
use uuid::Uuid;
@ -156,18 +157,6 @@ impl ManagerAgent {
let mut rx = self.stream_process_thread(thread).await?;
while let Some(message) = rx.recv().await {
let message = message?;
if let AgentMessage::Tool {
id,
content,
tool_call_id,
name,
progress,
} = message
{}
}
Ok(rx)
}
}

View File

@ -78,6 +78,11 @@ impl ToolExecutor for DashboardAgentTool {
println!("DashboardAgentTool: Dashboard agent run completed");
println!("DashboardAgentTool: Preparing success response");
self.agent
.set_state_value(String::from("files_created"), Value::Bool(false))
.await;
// Return success with the output
Ok(serde_json::json!({
"status": "success",

View File

@ -60,6 +60,10 @@ impl ToolExecutor for MetricAgentTool {
// Run the metric agent and get the receiver
let _rx = metric_agent.run(&mut current_thread).await?;
self.agent
.set_state_value(String::from("files_created"), Value::Bool(false))
.await;
// Return immediately with status
Ok(serde_json::json!({
"status": "running",

View File

@ -254,6 +254,10 @@ impl ToolExecutor for SearchDataCatalogTool {
format!("Found {} relevant datasets", search_results.len())
};
self.agent
.set_state_value(String::from("data_context"), Value::Bool(true))
.await;
let duration = start_time.elapsed().as_millis();
Ok(SearchDataCatalogOutput {