docstr: Encode and Add new input to req queue. support one sequence input for now.
docstr_tok: ["Encode","and","Add","new","input","to","req","queue",".","support","one","sequence","input","for","now","."]
code: def add_input(self, request_id, prompts, sampling_params):
      """
      Encode and Add new input to req queue. support one sequence input for now.
      """
      prompt_ids = self.tokenizer.encode(prompts)
      prompt_len = len(prompt_ids)
      if prompt_len > self.engine.max_input_len:
          raise ValueError(
              f"the input prompt token len {prompt_len} is too long > {self.engine.max_input_len}"
          )
      sampling_params.stop_sentences_to_token_ids(self.tokenizer)
      self.add_req(request_id, prompt_ids, sampling_params, prompts)
      return
  
imports: import time
  from typing import List
  from .dynamic_batching.get_tokenizer import get_tokenizer
  from .dynamic_batching.infer_batch import InferBatch
  from .dynamic_batching.io_struct import Batch, Req
  from .dynamic_batching.req_queue import ReqQueue
  from .dynamic_batching.sampling_params import SamplingParams
  from .dynamic_batching.stats import Stats
  from .tensor_parallel import TPInferEngine
label_desc: Use image node_id 3 for calling the DynamicBatchManager obj's underlying member method code with example usage: obj.add_input(request_id, prompts, sampling_params) without return types