21
21
22
22
from dbally .audit .event_tracker import EventTracker
23
23
from dbally .iql_generator .iql_generator import IQLGenerator
24
- from dbally .iql_generator .iql_prompt_template import UnsupportedQueryError , default_iql_template
24
+ from dbally .iql_generator .prompt import IQL_GENERATION_TEMPLATE , UnsupportedQueryError
25
25
from dbally .llms .litellm import LiteLLM
26
26
from dbally .views .structured import BaseStructuredView
27
27
@@ -33,13 +33,15 @@ async def _run_iql_for_single_example(
33
33
event_tracker = EventTracker ()
34
34
35
35
try :
36
- iql_filters , _ = await iql_generator .generate_iql (
37
- question = example .question , filters = filter_list , event_tracker = event_tracker
36
+ iql_filters = await iql_generator .generate_iql (
37
+ question = example .question ,
38
+ filters = filter_list ,
39
+ event_tracker = event_tracker ,
38
40
)
39
41
except UnsupportedQueryError :
40
42
return IQLResult (question = example .question , iql_filters = "UNSUPPORTED_QUERY" , exception_raised = True )
41
43
42
- return IQLResult (question = example .question , iql_filters = iql_filters , exception_raised = False )
44
+ return IQLResult (question = example .question , iql_filters = str ( iql_filters ) , exception_raised = False )
43
45
44
46
45
47
async def run_iql_for_dataset (
@@ -139,7 +141,7 @@ async def evaluate(cfg: DictConfig) -> Any:
139
141
logger .info (f"IQL predictions saved under directory: { output_dir } " )
140
142
141
143
if run :
142
- run ["config/iql_prompt_template" ] = stringify_unsupported (default_iql_template .chat )
144
+ run ["config/iql_prompt_template" ] = stringify_unsupported (IQL_GENERATION_TEMPLATE .chat )
143
145
run [f"evaluation/{ metrics_file_name } " ].upload ((output_dir / metrics_file_name ).as_posix ())
144
146
run [f"evaluation/{ results_file_name } " ].upload ((output_dir / results_file_name ).as_posix ())
145
147
run ["evaluation/metrics" ] = stringify_unsupported (metrics )
0 commit comments