code: def chat_compeletion_openai(
      messages: List[Dict],
      temperature: float = 0.0,
      max_tokens: int = 2048,
  ):
      output = API_ERROR_OUTPUT
      model = MODEL
      for _ in range(API_MAX_RETRY):
          try:
              response = openai.ChatCompletion.create(
                  model=model,
                  messages=messages,
                  n=1,
                  temperature=temperature,
                  max_tokens=max_tokens,
              )
              output = response["choices"][0]["message"]["content"]
              break
          except openai.error.OpenAIError as e:
              print(type(e), e)
              time.sleep(API_RETRY_SLEEP)
  
      return output
  
file_path: colossalai/applications/ColossalEval/colossal_eval/evaluate/dataset_evaluator/gpt_judge.py
imports: import ast
  import concurrent.futures
  import copy
  import json
  import os
  import re
  import time
  from typing import Any, Dict, List
  import numpy
  import openai
  import tqdm
label_desc: Use image node_id 3 for calling a global function with example usage: chat_compeletion_openai(messages, temperature, max_tokens) and returns: output