[Fix] filter tool call capability for non-LLM models#882
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the BasePlatformClient to filter out ToolCall capabilities for models of type embeddings or reranker. A review comment suggests adding a nullish coalescing guard to model.capabilities to prevent potential TypeError exceptions if the capabilities array is undefined or null.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
WalkthroughSix adapter packages (Deepseek, Doubao, Hunyuan, OpenAI, OpenAI-like, and Qwen) now compute model type during Changes类型感知的模型能力过滤
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
更改内容: - 撤销 core 层改动 - 调整 OpenAI、OpenAI-like、Hunyuan、DeepSeek、Doubao、Qwen 适配器,先确定模型类型,再声明 ToolCall 能力 - 对 additional models 中的非 LLM 模型过滤 ToolCall,避免 embedding/reranker 暴露错误能力
Summary
ToolCallfrom embedding and reranker model capabilities inBasePlatformClient.getModels().ImageGenerationhandling andTextInputcapability normalization unchanged.Motivation
Some adapters can return embedding or reranker models with
ModelCapabilities.ToolCall. Since model metadata is exposed throughlistAllModels()andlistPlatformModels(), downstream UIs and plugins may incorrectly treat non-LLM models as supporting tool calls.This fixes the issue at the core registry boundary instead of relying on UI-side filtering.
Validation
yarn fast-build coreyarn lint