update glm model list#527
Conversation
Walkthrough在 ZhipuClient.refreshModels() 中新增六个 GLM-4.5 家族模型(含 V 版),统一设置 maxTokens=128000;同时为 GLM-4.1V-Thinking-FlashX 项补上尾随逗号。其余逻辑(getModels、init、_createModel、embeddings 映射与 functionCall 规则)未改。 Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as 调用方
participant Client as ZhipuClient
participant Store as 内部模型清单
Dev->>Client: init()
Client->>Client: refreshModels()
Client->>Store: 更新 rawModels(加入 GLM-4.5 家族)
Dev->>Client: getModels()
Client-->>Dev: 返回包含新模型的列表
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/zhipu-adapter/src/client.ts (1)
61-66: 函数调用开关可能不适配新增的 V 模型(GLM-4.5V)当前映射逻辑为
functionCall: model !== 'GLM-4V',仅排除了单个 ID。新增的 GLM-4.5V 仍会被标记为支持 functionCall。若 V 系列统一不支持 function call,这会在运行时触发工具调用失败。建议改为基于“Vision 型号白/黑名单”判断,以免漏网。示例实现(供参考,修改发生在 72-81 行附近):
// 在 refreshModels 内部 const visionModels = new Set<string>([ 'GLM-4V', 'GLM-4V-Plus-0111', 'GLM-4V-Flash', 'GLM-4.1V-Thinking-Flash', 'GLM-4.1V-Thinking-FlashX', 'GLM-4.5V', ]) // 映射时: functionCall: !visionModels.has(model),若官方确认为部分 V 型号支持函数调用,再将其从集合中移除即可。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/zhipu-adapter/src/client.ts(1 hunks)
🔇 Additional comments (2)
packages/zhipu-adapter/src/client.ts (2)
60-60: 为 GLM-4.1V-Thinking-FlashX 补尾逗号:LGTM修正使后续新增项语法正确,变更合理。
61-66: 确认 GLM-4.5 系列模型的 maxTokens 均为 128000
- 根据公开官方资料,GLM-4.5、GLM-4.5-Air、GLM-4.5-AirX、GLM-4.5-Flash 以及 GLM-4.5V 均标注支持 128K(约 128 000 tokens)的上下文窗口。
- “GLM-4.5X” 并非智谱/官方标准命名,可能是某平台的别名;请在所用 API 平台(BigModel、Hugging Face 等)的 model-card 中确认其是否存在及对应的 max_tokens 设置。
综上,除非你在特定平台发现不同的 model-card 限制,否则当前统一设置为 128 000 不需要修改。
No description provided.