class_docstr: Status of a sequence.
class_docstr_tok: ["Status","of","a","sequence","."]
code: def get_finished_reason(status: "SequenceStatus") -> Union[str, None]:
      if status == SequenceStatus.FINISHED_STOPPED:
          finish_reason = "stop"
      elif status == SequenceStatus.FINISHED_LENGTH_CAPPED:
          finish_reason = "length"
      elif status == SequenceStatus.FINISHED_ABORTED:
          finish_reason = "abort"
      elif status == SequenceStatus.FINISHED_IGNORED:
          # The ignored sequences are the sequences whose prompt lengths
          # are longer than the model's length cap. Therefore, the stop
          # reason should also be "length" as in OpenAI API.
          finish_reason = "length"
      else:
          finish_reason = None
      return finish_reason
  
imports: import copy
  import enum
  import time
  from typing import Dict, List, Optional, Union
  from bigdl.llm.vllm.sampling_params import SamplingParams
  from bigdl.llm.utils.common import invalidInputError
label_desc: Use image node_id 2 for calling the SequenceStatus obj's underlying member method code with example usage: obj.get_finished_reason(status) and returns: finish_reason