mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
refactor: use includes() for DeepSeek V3.1 Terminus model check to support variants
This commit is contained in:
parent
ddfccde098
commit
b7bb92f53f
2 changed files with 50 additions and 1 deletions
|
|
@ -62,6 +62,17 @@ vitest.mock("../fetchers/modelCache", () => ({
|
|||
supportsReasoningEffort: true,
|
||||
supportedReasoningEfforts: ["low", "medium", "high"],
|
||||
},
|
||||
"deepseek/deepseek-v3.1-terminus:exacto": {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 128000,
|
||||
supportsImages: false,
|
||||
supportsPromptCache: false,
|
||||
inputPrice: 0.3,
|
||||
outputPrice: 1.2,
|
||||
description: "DeepSeek V3.1 Terminus Exacto",
|
||||
supportsReasoningEffort: true,
|
||||
supportedReasoningEfforts: ["low", "medium", "high"],
|
||||
},
|
||||
})
|
||||
}),
|
||||
}))
|
||||
|
|
@ -480,5 +491,43 @@ describe("OpenRouterHandler", () => {
|
|||
}),
|
||||
)
|
||||
})
|
||||
|
||||
it("should handle DeepSeek V3.1 Terminus exacto variant with chat_template_kwargs", async () => {
|
||||
const handler = new OpenRouterHandler({
|
||||
openRouterApiKey: "test-key",
|
||||
openRouterModelId: "deepseek/deepseek-v3.1-terminus:exacto",
|
||||
reasoningEffort: "medium",
|
||||
})
|
||||
|
||||
const mockStream = {
|
||||
async *[Symbol.asyncIterator]() {
|
||||
yield {
|
||||
id: "test-id",
|
||||
choices: [{ delta: { content: "test response" } }],
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
const mockCreate = vitest.fn().mockResolvedValue(mockStream)
|
||||
;(OpenAI as any).prototype.chat = {
|
||||
completions: { create: mockCreate },
|
||||
} as any
|
||||
|
||||
await handler.createMessage("test", []).next()
|
||||
|
||||
// Should include chat_template_kwargs with thinking:true for exacto variant
|
||||
expect(mockCreate).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
model: "deepseek/deepseek-v3.1-terminus:exacto",
|
||||
chat_template_kwargs: { thinking: true },
|
||||
}),
|
||||
)
|
||||
// Ensure reasoning parameter is NOT included
|
||||
expect(mockCreate).not.toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
reasoning: expect.anything(),
|
||||
}),
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
|
|||
chatTemplateKwargs: { thinking?: boolean } | undefined
|
||||
finalReasoning: OpenRouterReasoningParams | undefined
|
||||
} {
|
||||
if (!modelId.startsWith("deepseek/deepseek-v3.1-terminus")) {
|
||||
if (!modelId.includes("deepseek-v3.1-terminus")) {
|
||||
return { chatTemplateKwargs: undefined, finalReasoning: reasoning }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue