fix: make deepseek string check a bit looser (#25012)
This commit is contained in:
@@ -197,7 +197,7 @@ function normalizeMessages(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Deepseek requires all assistant messages to have reasoning on them
|
// Deepseek requires all assistant messages to have reasoning on them
|
||||||
if (model.api.id.includes("deepseek")) {
|
if (model.api.id.toLowerCase().includes("deepseek")) {
|
||||||
msgs = msgs.map((msg) => {
|
msgs = msgs.map((msg) => {
|
||||||
if (msg.role !== "assistant") return msg
|
if (msg.role !== "assistant") return msg
|
||||||
if (Array.isArray(msg.content)) {
|
if (Array.isArray(msg.content)) {
|
||||||
@@ -573,7 +573,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
|||||||
// https://docs.venice.ai/overview/guides/reasoning-models#reasoning-effort
|
// https://docs.venice.ai/overview/guides/reasoning-models#reasoning-effort
|
||||||
case "@ai-sdk/openai-compatible":
|
case "@ai-sdk/openai-compatible":
|
||||||
const efforts = [...WIDELY_SUPPORTED_EFFORTS]
|
const efforts = [...WIDELY_SUPPORTED_EFFORTS]
|
||||||
if (model.api.id.includes("deepseek-v4")) {
|
if (model.api.id.toLowerCase().includes("deepseek-v4")) {
|
||||||
efforts.push("max")
|
efforts.push("max")
|
||||||
}
|
}
|
||||||
return Object.fromEntries(efforts.map((effort) => [effort, { reasoningEffort: effort }]))
|
return Object.fromEntries(efforts.map((effort) => [effort, { reasoningEffort: effort }]))
|
||||||
|
|||||||
Reference in New Issue
Block a user