docstr: The max request length of the model. For Cohere, this is the same as the `max_sequence_length`.
  If we exceed the `max_sequence_length`, we get the following error:
  
  Request failed with too many tokens: total number of tokens (prompt and prediction) cannot
  exceed 2048 - received 2049. Try using a shorter prompt or a smaller max_tokens value.
  
  For the Command model, in rare situations, the co.tokenize returns a shorter list of tokens
  than the co.generate. This causes sequence length errors for rare inputs. Cohere's advice is
  to reduce the sequence length to 2020 to avoid these issues.
docstr_tok: ["The","max","request","length","of","the","model",".","For","Cohere",",","this","is","the","same","as","the","`","max_sequence_length","`",".","If","we","exceed","the","`","max_sequence_length","`",",","we","get","the","following","error",":","Request","failed","with","too","many","tokens",":","total","number","of","tokens","(","prompt","and","prediction",")","can","not","exceed","2048","-","received","2049",".","Try","using","a","shorter","prompt","or","a","smaller","max_tokens","value",".","For","the","Command","model",",","in","rare","situations",",","the","co.tokenize","returns","a","shorter","list","of","tokens","than","the","co.generate",".","This","causes","sequence","length","errors","for","rare","inputs",".","Cohere","'s","advice","is","to","reduce","the","sequence","length","to","2020","to","avoid","these","issues","."]
code: def max_request_length(self) -> int:
      """
      The max request length of the model. For Cohere, this is the same as the `max_sequence_length`.
      If we exceed the `max_sequence_length`, we get the following error:
  
      Request failed with too many tokens: total number of tokens (prompt and prediction) cannot
      exceed 2048 - received 2049. Try using a shorter prompt or a smaller max_tokens value.
  
      For the Command model, in rare situations, the co.tokenize returns a shorter list of tokens
      than the co.generate. This causes sequence length errors for rare inputs. Cohere's advice is
      to reduce the sequence length to 2020 to avoid these issues.
      """
      return 2020
  
imports: from typing import List, Optional
  from helm.proxy.clients.cohere_client import CohereClient
  from .local_window_service import LocalWindowService
  from .tokenizer_service import TokenizerService
  from .window_service import EncodeResult
  from helm.common.tokenization_request import TokenizationRequest, TokenizationRequestResult, TokenizationToken
label_desc: Use image node_id 2 for calling the CohereCommandWindowService obj's underlying member method code with example usage: obj.max_request_length() and returns: int