Interface Model

All Known Implementing Classes:
StandardModel

public interface Model
Internal model for a GPT language model. Helps to colocate model-specific logic e.g. token counting.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    id()
     
    int
    tokens(List<String> messages)
    Estimates the number of tokens the messages will consume when passed to this model.
  • Method Details

    • id

      String id()
      Returns:
      well-known model ID e.g. gpt-3.5-turbo-0125
    • contextWindow

      int contextWindow()
      Returns:
      maximum size of the context window supported by this model
    • tokens

      int tokens(List<String> messages)
      Estimates the number of tokens the messages will consume when passed to this model. The estimate can vary based on the model.
      Parameters:
      messages - the list of messages for which to estimate token usage
      Returns:
      estimated tokens that would be consumed by the model