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","."]
code: def _resolve_rerank_response(
      self, response: Response
  ) -> List[Dict[str, Any]]:
      # The documents key contains a dict containing the content of the document which is at least "text"
      # We flatten this nested dict for ease of consumption in the wandb UI
      flattened_response_dicts = [
          flatten_dict(_response.__dict__) for _response in response
      ]
      # ReRank returns each document provided a top_n value so we aggregate into one view so users can paginate a row
      # As opposed to each row being one of the top_n responses
      return_dict = collect_common_keys(flattened_response_dicts)
      return_dict["id"] = response.id
      return [return_dict]
  
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 7 for calling the CohereRequestResponseResolver obj's underlying member method code with example usage: obj._resolve_rerank_response(response) and returns: list