fix: rename deepseek model from deepseek-chat to deepseek-v4-pro

DeepSeek API deprecated deepseek-chat model. Returns error:
'the supported API model names are deepseek-v4-pro or deepseek-v4-flash'

Affected all 4 AI endpoints:
- risk-flags (90-day dashboard)
- triage-suggest
- rca-draft
- quality-check

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-26 10:17:26 +08:00
co-authored by Claude
parent 6a2551546d
commit 7bf3b6a409
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -109,7 +109,7 @@ export async function POST() {
let res: Awaited<ReturnType<typeof client.chat.completions.create>>
try {
res = await client.chat.completions.create({
model: 'deepseek-chat',
model: 'deepseek-v4-pro',
max_tokens: 2048,
tools: [{
type: 'function',
@@ -178,7 +178,7 @@ ${JSON.stringify(aggregates, null, 2)}
await withUser(session.sub, async tx =>
writeAuditLog(tx, 'incidents', session.sub, 'ai_risk_flags',
{ flags, summary: input.summary, model: 'deepseek-chat' })
{ flags, summary: input.summary, model: 'deepseek-v4-pro' })
)
return NextResponse.json({ flags, summary: input.summary })
+2 -2
View File
@@ -59,7 +59,7 @@ export async function POST(
let res: Awaited<ReturnType<typeof client.chat.completions.create>>
try {
res = await client.chat.completions.create({
model: 'deepseek-chat',
model: 'deepseek-v4-pro',
max_tokens: 2048,
tools: [{
type: 'function',
@@ -135,7 +135,7 @@ Provide 35 Why steps drilling from immediate cause to root cause. Give a one-
await withUser(session.sub, async tx => {
await writeAuditLog(tx, 'incidents', id, 'ai_rca_draft', {
root_cause_summary: draft.root_cause_summary as string,
model: 'deepseek-chat',
model: 'deepseek-v4-pro',
})
})
@@ -50,7 +50,7 @@ export async function POST(
let res: Awaited<ReturnType<typeof client.chat.completions.create>>
try {
res = await client.chat.completions.create({
model: 'deepseek-chat',
model: 'deepseek-v4-pro',
max_tokens: 1024,
tools: [{
type: 'function',
@@ -118,7 +118,7 @@ Suggest severity (15) and tick the appropriate NADOPOD 2004 flags. Give a one
}
await withUser(session.sub, async tx => {
await writeAuditLog(tx, 'incidents', id, 'ai_triage_suggest', { suggestion: input, model: 'deepseek-chat' })
await writeAuditLog(tx, 'incidents', id, 'ai_triage_suggest', { suggestion: input, model: 'deepseek-v4-pro' })
})
return NextResponse.json(input)
+2 -2
View File
@@ -42,7 +42,7 @@ export async function POST(request: NextRequest) {
let res: Awaited<ReturnType<typeof client.chat.completions.create>>
try {
res = await client.chat.completions.create({
model: 'deepseek-chat',
model: 'deepseek-v4-pro',
max_tokens: 1024,
tools: [{
type: 'function',
@@ -99,7 +99,7 @@ Score 110 based on: specificity (location, time, persons involved), completen
// audit write uses session.sub as a pseudo record-id (no incident_id at this stage)
await withUser(session.sub, async tx => {
await writeAuditLog(tx, 'incidents', session.sub, 'ai_quality_check', {
score: input.score, passes: input.passes, model: 'deepseek-chat',
score: input.score, passes: input.passes, model: 'deepseek-v4-pro',
})
})