Skip to content

update glm model list#527

Merged
dingyi222666 merged 1 commit into
ChatLunaLab:v1-devfrom
LoserFox:patch-1
Aug 24, 2025
Merged

update glm model list#527
dingyi222666 merged 1 commit into
ChatLunaLab:v1-devfrom
LoserFox:patch-1

Conversation

@LoserFox
Copy link
Copy Markdown
Contributor

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 17, 2025

Walkthrough

在 ZhipuClient.refreshModels() 中新增六个 GLM-4.5 家族模型(含 V 版),统一设置 maxTokens=128000;同时为 GLM-4.1V-Thinking-FlashX 项补上尾随逗号。其余逻辑(getModels、init、_createModel、embeddings 映射与 functionCall 规则)未改。

Changes

Cohort / File(s) Summary
模型清单扩充与小型语法修正
packages/zhipu-adapter/src/client.ts
在 rawModels 中加入 GLM-4.5、GLM-4.5X、GLM-4.5-Air、GLM-4.5-AirX、GLM-4.5-Flash、GLM-4.5V(均 maxTokens=128000);为 GLM-4.1V-Thinking-FlashX 项添加尾随逗号;未改动导出接口与其它逻辑,getModels() 将返回包含新模型的列表。

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: 返回包含新模型的列表
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

小兔提耳敲键盘,模型清单又登攀;
四点五风拂面,X与Air齐并肩;
闪电疾驰V也到,逗号轻点队更全;
我把胡萝卜一转:新名单,请查验。

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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 64dedf3 and 3537b78.

📒 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 不需要修改。

@dingyi222666 dingyi222666 merged commit b80462a into ChatLunaLab:v1-dev Aug 24, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants