def _from_token_logprob_dicts(
    token_logprob_dicts: Sequence[Dict[str, Any]],
) -> List[List[LogProb]]:
    """
    Convert a sequence of token logprob dictionaries to a list of LogProb objects.

    Args:
        token_logprob_dicts: The token logprob dictionaries to convert.

    Returns:
        A list of lists of LogProb objects.

    Raises:
        Warning: Logs a warning if an error occurs while parsing token logprobs.

    """
    result = []
    for token_logprob_dict in token_logprob_dicts:
        try:
            logprobs_list = [
                LogProb(
                    token=el.get("token"),
                    logprob=el.get("logprob"),
                    bytes=el.get("bytes") or [],
                )
                for el in token_logprob_dict.get("top_logprobs", [])
            ]
            if logprobs_list:
                result.append(logprobs_list)
        except Exception as e:
            logger.warning(
                "Error occurred in attempt to parse token logprob. "
                f"Details: {e}. Src: {token_logprob_dict}"
            )
    return result

    Convert a sequence of token logprob dictionaries to a list of LogProb objects.

    Args:
        token_logprob_dicts: The token logprob dictionaries to convert.

    Returns:
        A list of lists of LogProb objects.

    Raises:
        Warning: Logs a warning if an error occurs while parsing token logprobs.

    
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/utils.py