class_docstr: The TextEnvironment enables interaction of a LLM with an environment using tools.
docstr: Check if the current generation sequences have finished.
docstr_tok: ["Check","if","the","current","generation","sequences","have","finished","."]
code: def tasks_end_check(self, histories, model_turn=True):
      """
      Check if the current generation sequences have finished.
      """
      for history in histories:
          if not history.completed:
              truncated, ended = self.task_end_check(
                  history, model_turn=model_turn
              )
              if ended:
                  history.complete(truncated=truncated)
      return histories
  
imports: import re
  import warnings
  import torch
  from accelerate.utils import extract_model_from_parallel
  from transformers import StoppingCriteria, StoppingCriteriaList
  from ..import_utils import is_rich_available
label_desc: Use image node_id 7 for calling the TextEnvironment obj's underlying member method code with example usage: obj.tasks_end_check(histories, model_turn) and returns: histories