def extract_additional_info_from_response(response) -> Dict[str, Any]:
    """
    Extracts additional information from the Aleph Alpha completion response.

    :param response: The response object from Aleph Alpha API.
    :return: A dictionary with extracted information.
    """
    completion = response.completions[0] if response.completions else {}

    additional_info = {
        "model_version": getattr(response, "model_version", None),
        "log_probs": getattr(completion, "log_probs", None),
        "raw_completion": getattr(completion, "raw_completion", None),
        "finish_reason": getattr(completion, "finish_reason", None),
    }

    return {k: v for k, v in additional_info.items() if v is not None}

    Extracts additional information from the Aleph Alpha completion response.

    :param response: The response object from Aleph Alpha API.
    :return: A dictionary with extracted information.
    
llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/utils.py