From baa15581ed26f03792d2eb3117421bd2e068356e Mon Sep 17 00:00:00 2001 From: IndieKKY Date: Mon, 27 May 2024 11:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/biz_util.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/util/biz_util.ts b/src/util/biz_util.ts index 295547d..0d287b3 100644 --- a/src/util/biz_util.ts +++ b/src/util/biz_util.ts @@ -88,6 +88,9 @@ export const isSummaryEmpty = (summary: Summary) => { } else if (summary.type === 'brief') { const content: string[] = summary.content??'' return content.length === 0 + } else if (summary.type === 'question') { + const content: any[] = summary.content??[] + return content.length === 0 } return true } @@ -109,6 +112,11 @@ export const getSummaryStr = (summary: Summary) => { summary: '' } s += content.summary + '\n' + } else if (summary.type === 'question') { + const content: Array<{ q: string, a: string }> = summary.content ?? [] + s += content.map(item => { + return item.q + '\n' + item.a + '\n' + }).join('\n') } return s }