def from_openai_completion_logprob(
    openai_completion_logprob: Dict[str, float],
) -> List[LogProb]:
    """Convert openai completion logprobs to generic list of LogProb."""
    return [
        LogProb(token=t, logprob=v, bytes=[])
        for t, v in openai_completion_logprob.items()
    ]
Convert openai completion logprobs to generic list of LogProb.
llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py