def test_convert_single_turn_multiple_tools_and_texts():
  """Test a turn with multiple agent responses (tools and text)."""
  events = [
      build_event("user", [{"text": "Do task A then task B"}]),
      build_event(
          "root_agent", [{"text": "Okay, starting task A."}]
      ),  # Intermediate Text 1
      build_event(
          "root_agent", [{"func_name": "task_A", "func_args": {"param": 1}}]
      ),  # Tool 1
      build_event(
          "root_agent", [{"text": "Task A done. Now starting task B."}]
      ),  # Intermediate Text 2
      build_event(
          "another_agent", [{"func_name": "task_B", "func_args": {}}]
      ),  # Tool 2
      build_event(
          "root_agent", [{"text": "All tasks completed."}]
      ),  # Final Text (Reference)
  ]
  session = Session(id="s1", app_name="app", user_id="u1", events=events)
  expected = [{
      "query": "Do task A then task B",
      "expected_tool_use": [
          {"tool_name": "task_A", "tool_input": {"param": 1}},
          {"tool_name": "task_B", "tool_input": {}},
      ],
      "expected_intermediate_agent_responses": [
          {"author": "root_agent", "text": "Okay, starting task A."},
          {
              "author": "root_agent",
              "text": "Task A done. Now starting task B.",
          },
      ],
      "reference": "All tasks completed.",
  }]
  assert convert_session_to_eval_format(session) == expected
Test a turn with multiple agent responses (tools and text).
tests/unittests/cli/utils/test_evals.py