def generate_completion_dict(
    text_str: str, model: Any, model_path: Optional[str]
) -> Dict:
    """
    Generate a dictionary for text completion details.

    Returns:
    dict: A dictionary containing completion details.

    """
    completion_id: str = f"cmpl-{uuid.uuid4()!s}"
    created: int = int(time.time())
    model_name: str = model if model is not None else model_path
    return {
        "id": completion_id,
        "object": "text_completion",
        "created": created,
        "model": model_name,
        "choices": [
            {
                "text": text_str,
                "index": 0,
                "logprobs": None,
                "finish_reason": "stop",
            }
        ],
        "usage": {
            "prompt_tokens": None,
            "completion_tokens": None,
            "total_tokens": None,
        },
    }

    Generate a dictionary for text completion details.

    Returns:
    dict: A dictionary containing completion details.

    
llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/utils.py