class_docstr: A wrapper class for openai client.
docstr: Print the usage summary.
docstr_tok: ["Print","the","usage","summary","."]
code: def print_usage_summary(
      self, mode: Union[str, List[str]] = ["actual", "total"]
  ) -> None:
      """Print the usage summary."""
  
      def print_usage(
          usage_summary: Optional[Dict[str, Any]],
          usage_type: str = "total",
      ) -> None:
          word_from_type = (
              "including" if usage_type == "total" else "excluding"
          )
          if usage_summary is None:
              print(
                  "No actual cost incurred (all completions are using cache).",
                  flush=True,
              )
              return
  
          print(
              f"Usage summary {word_from_type} cached usage: ",
              flush=True,
          )
          print(
              f"Total cost: {round(usage_summary['total_cost'], 5)}",
              flush=True,
          )
          for model, counts in usage_summary.items():
              if model == "total_cost":
                  continue  #
              print(
                  f"* Model '{model}': cost: {round(counts['cost'], 5)}, prompt_tokens: {counts['prompt_tokens']}, completion_tokens: {counts['completion_tokens']}, total_tokens: {counts['total_tokens']}",
                  flush=True,
              )
  
      if self.total_usage_summary is None:
          print(
              'No usage summary. Please call "create" first.',
              flush=True,
          )
          return
  
      if isinstance(mode, list):
          if len(mode) == 0 or len(mode) > 2:
              raise ValueError(
                  f'Invalid mode: {mode}, choose from "actual", "total", ["actual", "total"]'
              )
          if "actual" in mode and "total" in mode:
              mode = "both"
          elif "actual" in mode:
              mode = "actual"
          elif "total" in mode:
              mode = "total"
  
      print("-" * 100, flush=True)
      if mode == "both":
          print_usage(self.actual_usage_summary, "actual")
          print()
          if self.total_usage_summary != self.actual_usage_summary:
              print_usage(self.total_usage_summary, "total")
          else:
              print(
                  "All completions are non-cached: the total cost with cached completions is the same as actual cost.",
                  flush=True,
              )
      elif mode == "total":
          print_usage(self.total_usage_summary, "total")
      elif mode == "actual":
          print_usage(self.actual_usage_summary, "actual")
      else:
          raise ValueError(
              f'Invalid mode: {mode}, choose from "actual", "total", ["actual", "total"]'
          )
      print("-" * 100, flush=True)
  
imports: from __future__ import annotations
  import os
  import sys
  from typing import Any, List, Optional, Dict, Callable, Tuple, Union
  import logging
  import inspect
  from flaml.automl.logger import logger_formatter
  from pydantic import BaseModel
  from autogen.oai import completion
  from autogen.oai.openai_utils import DEFAULT_AZURE_API_VERSION, get_key, OAI_PRICE1K
  from autogen.token_count_utils import count_token
  from autogen._pydantic import model_dump
label_desc: Use image node_id 13 for calling the OpenAIWrapper obj's underlying member method code with example usage: obj.print_usage_summary(mode) without return types