code: def to_dict(self):
      ret = {}
      ret["do_sample"] = self.do_sample
      ret["presence_penalty"] = self.presence_penalty
      ret["frequency_penalty"] = self.frequency_penalty
      ret["temperature"] = self.temperature
      ret["top_p"] = self.top_p
      ret["top_k"] = self.top_k
      # if self.ignore_eos is not None:
      #     ret["ignore_eos"] = self.ignore_eos
      return ret
  
imports: from typing import List, Optional, Union
label_desc: Use image node_id 4 for calling the SamplingParams obj's underlying member method code with example usage: obj.to_dict() and returns: ret