mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-02-06 11:01:13 +08:00
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:
parent
6bf3e5506f
commit
5c7f3229a2
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user