def get_completion_endpoint(is_chat_model: bool) -> Any:
    """
    Get the appropriate completion endpoint based on the model type and API version.

    Args:
    - is_chat_model (bool): A flag indicating whether the model is a chat model.

    Returns:
    - The appropriate completion endpoint based on the model type and API version.

    Raises:
    - NotImplementedError: If the combination of is_chat_model and API version is not supported.

    """
    # For OpenAI version 1
    if is_openai_v1():
        return konko.chat.completions if is_chat_model else konko.completions

    # For other versions
    if not is_openai_v1():
        return konko.ChatCompletion if is_chat_model else konko.Completion

    # Raise error if the combination of is_chat_model and API version is not covered
    raise NotImplementedError(
        "The combination of model type and API version is not supported."
    )

    Get the appropriate completion endpoint based on the model type and API version.

    Args:
    - is_chat_model (bool): A flag indicating whether the model is a chat model.

    Returns:
    - The appropriate completion endpoint based on the model type and API version.

    Raises:
    - NotImplementedError: If the combination of is_chat_model and API version is not supported.

    
llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py