feat: Update Moonshot(Kimi) configs (#8372)

* feat:update kimi setting

* feat:update kimi logo

* mergei18n

* 仅修复 eslint error

Improves code readability by reformatting Moonshot provider configuration and related ternary expressions. Indentation and spacing are adjusted for consistency, with no functional changes.

* change kimi logo to 200x200

* update

* update 2 warnings in AssistantModelSettings.tsx

* fix: lint error

* fix: test error

---------

Co-authored-by: 自由的世界人 <3196812536@qq.com>
Co-authored-by: xiaochen <gongxiaochen@msh.team>
This commit is contained in:
shijuanfeng 2025-07-24 17:24:07 +08:00 committed by GitHub
parent 6c44f7fe24
commit 6102f88025
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -285,6 +285,10 @@ export function isFunctionCallingModel(model?: Model): boolean {
return true
}
if (['kimi', 'moonshot'].includes(model.provider)) {
return true
}
return FUNCTION_CALLING_REGEX.test(model.id)
}
@ -1267,7 +1271,21 @@ export const SYSTEM_MODELS: Record<string, Model[]> = {
name: 'moonshot-v1-auto',
provider: 'moonshot',
group: 'moonshot-v1',
owned_by: 'moonshot'
owned_by: 'moonshot',
type: ['text', 'function_calling']
},
{
id: 'kimi-k2-0711-preview',
name: 'kimi-k2-0711-preview',
provider: 'moonshot',
group: 'kimi-k2',
owned_by: 'moonshot',
type: ['text', 'function_calling'],
pricing: {
input_per_million_tokens: 0.6,
output_per_million_tokens: 2.5,
currencySymbol: 'USD'
}
}
],
baichuan: [

View File

@ -327,7 +327,7 @@ export const PROVIDER_CONFIG = {
url: 'https://api.moonshot.cn'
},
websites: {
official: 'https://moonshot.ai/',
official: 'https://www.moonshot.cn/',
apiKey: 'https://platform.moonshot.cn/console/api-keys',
docs: 'https://platform.moonshot.cn/docs/',
models: 'https://platform.moonshot.cn/docs/intro#%E6%A8%A1%E5%9E%8B%E5%88%97%E8%A1%A8'

View File

@ -180,8 +180,15 @@ const AssistantModelSettings: FC<Props> = ({ assistant, updateAssistant, updateA
model: selectedModel,
defaultModel: selectedModel
})
if (selectedModel.name.includes('kimi-k2')) {
setTemperature(0.6)
setTimeout(() => updateAssistantSettings({ temperature: 0.6 }), 500)
} else if (selectedModel.name.includes('moonshot')) {
setTemperature(0.3)
setTimeout(() => updateAssistantSettings({ temperature: 0.3 }), 500)
}
}
}, [assistant, defaultModel, updateAssistant])
}, [assistant, defaultModel, updateAssistant, updateAssistantSettings])
useEffect(() => {
return () => updateAssistantSettings({ customParameters: customParametersRef.current })