feat: allow Kimi K2.5 to be specified via Model Name (#12639)

* feat: allow Kimi K2.5 to be specified via Model Name

* fix: allow Kimi K2.5 specified via Model Name through button renderer
This commit is contained in:
Yuxi Long / Jaden Long 2026-01-28 23:11:13 -05:00 committed by GitHub
parent 6bf3e5506f
commit 5c7f3229a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -603,11 +603,16 @@ export const isSupportedThinkingTokenMiMoModel = (model: Model): boolean => {
* @param model - The model object to check
* @returns true if the model supports thinking control, false otherwise
*/
export const isSupportedThinkingTokenKimiModel = (model: Model): boolean => {
const _isSupportedThinkingTokenKimiModel = (model: Model): boolean => {
const modelId = getLowerBaseModelName(model.id, '/')
return ['kimi-k2.5'].some((id) => modelId.includes(id))
}
export const isSupportedThinkingTokenKimiModel = (model: Model): boolean => {
const { idResult, nameResult } = withModelIdAndNameAsId(model, _isSupportedThinkingTokenKimiModel)
return idResult || nameResult
}
export const isDeepSeekHybridInferenceModel = (model: Model) => {
const { idResult, nameResult } = withModelIdAndNameAsId(model, (model) => {
const modelId = getLowerBaseModelName(model.id)
@ -685,16 +690,21 @@ export const isBaichuanReasoningModel = (model?: Model): boolean => {
* @param model - The model object to check, can be undefined
* @returns true if it's a Kimi reasoning model, false otherwise
*/
export function isKimiReasoningModel(model?: Model): boolean {
if (!model) {
return false
}
const _isKimiReasoningModel = (model: Model): boolean => {
const modelId = getLowerBaseModelName(model.id, '/')
// Match kimi-k2-thinking, kimi-k2-thinking-turbo, or kimi-k2.5
// The regex ensures no extra suffixes after these patterns
return /^kimi-k2-thinking(?:-turbo)?$|^kimi-k2\.5(?:-\w)*$/.test(modelId)
}
export function isKimiReasoningModel(model?: Model): boolean {
if (!model) {
return false
}
const { idResult, nameResult } = withModelIdAndNameAsId(model, _isKimiReasoningModel)
return idResult || nameResult
}
export function isReasoningModel(model?: Model): boolean {
if (!model || isEmbeddingModel(model) || isRerankModel(model) || isTextToImageModel(model)) {
return false