code: def run_openai_client(
      stream_output,
      chat,
      local_server,
      prompt,
      api_key,
      enforce_h2ogpt_api_key,
      repeat,
  ):
      base_model = "openchat/openchat-3.5-1210"
  
      if local_server:
          from src.gen import main
  
          main(
              base_model=base_model,
              chat=False,
              stream_output=stream_output,
              gradio=True,
              num_beams=1,
              block_gradio_exit=False,
              add_disk_models_to_ui=False,
              enforce_h2ogpt_api_key=enforce_h2ogpt_api_key,
              # or use file with h2ogpt_api_keys=h2ogpt_api_keys.json
              h2ogpt_api_keys=[api_key] if api_key else None,
          )
          time.sleep(10)
      else:
          # RUN something
          # e.g. CUDA_VISIBLE_DEVICES=0 python generate.py --verbose=True --score_model=None --gradio_offline_level=2 --base_model=openchat/openchat-3.5-1210 --inference_server=vllm:IP:port --max_seq_len=4096 --save_dir=duder1 --verbose --openai_server=True --concurency_count=64
          pass
  
      # api_key = "EMPTY"  # if gradio/openai server not keyed.  Can't pass '' itself, leads to httpcore.LocalProtocolError: Illegal header value b'Bearer '
      # Setting H2OGPT_H2OGPT_KEY does not key h2oGPT, just passes along key to gradio inference server, so empty key is valid test regardless of the H2OGPT_H2OGPT_KEY value
      # api_key = os.environ.get('H2OGPT_H2OGPT_KEY', 'EMPTY')  # if keyed and have this in env with same key
      print("api_key: %s" % api_key)
      # below should be consistent with server prefix, host, and port
      base_url = "http://localhost:5000/v1"
      verbose = True
      system_prompt = "You are a helpful assistant."
      chat_conversation = []
      add_chat_history_to_context = True
  
      client_kwargs = dict(
          model=base_model, max_tokens=200, stream=stream_output
      )
  
      from openai import OpenAI, AsyncOpenAI
  
      client_args = dict(base_url=base_url, api_key=api_key)
      openai_client = OpenAI(**client_args)
      async_client = AsyncOpenAI(**client_args)
  
      try:
          test_chat(
              chat,
              openai_client,
              async_client,
              system_prompt,
              chat_conversation,
              add_chat_history_to_context,
              prompt,
              client_kwargs,
              stream_output,
              verbose,
          )
      except AssertionError:
          if enforce_h2ogpt_api_key and api_key is None:
              print("Expected to fail since no key but enforcing.")
          else:
              raise
  
      # MODELS
      model_info = openai_client.models.retrieve(base_model)
      assert model_info.base_model == base_model
      model_list = openai_client.models.list()
      assert model_list.data[0] == base_model
  
file_path: h2ogpt/openai_server/test_openai_server.py
imports: import time
  import pytest
  import os
  from tests.utils import wrap_test_forked
label_desc: Use image node_id 5 for calling a global function with example usage: run_openai_client(stream_output, chat, local_server, prompt, api_key, enforce_h2ogpt_api_key, repeat) without return types