def _handle_non_function_call_parts(
      self, response_part: types.Part, preserved_parts: list[types.Part]
  ):
    """Handles non-function-call parts of the response.

    Args:
      response_part: The response part to handle.
      preserved_parts: The mutable list of parts to store the processed parts
        in.
    """
    if response_part.text and FINAL_ANSWER_TAG in response_part.text:
      reasoning_text, final_answer_text = self._split_by_last_pattern(
          response_part.text, FINAL_ANSWER_TAG
      )
      if reasoning_text:
        reasoning_part = types.Part(text=reasoning_text)
        self._mark_as_thought(reasoning_part)
        preserved_parts.append(reasoning_part)
      if final_answer_text:
        preserved_parts.append(
            types.Part(
                text=final_answer_text,
            )
        )
    else:
      response_text = response_part.text or ''
      # If the part is a text part with a planning/reasoning/action tag,
      # label it as reasoning.
      if response_text and (
          any(
              response_text.startswith(tag)
              for tag in [
                  PLANNING_TAG,
                  REASONING_TAG,
                  ACTION_TAG,
                  REPLANNING_TAG,
              ]
          )
      ):
        self._mark_as_thought(response_part)
      preserved_parts.append(response_part)
Handles non-function-call parts of the response.

    Args:
      response_part: The response part to handle.
      preserved_parts: The mutable list of parts to store the processed parts
        in.
    
src/google/adk/planners/plan_re_act_planner.py