33import click
44
55from datapilot .clients .altimate .utils import check_token_and_instance
6- from datapilot .clients .altimate .utils import get_project_governance_llm_checks
76from datapilot .clients .altimate .utils import onboard_file
8- from datapilot .clients .altimate .utils import run_project_governance_llm_checks
97from datapilot .clients .altimate .utils import start_dbt_ingestion
108from datapilot .clients .altimate .utils import validate_credentials
119from datapilot .clients .altimate .utils import validate_permissions
1210from datapilot .config .config import load_config
11+ from datapilot .core .platforms .dbt .constants import LLM
1312from datapilot .core .platforms .dbt .constants import MODEL
1413from datapilot .core .platforms .dbt .constants import PROJECT
1514from datapilot .core .platforms .dbt .executor import DBTInsightGenerator
@@ -30,8 +29,8 @@ def dbt():
3029
3130
3231@dbt .command ("project-health" )
33- @click .option ("--token" , prompt = "API Token" , help = "Your API token for authentication." )
34- @click .option ("--instance-name" , prompt = "Instance Name" , help = "Your tenant ID." )
32+ @click .option ("--token" , required = False , prompt = "API Token" , help = "Your API token for authentication." )
33+ @click .option ("--instance-name" , required = False , prompt = "Instance Name" , help = "Your tenant ID." )
3534@click .option (
3635 "--manifest-path" ,
3736 required = True ,
@@ -70,15 +69,20 @@ def project_health(
7069 manifest = load_manifest (manifest_path )
7170 catalog = load_catalog (catalog_path ) if catalog_path else None
7271
73- llm_checks = get_project_governance_llm_checks (token , instance_name , backend_url )
74- check_names = [check ["name" ] for check in llm_checks if check ["alias" ] not in config .get ("disabled_insights" , [])]
75- llm_check_results = run_project_governance_llm_checks (token , instance_name , backend_url , manifest , catalog , check_names )
76-
77- insight_generator = DBTInsightGenerator (manifest = manifest , catalog = catalog , config = config , selected_models = selected_models )
72+ insight_generator = DBTInsightGenerator (
73+ manifest = manifest ,
74+ catalog = catalog ,
75+ config = config ,
76+ selected_models = selected_models ,
77+ token = token ,
78+ instance_name = instance_name ,
79+ backend_url = backend_url ,
80+ )
7881 reports = insight_generator .run ()
7982
8083 package_insights = reports [PROJECT ]
8184 model_insights = reports [MODEL ]
85+ llm_insights = reports [LLM ]
8286 model_report = generate_model_insights_table (model_insights )
8387 if len (model_report ) > 0 :
8488 click .echo ("--" * 50 )
@@ -97,11 +101,11 @@ def project_health(
97101 click .echo ("--" * 50 )
98102 click .echo (tabulate_data (project_report , headers = "keys" ))
99103
100- if llm_check_results :
104+ if len ( llm_insights ) :
101105 click .echo ("--" * 50 )
102106 click .echo ("Project Governance LLM Insights" )
103107 click .echo ("--" * 50 )
104- for check in llm_check_results [ "results" ] :
108+ for check in llm_insights :
105109 click .echo (f"Check: { check ['name' ]} " )
106110 for answer in check ["answer" ]:
107111 click .echo (f"Rule: { answer ['Rule' ]} " )
0 commit comments