def test_convert_multi_turn_session():
  """Test a session with multiple user/agent turns."""
  events = [
      build_event("user", [{"text": "Query 1"}]),
      build_event("agent", [{"text": "Response 1"}]),
      build_event("user", [{"text": "Query 2"}]),
      build_event("agent", [{"func_name": "tool_X", "func_args": {}}]),
      build_event("agent", [{"text": "Response 2"}]),
  ]
  session = Session(id="s1", app_name="app", user_id="u1", events=events)
  expected = [
      {  # Turn 1
          "query": "Query 1",
          "expected_tool_use": [],
          "expected_intermediate_agent_responses": [],
          "reference": "Response 1",
      },
      {  # Turn 2
          "query": "Query 2",
          "expected_tool_use": [{"tool_name": "tool_X", "tool_input": {}}],
          "expected_intermediate_agent_responses": [],
          "reference": "Response 2",
      },
  ]
  assert convert_session_to_eval_format(session) == expected
Test a session with multiple user/agent turns.
tests/unittests/cli/utils/test_evals.py