From 7423a25fd6a8aafedd3a8173deb01e3d9c9cc644 Mon Sep 17 00:00:00 2001 From: eoao Date: Sun, 10 May 2026 00:48:31 +0800 Subject: [PATCH] feat: update verification code recognition to 8 digits --- mail-worker/src/service/ai-service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mail-worker/src/service/ai-service.js b/mail-worker/src/service/ai-service.js index c9a5e68..c658100 100644 --- a/mail-worker/src/service/ai-service.js +++ b/mail-worker/src/service/ai-service.js @@ -22,7 +22,7 @@ const aiService = { messages: [ { role: 'system', - content: 'You extract verification codes from emails. Return only JSON like {"code":"123456"} or {"code":""}. The code must be 6 characters or fewer and must not contain spaces. If the code is longer than 6 characters or contains spaces, return {"code":""}. Do not explain.' + content: 'You extract verification codes from emails. Return only JSON like {"code":"12345678"} or {"code":""}. The code must be 8 characters or fewer and must not contain spaces. If the code is longer than 8 characters or contains spaces, return {"code":""}. Do not explain.' }, { role: 'user', @@ -39,7 +39,7 @@ const aiService = { return ''; } - if (json.code.length > 6 || /\s/.test(json.code)) { + if (json.code.length > 8 || /\s/.test(json.code)) { return ''; }