def METHOD_NAME(self, text: str, expected_completion_token_length: int = 0) -> bool:
    """
    Checks if the given text fits within the context window given by `max_request_length`
    taking to account the expected completion length (defaults to 0).
    According to https://docs.cohere.ai/tokenize-reference#request, for tokenize, text: "the string to
    be tokenized, the minimum text length is 1 character, and the maximum text length is 65,536 characters.",
    so first check if the text has fewer than 65,536 characters.
    """
    return (
        len(text) <= CohereClient.TOKENIZE_API_MAX_TEXT_LENGTH
        and self.get_num_tokens(text) + expected_completion_token_length <= self.max_request_length
    )