code: def get_payload(self, request: ChatCompletionsRequest) -> Dict:
      inputs = self.chat_template.render(
          messages=request.messages,
          add_generation_prompt=True,
      )
      stop = (
          [request.stop]
          if isinstance(request.stop, str)
          else request.stop
      ) or []
      if self.eos_token not in stop:
          stop.append(self.eos_token)
  
      parameters = {
          "do_sample": True,  # activate logits sampling
          "max_new_tokens": request.max_tokens,
          # TODO(egor-s): OpenAI parameters do not convert to `repetition_penalty`
          # "repetition_penalty": None,
          # "return_full_text": False,
          "stop": stop,
          "seed": request.seed,
          "temperature": request.temperature,
          # OpenAI doesn't specify `top_k` parameter
          # "top_k": None,
          # "truncate": None,
          # "typical_p": None,
          "best_of": request.n,
          # "watermark": False,
          "details": True,  # to get best_of_sequences
          "decoder_input_details": not request.stream,
      }
      if request.top_p < 1.0:
          parameters["top_p"] = request.top_p
      return {
          "inputs": inputs,
          "parameters": parameters,
      }
  
file_path: dstack/gateway/src/dstack/gateway/openai/clients/tgi.py
imports: import asyncio
  import datetime
  import json
  import uuid
  from typing import AsyncIterator, Dict, List, Optional
  import httpx
  import jinja2
  from dstack.gateway.errors import GatewayError
  from dstack.gateway.openai.clients import ChatCompletionsClient
  from dstack.gateway.openai.schemas import ChatCompletionsChoice, ChatCompletionsChunk, ChatCompletionsChunkChoice, ChatCompletionsRequest, ChatCompletionsResponse, ChatCompletionsUsage, ChatMessage, FinishReason
label_desc: Use image node_id 2 for calling the TGIChatCompletions obj's underlying member method code with example usage: obj.get_payload(request) and returns: dict