code: def to_pb(self) -> generate_pb2.GeneratedText:
      return generate_pb2.GeneratedText(
          text=self.text,
          generated_tokens=self.generated_tokens,
          finish_reason=self.finish_reason,
          seed=self.seed,
      )
  
imports: from functools import total_ordering
  import torch
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import List, Optional
  from transformers import PreTrainedTokenizerBase
  from text_generation_server.pb import generate_pb2
  from text_generation_server.pb.generate_pb2 import FinishReason
label_desc: Use image node_id 1 for calling the GeneratedText obj's underlying member method code with example usage: obj.to_pb() and returns: generate_pb2