-
Notifications
You must be signed in to change notification settings - Fork 164
fix(config): recognize provider model capabilities #346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
248e12d
73e7a88
f87e754
ff895ae
2cc09f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Recognize DeepSeek Anthropic-compatible chat model capabilities. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Avoid defaulting OpenAI and Anthropic environment models to Kimi-only capabilities. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Recognize current Kimi Open Platform model capabilities. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Recognize MiMo Anthropic-compatible chat model capabilities. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Recognize MiniMax Anthropic-compatible chat model capabilities. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,43 @@ import { | |
| sanitizeToolCallId, | ||
| type ToolCallIdPolicy, | ||
| } from './tool-call-id'; | ||
|
|
||
| const KIMI_K2_6_CAPABILITY: ModelCapability = Object.freeze({ | ||
| image_in: true, | ||
| video_in: true, | ||
| audio_in: false, | ||
| thinking: true, | ||
| tool_use: true, | ||
| max_context_tokens: 0, | ||
| }); | ||
|
|
||
| const KIMI_K2_5_CAPABILITY: ModelCapability = Object.freeze({ | ||
| image_in: true, | ||
| video_in: false, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For Useful? React with 👍 / 👎. |
||
| audio_in: false, | ||
| thinking: true, | ||
| tool_use: true, | ||
| max_context_tokens: 0, | ||
| }); | ||
|
|
||
| const KIMI_VISION_TOOL_CAPABILITY: ModelCapability = Object.freeze({ | ||
| image_in: true, | ||
| video_in: false, | ||
| audio_in: false, | ||
| thinking: false, | ||
| tool_use: true, | ||
| max_context_tokens: 0, | ||
| }); | ||
|
|
||
| const KIMI_TEXT_TOOL_CAPABILITY: ModelCapability = Object.freeze({ | ||
| image_in: false, | ||
| video_in: false, | ||
| audio_in: false, | ||
| thinking: false, | ||
| tool_use: true, | ||
| max_context_tokens: 0, | ||
| }); | ||
|
|
||
| export interface KimiOptions { | ||
| apiKey?: string | undefined; | ||
| baseUrl?: string | undefined; | ||
|
|
@@ -499,6 +536,15 @@ export class KimiChatProvider implements ChatProvider { | |
| } | ||
|
|
||
| getCapability(_model?: string): ModelCapability { | ||
| const model = (_model ?? this._model).toLowerCase(); | ||
| if (model === 'kimi-k2.6') return KIMI_K2_6_CAPABILITY; | ||
| if (model === 'kimi-k2.5') return KIMI_K2_5_CAPABILITY; | ||
| if (/^moonshot-v1-(?:8k|32k|128k)-vision-preview$/.test(model)) { | ||
| return KIMI_VISION_TOOL_CAPABILITY; | ||
| } | ||
| if (/^moonshot-v1-(?:8k|32k|128k)$/.test(model)) { | ||
| return KIMI_TEXT_TOOL_CAPABILITY; | ||
| } | ||
| return UNKNOWN_CAPABILITY; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shared capability object makes
MiniMax-M2.7andMiniMax-M2.7-highspeedreportthinking: false, even though the Anthropic-compatible M2.7 API emitsthinkingblocks as part of its interleaved-thinking tool flow. Any caller relying ongetCapability()will under-report those models and can hide or avoid thinking support for a model whose tool-loop responses include reasoning blocks; split M2.7 out or mark the M2.x entries that support interleaved thinking as thinking-capable.Useful? React with 👍 / 👎.