class_docstr: Class to resolve the request/response from the Cohere API and convert it to a dictionary that can be logged.
class_docstr_tok: ["Class","to","resolve","the","request\/response","from","the","Cohere","API","and","convert","it","to","a","dictionary","that","can","be","logged","."]
docstr: Convert a list of dictionaries to a pair of column names and corresponding values, with the option to order specific dictionaries.
  
  :param args: The arguments passed to the API client.
  :param kwargs: The keyword arguments passed to the API client.
  :param parsed_response: The parsed response from the API.
  :param start_time: The start time of the API request.
  :param time_elapsed: The time elapsed during the API request.
  :param response_type: The type of the API response.
  :param table_column_order: The desired order of columns in the resulting table.
  :param default_model: The default model to use if not specified in the response.
  :return: A dictionary containing the formatted response.
docstr_tok: ["Convert","a","list","of","dictionaries","to","a","pair","of","column","names","and","corresponding","values",",","with","the","option","to","order","specific","dictionaries",".",":","param","args",":","The","arguments","passed","to","the","API","client",".",":","param","kwargs",":","The","keyword","arguments","passed","to","the","API","client",".",":","param","parsed_response",":","The","parsed","response","from","the","API",".",":","param","start_time",":","The","start","time","of","the","API","request",".",":","param","time_elapsed",":","The","time","elapsed","during","the","API","request",".",":","param","response_type",":","The","type","of","the","API","response",".",":","param","table_column_order",":","The","desired","order","of","columns","in","the","resulting","table",".",":","param","default_model",":","The","default","model","to","use","if","not","specified","in","the","response",".",":","return",":","A","dictionary","containing","the","formatted","response","."]
code: def _resolve(
      self,
      args: Sequence[Any],
      kwargs: Dict[str, Any],
      parsed_response: List[Dict[str, Any]],
      start_time: float,
      time_elapsed: float,
      response_type: str,
      table_column_order: List[str],
      default_model: str,
  ) -> Dict[str, Any]:
      """Convert a list of dictionaries to a pair of column names and corresponding values, with the option to order specific dictionaries.
  
      :param args: The arguments passed to the API client.
      :param kwargs: The keyword arguments passed to the API client.
      :param parsed_response: The parsed response from the API.
      :param start_time: The start time of the API request.
      :param time_elapsed: The time elapsed during the API request.
      :param response_type: The type of the API response.
      :param table_column_order: The desired order of columns in the resulting table.
      :param default_model: The default model to use if not specified in the response.
      :return: A dictionary containing the formatted response.
      """
      # Args[0] is the client object where we can grab specific metadata about the underlying API status
      query_id = generate_id(length=16)
      parsed_args = subset_dict(
          args[0].__dict__,
          [
              "api_version",
              "batch_size",
              "max_retries",
              "num_workers",
              "timeout",
          ],
      )
  
      start_time_dt = datetime.fromtimestamp(start_time)
      end_time_dt = datetime.fromtimestamp(start_time + time_elapsed)
  
      timings = {
          "start_time": start_time_dt,
          "end_time": end_time_dt,
          "time_elapsed_(seconds)": time_elapsed,
      }
  
      packed_data = []
      for _parsed_response in parsed_response:
          _packed_dict = {
              "query_id": query_id,
              **kwargs,
              **_parsed_response,
              **timings,
              **parsed_args,
          }
          if "model" not in _packed_dict:
              _packed_dict["model"] = default_model
          packed_data.append(_packed_dict)
  
      columns, data = reorder_and_convert_dict_list_to_table(
          packed_data, table_column_order
      )
  
      request_response_table = wandb.Table(data=data, columns=columns)
  
      return {f"{response_type}": request_response_table}
  
file_path: wandb/wandb/integration/cohere/resolver.py
imports: import logging
  from datetime import datetime
  from typing import Any, Dict, List, Optional, Sequence, Tuple
  import wandb
  from wandb.sdk.integration_utils.auto_logging import Response
  from wandb.sdk.lib.runid import generate_id
label_desc: Use image node_id 8 for calling the CohereRequestResponseResolver obj's underlying member method code with example usage: obj._resolve(args, kwargs, parsed_response, start_time, time_elapsed, response_type, table_column_order, default_model) and returns: dict