mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-19 14:41:24 +08:00
feat: 添加火山引擎 Doubao-Seed-1.8 模型支持 (#11972)
- 新增模型定义: doubao-seed-1-8-251215 - 支持思考模式: reasoning_effort (minimal/low/medium/high) - 支持 Function Call - 支持图像理解 (Vision) - 更新正则表达式支持 seed-1.8 变体 - 添加完整测试覆盖 修改文件: - src/renderer/src/config/models/default.ts - src/renderer/src/config/models/reasoning.ts - src/renderer/src/aiCore/utils/reasoning.ts - src/renderer/src/config/models/vision.ts - src/renderer/src/config/models/tooluse.ts - src/renderer/src/config/models/__tests__/reasoning.test.ts
This commit is contained in:
parent
0cf0072b51
commit
0f1b3afa72
@ -10,6 +10,7 @@ import {
|
|||||||
GEMINI_FLASH_MODEL_REGEX,
|
GEMINI_FLASH_MODEL_REGEX,
|
||||||
getModelSupportedReasoningEffortOptions,
|
getModelSupportedReasoningEffortOptions,
|
||||||
isDeepSeekHybridInferenceModel,
|
isDeepSeekHybridInferenceModel,
|
||||||
|
isDoubaoSeed18Model,
|
||||||
isDoubaoSeedAfter251015,
|
isDoubaoSeedAfter251015,
|
||||||
isDoubaoThinkingAutoModel,
|
isDoubaoThinkingAutoModel,
|
||||||
isGemini3ThinkingTokenModel,
|
isGemini3ThinkingTokenModel,
|
||||||
@ -389,7 +390,7 @@ export function getReasoningEffort(assistant: Assistant, model: Model): Reasonin
|
|||||||
|
|
||||||
// Use thinking, doubao, zhipu, etc.
|
// Use thinking, doubao, zhipu, etc.
|
||||||
if (isSupportedThinkingTokenDoubaoModel(model)) {
|
if (isSupportedThinkingTokenDoubaoModel(model)) {
|
||||||
if (isDoubaoSeedAfter251015(model)) {
|
if (isDoubaoSeedAfter251015(model) || isDoubaoSeed18Model(model)) {
|
||||||
return { reasoningEffort }
|
return { reasoningEffort }
|
||||||
}
|
}
|
||||||
if (reasoningEffort === 'high') {
|
if (reasoningEffort === 'high') {
|
||||||
|
|||||||
@ -733,6 +733,11 @@ describe('getThinkModelType - Comprehensive Coverage', () => {
|
|||||||
expect(getThinkModelType(createModel({ id: 'doubao-seed-1-6-lite-251015' }))).toBe('doubao_after_251015')
|
expect(getThinkModelType(createModel({ id: 'doubao-seed-1-6-lite-251015' }))).toBe('doubao_after_251015')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should return doubao_after_251015 for Doubao-Seed-1.8 models', () => {
|
||||||
|
expect(getThinkModelType(createModel({ id: 'doubao-seed-1-8-251215' }))).toBe('doubao_after_251015')
|
||||||
|
expect(getThinkModelType(createModel({ id: 'doubao-seed-1.8' }))).toBe('doubao_after_251015')
|
||||||
|
})
|
||||||
|
|
||||||
it('should return doubao_no_auto for other Doubao thinking models', () => {
|
it('should return doubao_no_auto for other Doubao thinking models', () => {
|
||||||
expect(getThinkModelType(createModel({ id: 'doubao-1.5-thinking-vision-pro' }))).toBe('doubao_no_auto')
|
expect(getThinkModelType(createModel({ id: 'doubao-1.5-thinking-vision-pro' }))).toBe('doubao_no_auto')
|
||||||
})
|
})
|
||||||
@ -863,6 +868,7 @@ describe('getThinkModelType - Comprehensive Coverage', () => {
|
|||||||
// auto > after_251015 > no_auto
|
// auto > after_251015 > no_auto
|
||||||
expect(getThinkModelType(createModel({ id: 'doubao-seed-1.6' }))).toBe('doubao')
|
expect(getThinkModelType(createModel({ id: 'doubao-seed-1.6' }))).toBe('doubao')
|
||||||
expect(getThinkModelType(createModel({ id: 'doubao-seed-1-6-251015' }))).toBe('doubao_after_251015')
|
expect(getThinkModelType(createModel({ id: 'doubao-seed-1-6-251015' }))).toBe('doubao_after_251015')
|
||||||
|
expect(getThinkModelType(createModel({ id: 'doubao-seed-1-8-251215' }))).toBe('doubao_after_251015')
|
||||||
expect(getThinkModelType(createModel({ id: 'doubao-1.5-thinking-vision-pro' }))).toBe('doubao_no_auto')
|
expect(getThinkModelType(createModel({ id: 'doubao-1.5-thinking-vision-pro' }))).toBe('doubao_no_auto')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -746,6 +746,12 @@ export const SYSTEM_MODELS: Record<SystemProviderId | 'defaultModel', Model[]> =
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
doubao: [
|
doubao: [
|
||||||
|
{
|
||||||
|
id: 'doubao-seed-1-8-251215',
|
||||||
|
provider: 'doubao',
|
||||||
|
name: 'Doubao-Seed-1.8',
|
||||||
|
group: 'Doubao-Seed-1.8'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'doubao-1-5-vision-pro-32k-250115',
|
id: 'doubao-1-5-vision-pro-32k-250115',
|
||||||
provider: 'doubao',
|
provider: 'doubao',
|
||||||
|
|||||||
@ -146,7 +146,7 @@ const _getThinkModelType = (model: Model): ThinkingModelType => {
|
|||||||
} else if (isSupportedThinkingTokenDoubaoModel(model)) {
|
} else if (isSupportedThinkingTokenDoubaoModel(model)) {
|
||||||
if (isDoubaoThinkingAutoModel(model)) {
|
if (isDoubaoThinkingAutoModel(model)) {
|
||||||
thinkingModelType = 'doubao'
|
thinkingModelType = 'doubao'
|
||||||
} else if (isDoubaoSeedAfter251015(model)) {
|
} else if (isDoubaoSeedAfter251015(model) || isDoubaoSeed18Model(model)) {
|
||||||
thinkingModelType = 'doubao_after_251015'
|
thinkingModelType = 'doubao_after_251015'
|
||||||
} else {
|
} else {
|
||||||
thinkingModelType = 'doubao_no_auto'
|
thinkingModelType = 'doubao_no_auto'
|
||||||
@ -457,7 +457,7 @@ export function isQwenAlwaysThinkModel(model?: Model): boolean {
|
|||||||
|
|
||||||
// Doubao 支持思考模式的模型正则
|
// Doubao 支持思考模式的模型正则
|
||||||
export const DOUBAO_THINKING_MODEL_REGEX =
|
export const DOUBAO_THINKING_MODEL_REGEX =
|
||||||
/doubao-(?:1[.-]5-thinking-vision-pro|1[.-]5-thinking-pro-m|seed-1[.-]6(?:-flash)?(?!-(?:thinking)(?:-|$))|seed-code(?:-preview)?(?:-\d+)?)(?:-[\w-]+)*/i
|
/doubao-(?:1[.-]5-thinking-vision-pro|1[.-]5-thinking-pro-m|seed-1[.-][68](?:-flash)?(?!-(?:thinking)(?:-|$))|seed-code(?:-preview)?(?:-\d+)?)(?:-[\w-]+)*/i
|
||||||
|
|
||||||
// 支持 auto 的 Doubao 模型 doubao-seed-1.6-xxx doubao-seed-1-6-xxx doubao-1-5-thinking-pro-m-xxx
|
// 支持 auto 的 Doubao 模型 doubao-seed-1.6-xxx doubao-seed-1-6-xxx doubao-1-5-thinking-pro-m-xxx
|
||||||
// Auto thinking is no longer supported after version 251015, see https://console.volcengine.com/ark/region:ark+cn-beijing/model/detail?Id=doubao-seed-1-6
|
// Auto thinking is no longer supported after version 251015, see https://console.volcengine.com/ark/region:ark+cn-beijing/model/detail?Id=doubao-seed-1-6
|
||||||
@ -475,6 +475,11 @@ export function isDoubaoSeedAfter251015(model: Model): boolean {
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isDoubaoSeed18Model(model: Model): boolean {
|
||||||
|
const pattern = /doubao-seed-1[.-]8(?:-[\w-]+)?/i
|
||||||
|
return pattern.test(model.id) || pattern.test(model.name)
|
||||||
|
}
|
||||||
|
|
||||||
export function isSupportedThinkingTokenDoubaoModel(model?: Model): boolean {
|
export function isSupportedThinkingTokenDoubaoModel(model?: Model): boolean {
|
||||||
if (!model) {
|
if (!model) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export const FUNCTION_CALLING_MODELS = [
|
|||||||
'learnlm(?:-[\\w-]+)?',
|
'learnlm(?:-[\\w-]+)?',
|
||||||
'gemini(?:-[\\w-]+)?', // 提前排除了gemini的嵌入模型
|
'gemini(?:-[\\w-]+)?', // 提前排除了gemini的嵌入模型
|
||||||
'grok-3(?:-[\\w-]+)?',
|
'grok-3(?:-[\\w-]+)?',
|
||||||
'doubao-seed-1[.-]6(?:-[\\w-]+)?',
|
'doubao-seed-1[.-][68](?:-[\\w-]+)?',
|
||||||
'doubao-seed-code(?:-[\\w-]+)?',
|
'doubao-seed-code(?:-[\\w-]+)?',
|
||||||
'kimi-k2(?:-[\\w-]+)?',
|
'kimi-k2(?:-[\\w-]+)?',
|
||||||
'ling-\\w+(?:-[\\w-]+)?',
|
'ling-\\w+(?:-[\\w-]+)?',
|
||||||
|
|||||||
@ -45,7 +45,7 @@ const visionAllowedModels = [
|
|||||||
'deepseek-vl(?:[\\w-]+)?',
|
'deepseek-vl(?:[\\w-]+)?',
|
||||||
'kimi-latest',
|
'kimi-latest',
|
||||||
'gemma-3(?:-[\\w-]+)',
|
'gemma-3(?:-[\\w-]+)',
|
||||||
'doubao-seed-1[.-]6(?:-[\\w-]+)?',
|
'doubao-seed-1[.-][68](?:-[\\w-]+)?',
|
||||||
'doubao-seed-code(?:-[\\w-]+)?',
|
'doubao-seed-code(?:-[\\w-]+)?',
|
||||||
'kimi-thinking-preview',
|
'kimi-thinking-preview',
|
||||||
`gemma3(?:[-:\\w]+)?`,
|
`gemma3(?:[-:\\w]+)?`,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user