Update server.js via upload script - 2026-09-09 17:19:12
This commit is contained in:
parent
86cf280c9a
commit
3c1c72ac39
|
|
@ -650,7 +650,7 @@ app.post('/api/ai/parse-catalog', requireAuth, aiLimiter, (req, res) => {
|
||||||
const content = await callDeepSeekWithRetry(cfg.apiKey, [
|
const content = await callDeepSeekWithRetry(cfg.apiKey, [
|
||||||
{ role: 'system', content: CATALOG_PARSE_SYSTEM_PROMPT },
|
{ role: 'system', content: CATALOG_PARSE_SYSTEM_PROMPT },
|
||||||
{ role: 'user', content: userContent },
|
{ role: 'user', content: userContent },
|
||||||
], { maxTokens: 16000, temperature: 0.2 });
|
], { maxTokens: 64000, temperature: 0.2 });
|
||||||
const { data: products, truncated } = extractJson(content);
|
const { data: products, truncated } = extractJson(content);
|
||||||
if (!Array.isArray(products)) throw new Error('AI没有返回预期的数组格式,请重试');
|
if (!Array.isArray(products)) throw new Error('AI没有返回预期的数组格式,请重试');
|
||||||
// 双保险:即使AI没完全听话,这里直接强制覆盖,保证和用户预选的一致
|
// 双保险:即使AI没完全听话,这里直接强制覆盖,保证和用户预选的一致
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue