docstr: :param engine: str
      TextSynth API engine (e.g. `gptj_6B`)
  :param truncate: bool
      Truncate input if too long (if False and input is too long, throw error)
docstr_tok: [":","param","engine",":","str","TextSynth","API","engine","(","e.g",".","`","gptj_6B","`",")",":","param","truncate",":","bool","Truncate","input","if","too","long","(","if","False","and","input","is","too","long",",","throw","error",")"]
code: def __init__(self, engine, truncate=False):
      """
      :param engine: str
          TextSynth API engine (e.g. `gptj_6B`)
      :param truncate: bool
          Truncate input if too long (if False and input is too long, throw error)
      """
      super().__init__()
  
      self.engine = engine
      self.truncate = truncate
      self.api_url = "https://api.textsynth.com"
      # Read from environment variable TEXTSYNTH_API_SECRET_KEY
      self.api_key = os.environ["TEXTSYNTH_API_SECRET_KEY"]
  
imports: import logging
  import os
  import requests
  import time
  from tqdm import tqdm
  from lm_eval.base import BaseLM
label_desc: Use image node_id 1 to create a new TextSynthLM object from inherited base classes: BaseLM with example: obj = TextSynthLM(engine, truncate)