todos looking good, fixed a few things on analysis

This commit is contained in:
dal 2025-04-16 12:07:47 -06:00
parent f69fbb84b0
commit ad8ff6f28e
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
4 changed files with 43 additions and 19 deletions

View File

@ -86,7 +86,6 @@ pub fn get_configuration(agent_data: &ModeAgentData) -> ModeConfiguration {
.unwrap_or(false);
review_needed || all_todos_complete
});
let always_available = Some(|_state: &HashMap<String, Value>| -> bool { true });
// Add tools to the agent with conditions
agent_clone

View File

@ -304,13 +304,15 @@ impl ToolExecutor for CreateDashboardFilesTool {
let duration = start_time.elapsed().as_millis() as i64;
self.agent
.set_state_value(String::from("dashboards_available"), Value::Bool(true))
.await;
self.agent
.set_state_value(String::from("files_available"), Value::Bool(true))
.await;
if !created_files.is_empty() {
self.agent
.set_state_value(String::from("dashboards_available"), Value::Bool(true))
.await;
self.agent
.set_state_value(String::from("files_available"), Value::Bool(true))
.await;
}
// Set review_needed flag if execution was successful
if failed_files.is_empty() {

View File

@ -235,14 +235,16 @@ impl ToolExecutor for CreateMetricFilesTool {
let duration = start_time.elapsed().as_millis() as i64;
self.agent
.set_state_value(String::from("metrics_available"), Value::Bool(true))
.await;
if !created_files.is_empty() {
self.agent
.set_state_value(String::from("metrics_available"), Value::Bool(true))
.await;
self.agent
.set_state_value(String::from("files_available"), Value::Bool(true))
.await;
}
self.agent
.set_state_value(String::from("files_available"), Value::Bool(true))
.await;
// Set review_needed flag if execution was successful
if failed_files.is_empty() {
self.agent

View File

@ -25,17 +25,38 @@ pub async fn generate_todos_from_plan(
let prompt = format!(
r#"
Given the following plan, extract the actionable steps and return them as a JSON list of descriptive todo strings. Each todo item should clearly describe the task to be performed, providing enough detail to understand its purpose within the overall plan. Avoid overly simple descriptions.
Given the following plan, identify the main high-level objects (e.g., dashboards, visualizations) being created or modified. Return these as a JSON list of descriptive todo strings. Each todo item should summarize the primary creation or modification goal for one object.
**IMPORTANT**: Do not include any steps related to reviewing, verifying, summarizing, or responding to the user. Only include the core creation or modification tasks.
**IMPORTANT**: Do not include granular implementation steps (like adding specific filters or fields), review steps, verification steps, summarization steps, or steps about responding to the user. Focus solely on the final artifact being built or changed.
Plan:
"""
{}
"""
Return ONLY a valid JSON array of strings, where each string is a descriptive todo item corresponding to a main creation/modification step in the plan.
Example format: `["Create a number card visualization titled 'Top Customer by Lifetime Revenue' using specified datasets"]`
Return ONLY a valid JSON array of strings, where each string is a descriptive todo item corresponding to a main object being created or modified in the plan.
Example Plan:
**Thought**
The user wants to see the daily transaction volume trend over the past month.
I'll sum the transaction amounts per day from the `transactions` dataset, filtering for the last 30 days.
I will present this as a line chart.
**Step-by-Step Plan**
1. **Create 1 Visualization**:
- **Title**: "Daily Transaction Volume (Last 30 Days)"
- **Type**: Line Chart
- **Datasets**: transactions
- **X-Axis**: Day (from transaction timestamp)
- **Y-Axis**: Sum of transaction amount
- **Filter**: Transaction timestamp within the last 30 days.
- **Expected Output**: A line chart showing the total transaction volume for each day over the past 30 days.
2. **Review & Finish**:
- Verify the date filter correctly captures the last 30 days.
- Ensure the axes are labeled clearly.
Example Output for the above plan: `["Create line chart visualization 'Daily Transaction Volume (Last 30 Days)'"]`
"#,
plan
);