mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-08 12:20:20 +08:00
fix: enable image support for Kimi K2.5 model (#670)
* fix: enable image support for Kimi K2.5 model Kimi K2.5 supports image input but was incorrectly blocked by the supportsImageInput check that excluded all Kimi models without "vision" in the name. Updated the condition to only exclude the older K2 model while allowing K2.5. * fix: improve Kimi K2.5 image support logic and add tests - Only block kimi-k2 specifically, not all Kimi models - Add unit test for kimi-k2.5 image support
This commit is contained in:
+9
-2
@@ -1161,8 +1161,15 @@ export function supportsImageInput(modelId: string): boolean {
|
||||
lowerModelId.includes("vision") || lowerModelId.includes("vl")
|
||||
|
||||
// Models that DON'T support image/vision input (unless vision variant)
|
||||
// Kimi K2 models don't support images
|
||||
if (lowerModelId.includes("kimi") && !hasVisionIndicator) {
|
||||
// Kimi K2 doesn't support images, but K2.5 does
|
||||
// Only block kimi-k2 specifically, not other Kimi models
|
||||
if (
|
||||
(lowerModelId.includes("kimi-k2") ||
|
||||
lowerModelId.includes("kimi_k2")) &&
|
||||
!hasVisionIndicator &&
|
||||
!lowerModelId.includes("2.5") &&
|
||||
!lowerModelId.includes("k2.5")
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -168,6 +168,11 @@ describe("supportsImageInput", () => {
|
||||
expect(supportsImageInput("moonshot/kimi-k2")).toBe(false)
|
||||
})
|
||||
|
||||
it("returns true for Kimi K2.5 models (supports vision)", () => {
|
||||
expect(supportsImageInput("kimi-k2.5")).toBe(true)
|
||||
expect(supportsImageInput("moonshotai/kimi-k2.5")).toBe(true)
|
||||
})
|
||||
|
||||
it("returns false for DeepSeek text models", () => {
|
||||
expect(supportsImageInput("deepseek-chat")).toBe(false)
|
||||
expect(supportsImageInput("deepseek-coder")).toBe(false)
|
||||
|
||||
Reference in New Issue
Block a user