🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
💄 style(volcengine): Add new Doubao-Seed-2.1 models (#16204)
sxjeru2785505794f5
diff --git a/packages/model-bank/src/aiModels/volcengine.ts b/packages/model-bank/src/aiModels/volcengine.tsindex 64284e25412..e9b383c706c 100644--- a/packages/model-bank/src/aiModels/volcengine.ts+++ b/packages/model-bank/src/aiModels/volcengine.ts@@ -74,6 +74,128 @@ const seedance15ProParams: VideoModelParamsSchema = {};const doubaoChatModels: AIChatModelCard[] = [+ {+ abilities: {+ functionCall: true,+ reasoning: true,+ video: true,+ vision: true,+ search: true,+ },+ config: {+ deploymentName: 'doubao-seed-evolving',+ },+ contextWindowTokens: 256_000,+ description:+ 'Doubao Seed Evolving adopts a self-evolving mechanism with continuous weekly updates to keep model performance at the cutting edge.',+ displayName: 'Doubao Seed Evolving',+ family: 'doubao',+ generation: 'doubao-evolving',+ id: 'doubao-seed-evolving',+ maxOutput: 128_000,+ pricing: {+ currency: 'CNY',+ units: [+ { name: 'textInput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },+ { name: 'textInput_cacheRead', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },+ {+ lookup: { prices: { '1h': 0.017 }, pricingParams: ['ttl'] },+ name: 'textInput_cacheWrite',+ strategy: 'lookup',+ unit: 'millionTokens',+ },+ ],+ },+ releasedAt: '2026-06-23',+ settings: {+ extendParams: ['gpt5ReasoningEffort'],+ searchImpl: 'params',+ },+ type: 'chat',+ },+ {+ abilities: {+ functionCall: true,+ reasoning: true,+ video: true,+ vision: true,+ search: true,+ },+ config: {+ deploymentName: 'doubao-seed-2-1-pro-260628',+ },+ contextWindowTokens: 256_000,+ description:+ "Doubao-Seed-2.1-pro is ByteDance's new generation flagship Agent general model, optimized for coding, agentic planning, and long-chain task execution with native multimodal understanding.",+ displayName: 'Doubao Seed 2.1 Pro',+ enabled: true,+ family: 'doubao',+ generation: 'doubao-2.1',+ id: 'doubao-seed-2.1-pro',+ maxOutput: 128_000,+ pricing: {+ currency: 'CNY',+ units: [+ { name: 'textInput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },+ { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },+ { name: 'textInput_cacheRead', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },+ {+ lookup: { prices: { '1h': 0.017 }, pricingParams: ['ttl'] },+ name: 'textInput_cacheWrite',+ strategy: 'lookup',+ unit: 'millionTokens',+ },+ ],+ },+ releasedAt: '2026-06-23',+ settings: {+ extendParams: ['gpt5ReasoningEffort'],+ searchImpl: 'params',+ },+ type: 'chat',+ },+ {+ abilities: {+ functionCall: true,+ reasoning: true,+ video: true,+ vision: true,+ search: true,+ },+ config: {+ deploymentName: 'doubao-seed-2-1-turbo-260628',+ },+ contextWindowTokens: 256_000,+ description:+ 'Doubao-Seed-2.1-turbo balances efficiency and performance for high-concurrency production scenarios with strong reasoning and agentic capabilities.',+ displayName: 'Doubao Seed 2.1 Turbo',+ enabled: true,+ family: 'doubao',+ generation: 'doubao-2.1',+ id: 'doubao-seed-2.1-turbo',+ maxOutput: 128_000,+ pricing: {+ currency: 'CNY',+ units: [+ { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },+ { name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },+ { name: 'textInput_cacheRead', rate: 0.6, strategy: 'fixed', unit: 'millionTokens' },+ {+ lookup: { prices: { '1h': 0.017 }, pricingParams: ['ttl'] },+ name: 'textInput_cacheWrite',+ strategy: 'lookup',+ unit: 'millionTokens',+ },+ ],+ },+ releasedAt: '2026-06-23',+ settings: {+ extendParams: ['gpt5ReasoningEffort'],+ searchImpl: 'params',+ },+ type: 'chat',+ },{abilities: {functionCall: true,@@ -103,7 +225,7 @@ const doubaoChatModels: AIChatModelCard[] = [},releasedAt: '2026-04-24',settings: {- extendParams: ['enableReasoning'],+ extendParams: ['deepseekV4ReasoningEffort'],searchImpl: 'params',},type: 'chat',@@ -137,7 +259,7 @@ const doubaoChatModels: AIChatModelCard[] = [},releasedAt: '2026-04-24',settings: {- extendParams: ['enableReasoning'],+ extendParams: ['deepseekV4ReasoningEffort'],searchImpl: 'params',},type: 'chat',@@ -157,7 +279,6 @@ const doubaoChatModels: AIChatModelCard[] = [description:"Doubao-Seed-2.0-pro is ByteDance's flagship Agent general model, with all-around leaps in complex task planning and execution capabilities.",displayName: 'Doubao Seed 2.0 Pro',- enabled: true,family: 'doubao',generation: 'doubao-2.0',id: 'doubao-seed-2.0-pro',@@ -222,7 +343,6 @@ const doubaoChatModels: AIChatModelCard[] = [description:'Doubao-Seed-2.0-lite is a new multimodal deep-reasoning model that delivers better value and a strong choice for common tasks, with a context window up to 256k.',displayName: 'Doubao Seed 2.0 Lite',- enabled: true,family: 'doubao',generation: 'doubao-2.0',id: 'doubao-seed-2.0-lite',diff --git a/packages/model-runtime/src/providers/volcengine/index.test.ts b/packages/model-runtime/src/providers/volcengine/index.test.tsindex fed0d78e1e2..74fc837faa2 100644--- a/packages/model-runtime/src/providers/volcengine/index.test.ts+++ b/packages/model-runtime/src/providers/volcengine/index.test.ts@@ -57,5 +57,69 @@ describe('LobeVolcengineAI - custom features', () => {const calledPayload = (instance['client'].chat.completions.create as any).mock.calls[0][0];expect(calledPayload.thinking).toEqual({ type: 'enabled' });});++ it('should map deepseek-v4 thinking disabled to minimal reasoning_effort', async () => {+ await instance.chat({+ messages: [{ content: 'Hello', role: 'user' }],+ model: 'deepseek-v4-pro-260425',+ thinking: {+ type: 'disabled',+ },+ });++ const calledPayload = (instance['client'].chat.completions.create as any).mock.calls[0][0];+ expect(calledPayload.thinking).toEqual({ type: 'disabled' });+ expect(calledPayload.reasoning_effort).toBe('minimal');+ });++ it('should map deepseek-v4 thinking enabled without reasoning_effort to high reasoning_effort', async () => {+ await instance.chat({+ messages: [{ content: 'Hello', role: 'user' }],+ model: 'deepseek-v4-pro-260425',+ thinking: {+ type: 'enabled',+ },+ });++ const calledPayload = (instance['client'].chat.completions.create as any).mock.calls[0][0];+ expect(calledPayload.thinking).toEqual({ type: 'enabled' });+ expect(calledPayload.reasoning_effort).toBe('high');+ });++ it('should preserve reasoning_effort for deepseek-v4 when explicitly set', async () => {+ await instance.chat({+ messages: [{ content: 'Hello', role: 'user' }],+ model: 'deepseek-v4-pro-260425',+ reasoning_effort: 'max',+ thinking: {+ type: 'enabled',+ },+ });++ const calledPayload = (instance['client'].chat.completions.create as any).mock.calls[0][0];+ expect(calledPayload.thinking).toEqual({ type: 'enabled' });+ expect(calledPayload.reasoning_effort).toBe('max');+ });++ it('should fallback reasoning_effort max to high for deepseek-v4 under responses path (enabledSearch: true)', async () => {+ // Mock the Responses API client call+ vi.spyOn(instance['client'].responses, 'create').mockResolvedValue(+ new ReadableStream() as any,+ );++ await instance.chat({+ messages: [{ content: 'Hello', role: 'user' }],+ model: 'deepseek-v4-pro-260425',+ reasoning_effort: 'max',+ enabledSearch: true,+ thinking: {+ type: 'enabled',+ },+ });++ const calledPayload = (instance['client'].responses.create as any).mock.calls[0][0];+ expect(calledPayload.thinking).toEqual({ type: 'enabled' });+ expect(calledPayload.reasoning.effort).toBe('high');+ });});});diff --git a/packages/model-runtime/src/providers/volcengine/index.ts b/packages/model-runtime/src/providers/volcengine/index.tsindex fe0168d586b..8bf31308e73 100644--- a/packages/model-runtime/src/providers/volcengine/index.ts+++ b/packages/model-runtime/src/providers/volcengine/index.ts@@ -7,6 +7,35 @@ import { createVolcengineImage } from './createImage';import { createVolcengineVideo } from './video/createVideo';import { handleVolcengineVideoWebhook } from './video/handleCreateVideoWebhook';+const resolveVolcengineReasoningParams = (+ model: string,+ thinking: any,+ reasoning_effort: any,+ isResponses = false,+) => {+ let targetThinking = thinking;+ let targetReasoningEffort = reasoning_effort;++ if (model?.includes('deepseek-v4')) {+ if (thinking?.type === 'disabled') {+ targetThinking = { type: 'disabled' };+ targetReasoningEffort = 'minimal';+ } else if (thinking?.type === 'enabled' || reasoning_effort) {+ targetThinking = { type: 'enabled' };+ let effort = reasoning_effort || 'high';+ if (isResponses && effort === 'max') {+ effort = 'high';+ }+ targetReasoningEffort = effort;+ }+ }++ return {+ thinking: targetThinking,+ reasoning_effort: targetReasoningEffort,+ };+};+export const LobeVolcengineAI = createOpenAICompatibleRuntime({baseURL: 'https://ark.cn-beijing.volces.com/api/v3',chatCompletion: {@@ -18,15 +47,20 @@ export const LobeVolcengineAI = createOpenAICompatibleRuntime({...rest,apiMode: 'responses',enabledSearch,- thinking,- reasoning_effort,} as ChatStreamPayload;}+ const params = resolveVolcengineReasoningParams(+ payload.model,+ thinking,+ reasoning_effort,+ false,+ );+return {...rest,- ...(thinking?.type && { thinking: { type: thinking.type } }),- ...(reasoning_effort && { reasoning_effort }),+ ...(params.thinking?.type && { thinking: { type: params.thinking.type } }),+ ...(params.reasoning_effort && { reasoning_effort: params.reasoning_effort }),} as any;},},@@ -41,6 +75,12 @@ export const LobeVolcengineAI = createOpenAICompatibleRuntime({responses: {handlePayload: (payload) => {const { enabledSearch, tools, thinking, reasoning_effort, ...rest } = payload;+ const params = resolveVolcengineReasoningParams(+ payload.model,+ thinking,+ reasoning_effort,+ true,+ );const volcengineTools = enabledSearch? [@@ -57,8 +97,8 @@ export const LobeVolcengineAI = createOpenAICompatibleRuntime({return {...rest,tools: volcengineTools,- ...(thinking?.type && { thinking: { type: thinking.type } }),- ...(reasoning_effort && { reasoning_effort }),+ ...(params.thinking?.type && { thinking: { type: params.thinking.type } }),+ ...(params.reasoning_effort && { reasoning_effort: params.reasoning_effort }),} as any;},},