class_docstr: Unit tests for the openai LLM class
class_docstr_tok: ["Unit","tests","for","the","openai","LLM","class"]
code: def test_chat_completion(self, mocker):
      openai = OpenAI(api_token="test")
      expected_response = OpenAIObject(
          {
              "choices": [
                  {
                      "text": "Hello, how can I help you today?",
                      "index": 0,
                      "logprobs": None,
                      "finish_reason": "stop",
                      "start_text": "",
                  }
              ]
          }
      )
  
      mocker.patch.object(
          openai, "chat_completion", return_value=expected_response
      )
  
      result = openai.chat_completion("Hi")
      openai.chat_completion.assert_called_once_with("Hi")
  
      assert result == expected_response
  
file_path: pandas-ai/tests/llms/test_openai.py
imports: import openai
  import pytest
  from pandasai.exceptions import APIKeyNotFoundError, UnsupportedModelError
  from pandasai.llm import OpenAI
  from pandasai.prompts import AbstractPrompt
label_desc: Use image node_id 7 for calling the TestOpenAILLM obj's underlying member method code with example usage: obj.test_chat_completion(mocker) without return types