def _from_completion_logprobs_dict(
    completion_logprobs_dict: Dict[str, Any],
) -> List[List[LogProb]]:
    """
    Convert completion logprobs to a list of generic LogProb objects.

    Args:
        completion_logprobs_dict: The completion logprobs to convert.

    Returns:
        A list of lists of LogProb objects.

    """
    return [
        [
            LogProb(token=token, logprob=logprob, bytes=[])
            for token, logprob in logprob_dict.items()
        ]
        for logprob_dict in completion_logprobs_dict.get("top_logprobs", [])
    ]

    Convert completion logprobs to a list of generic LogProb objects.

    Args:
        completion_logprobs_dict: The completion logprobs to convert.

    Returns:
        A list of lists of LogProb objects.

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