ModelContextWindows
public final class ModelContextWindows
io/agentscope/core/model/ModelContextWindows.java:29–167模型上下文 Windows,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.model 包。核心成员包括 lookup、DASHSCOPE、OPENAI、DEEPSEEK、GLM、MINIMAX。
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".
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
DASHSCOPEstaticfinal | Map<String, Integer> | DashScope字段。 The DASHSCOPE field. |
OPENAIstaticfinal | Map<String, Integer> | OpenAI字段。 The OPENAI field. |
DEEPSEEKstaticfinal | Map<String, Integer> | DeepSeek字段。 The DEEPSEEK field. |
GLMstaticfinal | Map<String, Integer> | GLM字段。 The GLM field. |
MINIMAXstaticfinal | Map<String, Integer> | MiniMax字段。 The MINIMAX field. |
KIMIstaticfinal | Map<String, Integer> | KIMI字段。 The KIMI field. |
ANTHROPICstaticfinal | Map<String, Integer> | `ANTHROPIC` 字段。 The ANTHROPIC field. |
GEMINIstaticfinal | Map<String, Integer> | `GEMINI` 字段。 The GEMINI field. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static int lookup(String modelName, Map<String, Integer> knownModels)static | 执行 `lookup` 方法。 Finds the context window size for the given model name from the provided map. |
字段详情Field Detail
DASHSCOPE
public static final Map<String, Integer> DASHSCOPE
DashScope字段。声明为 public static final Map DASHSCOPE。
The DASHSCOPE field.
io/agentscope/core/model/ModelContextWindows.java:35–57OPENAI
public static final Map<String, Integer> OPENAI
OpenAI字段。声明为 public static final Map OPENAI。
The OPENAI field.
io/agentscope/core/model/ModelContextWindows.java:59–78DEEPSEEK
public static final Map<String, Integer> DEEPSEEK
DeepSeek字段。声明为 public static final Map DEEPSEEK。
The DEEPSEEK field.
io/agentscope/core/model/ModelContextWindows.java:80–83GLM
public static final Map<String, Integer> GLM
GLM字段。声明为 public static final Map GLM。
The GLM field.
io/agentscope/core/model/ModelContextWindows.java:85–100MINIMAX
public static final Map<String, Integer> MINIMAX
MiniMax字段。声明为 public static final Map MINIMAX。
The MINIMAX field.
io/agentscope/core/model/ModelContextWindows.java:102–112KIMI
public static final Map<String, Integer> KIMI
KIMI字段。声明为 public static final Map KIMI。
The KIMI field.
io/agentscope/core/model/ModelContextWindows.java:114–126ANTHROPIC
public static final Map<String, Integer> ANTHROPIC
ANTHROPIC 字段。声明为 public static final Map ANTHROPIC。
The ANTHROPIC field.
io/agentscope/core/model/ModelContextWindows.java:128–135GEMINI
public static final Map<String, Integer> GEMINI
GEMINI 字段。声明为 public static final Map GEMINI。
The GEMINI field.
io/agentscope/core/model/ModelContextWindows.java:137–141方法详情Method Detail
lookup
public static int lookup(String modelName, Map<String, Integer> knownModels)
执行 lookup 方法。
Finds the context window size for the given model name from the provided map.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。The model name. |
knownModels | Map<String, Integer> | known 模型(类型 `Map`)。The known models. |
intio/agentscope/core/model/ModelContextWindows.java:151–166