@@ -108,8 +108,13 @@ class AgenticRunSummary:
108108def generate_simulated_response (agent_message : str , expected_output : CreatedVisualization ) -> str :
109109 """Generate a simulated user reply to an agent clarification question.
110110
111- Uses OpenAI gpt-5.2 to produce a realistic reply that guides the agent
112- toward the expected visualization without revealing the answer directly.
111+ Uses OpenAI gpt-5.2 to produce a realistic reply that guides the agent toward the
112+ expected visualization without revealing the answer directly. Objects are named in words
113+ made from their ids (`uri_to_display_name`: `metric/total_returns` -> "total returns"), not
114+ by their titles, which are not available here, and never as `{type/id}` references: a goal
115+ of references makes the simulated user volunteer them, handing the agent objects it should
116+ resolve itself. A date filter names its date dataset the same way, without which the
117+ simulated user cannot say which date "2024" means.
113118 Requires the [llm-judge] extra: pip install gooddata-eval[llm-judge]
114119 """
115120 try :
@@ -138,10 +143,12 @@ def generate_simulated_response(agent_message: str, expected_output: CreatedVisu
138143 granularity = filter_dict .get ("granularity" , "" )
139144 from_val = filter_dict .get ("from" , "" )
140145 to_val = filter_dict .get ("to" , "" )
146+ dataset = filter_dict .get ("using" )
147+ on_dataset = f" on the { uri_to_display_name (dataset )} " if isinstance (dataset , str ) and dataset else ""
141148 filter_parts .append (
142- f"date filter: { granularity } from { from_val } to { to_val } "
149+ f"date filter{ on_dataset } : { granularity } from { from_val } to { to_val } "
143150 if granularity
144- else f"date filter: { from_val } to { to_val } "
151+ else f"date filter{ on_dataset } : { from_val } to { to_val } "
145152 )
146153 elif ft == "ranking_filter" :
147154 n = filter_dict .get ("top" ) or filter_dict .get ("bottom" )
@@ -196,7 +203,9 @@ def generate_simulated_response(agent_message: str, expected_output: CreatedVisu
196203 f"Respond naturally to the agent's question. Be helpful and answer what they're asking about.\n "
197204 f"If the agent asks specifically about items from your goal (like which metrics or dimensions "
198205 f"you want), you should mention them. Keep your response concise and natural, as a real user would."
199- f"{ no_filter_hint } "
206+ f"{ no_filter_hint } \n "
207+ f"If the agent offers alternatives, choose the one that matches your goal and repeat it as the "
208+ f"agent wrote it."
200209 ),
201210 },
202211 ],
0 commit comments