1616from gooddata_eval .core .agentic .search_tool import evaluate_agentic_search_tool
1717from gooddata_eval .core .agentic .visualization import evaluate_agentic_visualization
1818from gooddata_eval .core .config import ReasoningEffort
19- from gooddata_eval .core .models import CreatedVisualization , DatasetItem
19+ from gooddata_eval .core .models import AgenticEvalOutcome , CreatedVisualization , DatasetItem
2020from gooddata_eval .core .runner import EvalReport , ItemReport
2121
2222
@@ -86,8 +86,13 @@ def _dispatch_agentic(
8686 model_version_override : str | None ,
8787 reasoning_effort : ReasoningEffort | None = None ,
8888 agent_id : str | None = None ,
89- ) -> None :
90- """Call the appropriate evaluate_agentic_* function for the item's test_kind."""
89+ ) -> AgenticEvalOutcome | list [str ] | None :
90+ """Call the appropriate evaluate_agentic_* function for the item's test_kind.
91+
92+ Returns whatever that function returns -- alert_skill/metric_skill/conversation return
93+ an AgenticEvalOutcome; the rest still return None
94+ (unchanged).
95+ """
9196 kind = item .test_kind
9297 eo = item .expected_output
9398 lf_kw : _LfKw = {
@@ -100,7 +105,7 @@ def _dispatch_agentic(
100105 }
101106
102107 if kind in ("vis_agentic" , "agentic_visualization" ):
103- evaluate_agentic_visualization (
108+ return evaluate_agentic_visualization (
104109 host = host ,
105110 token = token ,
106111 workspace_id = workspace_id ,
@@ -111,7 +116,7 @@ def _dispatch_agentic(
111116 ** lf_kw ,
112117 )
113118 elif kind == "agentic_metric_skill" :
114- evaluate_agentic_metric_skill (
119+ return evaluate_agentic_metric_skill (
115120 host = host ,
116121 token = token ,
117122 workspace_id = workspace_id ,
@@ -122,7 +127,7 @@ def _dispatch_agentic(
122127 ** lf_kw ,
123128 )
124129 elif kind == "agentic_alert_skill" :
125- evaluate_agentic_alert_skill (
130+ return evaluate_agentic_alert_skill (
126131 host = host ,
127132 token = token ,
128133 workspace_id = workspace_id ,
@@ -136,7 +141,7 @@ def _dispatch_agentic(
136141 eo_dict = eo if isinstance (eo , dict ) else {}
137142 tool_call = eo_dict .get ("tool_call" , {})
138143 expected_args = tool_call .get ("function_arguments" , eo_dict )
139- evaluate_agentic_search_tool (
144+ return evaluate_agentic_search_tool (
140145 host = host ,
141146 token = token ,
142147 workspace_id = workspace_id ,
@@ -147,7 +152,7 @@ def _dispatch_agentic(
147152 ** lf_kw ,
148153 )
149154 elif kind == "agentic_general_question" :
150- evaluate_agentic_general_question (
155+ return evaluate_agentic_general_question (
151156 host = host ,
152157 token = token ,
153158 workspace_id = workspace_id ,
@@ -158,7 +163,7 @@ def _dispatch_agentic(
158163 ** lf_kw ,
159164 )
160165 elif kind == "agentic_guardrail" :
161- evaluate_agentic_guardrail (
166+ return evaluate_agentic_guardrail (
162167 host = host ,
163168 token = token ,
164169 workspace_id = workspace_id ,
@@ -180,7 +185,7 @@ def _dispatch_agentic(
180185 )
181186 elif kind == "agentic_conversation" :
182187 fixture_data = eo .get ("fixture" ) or eo if isinstance (eo , dict ) else {}
183- evaluate_agentic_conversation (
188+ return evaluate_agentic_conversation (
184189 host = host ,
185190 token = token ,
186191 workspace_id = workspace_id ,
@@ -228,14 +233,26 @@ def run_agentic_items(
228233 )
229234 t0 = time .perf_counter ()
230235 try :
231- _dispatch_agentic (
236+ outcome = _dispatch_agentic (
232237 item , host , token , workspace_id , k , langfuse , run_ts , model_version , reasoning_effort , agent_id
233238 )
239+ if isinstance (outcome , AgenticEvalOutcome ):
240+ reasoning_steps = outcome .reasoning_steps
241+ conversation_id = outcome .conversation_id
242+ response_id = outcome .response_id
243+ else :
244+ reasoning_steps , conversation_id , response_id = outcome , None , None
234245 item_report .pass_at_k = True
235246 item_report .runs = k
247+ item_report .reasoning_steps = reasoning_steps or []
248+ item_report .conversation_id = conversation_id
249+ item_report .response_id = response_id
236250 except AssertionError as exc :
237251 item_report .pass_at_k = False
238252 item_report .runs = k
253+ item_report .reasoning_steps = getattr (exc , "reasoning_steps" , None ) or []
254+ item_report .conversation_id = getattr (exc , "conversation_id" , None )
255+ item_report .response_id = getattr (exc , "response_id" , None )
239256 print (f"[agentic] { item .id } FAIL: { exc } " , flush = True )
240257 except Exception as exc :
241258 item_report .error = f"{ type (exc ).__name__ } : { exc } "
0 commit comments