class_docstr: Callback Handler that tracks OpenAI info.
docstr: Collect token usage
docstr_tok: ["Collect","token","usage"]
code: def __call__(self, response) -> None:
      """Collect token usage"""
      usage = response.usage
      if not hasattr(usage, "total_tokens"):
          return None
  
      model_name = standardize_model_name(response.model)
      if model_name in MODEL_COST_PER_1K_TOKENS:
          prompt_cost = get_openai_token_cost_for_model(
              model_name, usage.prompt_tokens
          )
          completion_cost = get_openai_token_cost_for_model(
              model_name, usage.completion_tokens, is_completion=True
          )
          self.total_cost += prompt_cost + completion_cost
  
      self.total_tokens += usage.total_tokens
      self.prompt_tokens += usage.prompt_tokens
      self.completion_tokens += usage.completion_tokens
  
file_path: pandas-ai/pandasai/helpers/openai_info.py
imports: from contextlib import contextmanager
  from contextvars import ContextVar
  from typing import Optional, Generator
label_desc: Use image node_id 2 for calling the OpenAICallbackHandler obj's underlying member method code with example usage: obj.__call__(response) and returns: None