GuglielmoTor commited on
Commit
5dc7e98
·
verified ·
1 Parent(s): a854b3e

Update run_agentic_pipeline.py

Browse files
Files changed (1) hide show
  1. run_agentic_pipeline.py +8 -0
run_agentic_pipeline.py CHANGED
@@ -8,6 +8,7 @@ import pandas as pd
8
  from typing import Dict, Any, Optional
9
  import gradio as gr
10
 
 
11
  # Assuming this script is at the same level as 'app.py' and 'insight_and_tasks/' is a subfolder
12
  # If 'insight_and_tasks' is not in python path, you might need to adjust sys.path
13
  # For example, if insight_and_tasks is a sibling of the dir containing this file:
@@ -43,6 +44,7 @@ except ImportError as e:
43
  def extract_key_results_for_selection(okrs_dict): return [] # Placeholder
44
  def format_single_okr_for_display(okr_data, **kwargs): return "Agentic modules not loaded. OKR display unavailable." # Placeholder
45
 
 
46
 
47
  logger = logging.getLogger(__name__)
48
 
@@ -198,6 +200,12 @@ async def run_agentic_pipeline_autonomously(current_token_state_val, orchestrati
198
  report_str = orchestration_output.get('comprehensive_analysis_report', "Nessun report dettagliato fornito.")
199
  agentic_report_md_update = gr.update(value=format_report_to_markdown(report_str))
200
 
 
 
 
 
 
 
201
  actionable_okrs = orchestration_output.get('actionable_okrs_and_tasks') # This is the dict containing 'okrs' list
202
  krs_for_ui_selection_list = extract_key_results_for_selection(actionable_okrs) # Expects the dict
203
 
 
8
  from typing import Dict, Any, Optional
9
  import gradio as gr
10
 
11
+
12
  # Assuming this script is at the same level as 'app.py' and 'insight_and_tasks/' is a subfolder
13
  # If 'insight_and_tasks' is not in python path, you might need to adjust sys.path
14
  # For example, if insight_and_tasks is a sibling of the dir containing this file:
 
44
  def extract_key_results_for_selection(okrs_dict): return [] # Placeholder
45
  def format_single_okr_for_display(okr_data, **kwargs): return "Agentic modules not loaded. OKR display unavailable." # Placeholder
46
 
47
+ from services.report_data_handler import save_report_results
48
 
49
  logger = logging.getLogger(__name__)
50
 
 
200
  report_str = orchestration_output.get('comprehensive_analysis_report', "Nessun report dettagliato fornito.")
201
  agentic_report_md_update = gr.update(value=format_report_to_markdown(report_str))
202
 
203
+ quarter = orchestration_output.get('quarter', "quarter non disponibile")
204
+ year = orchestration_output.get('year', "year non disponibile")
205
+ org_urn = current_token_state_val.get('org_urn')
206
+
207
+ save_report_results(org_urn=org_urn, report_markdown=report_str, quarter=quarter, year=year, type='Quarter')
208
+
209
  actionable_okrs = orchestration_output.get('actionable_okrs_and_tasks') # This is the dict containing 'okrs' list
210
  krs_for_ui_selection_list = extract_key_results_for_selection(actionable_okrs) # Expects the dict
211