类 ModelContextWindows

java.lang.Object
io.agentscope.core.model.ModelContextWindows

public final class ModelContextWindows extends Object
Known context window sizes for popular models. Used by ChatModelBase subclasses to infer Model.getContextWindowSize() from the model name when no explicit value is provided via the builder.

Values are total context window (input + output) in tokens. Entries are matched via prefix: a model name "qwen-max-latest" matches the "qwen-max" entry. Longer prefixes are checked first so "gpt-4.1-mini" matches before "gpt-4.1".

  • 字段详细资料

  • 方法详细资料

    • lookup

      public static int lookup(String modelName, Map<String,Integer> knownModels)
      Finds the context window size for the given model name from the provided map. Uses prefix matching: longest matching prefix wins.
      返回:
      context window size, or 0 if no match