def test_convert_agent_event_multiple_parts():
  """Test an agent event with both text and tool call parts."""
  events = [
      build_event("user", [{"text": "Do something complex"}]),
      # Build event with multiple dicts in parts_content list
      build_event(
          "agent",
          [
              {"text": "Okay, doing it."},
              {"func_name": "complex_tool", "func_args": {"value": True}},
          ],
      ),
      build_event("agent", [{"text": "Finished."}]),
  ]
  session = Session(id="s1", app_name="app", user_id="u1", events=events)
  expected = [{
      "query": "Do something complex",
      "expected_tool_use": [
          {"tool_name": "complex_tool", "tool_input": {"value": True}}
      ],
      "expected_intermediate_agent_responses": [{
          "author": "agent",
          "text": "Okay, doing it.",
      }],  # Text from first part of agent event
      "reference": "Finished.",  # Text from second agent event
  }]
  assert convert_session_to_eval_format(session) == expected
Test an agent event with both text and tool call parts.
tests/unittests/cli/utils/test_evals.py