update sync for executive dashboard ai insight
This commit is contained in:
1 parent
3fdd9b936f
commit
3f5db48b16
2 files changed
+21
-10
No files matched your search
@@ -603,13 +603,15 @@ export const PageAiInsight: React.FC<PageAiInsightProps> = ({
|
||||
}
|
||||
|
||||
const text = apiResult.insight_text ?? '';
|
||||
const parsed =
|
||||
apiResult.summary || apiResult.insight
|
||||
? {
|
||||
summary: apiResult.summary || '',
|
||||
insight: apiResult.insight || '',
|
||||
}
|
||||
: parseAiResult(text);
|
||||
let parsed: { summary: string; insight: string } | null = null;
|
||||
if (apiResult.summary || apiResult.insight) {
|
||||
parsed = {
|
||||
summary: apiResult.summary || '',
|
||||
insight: apiResult.insight || apiResult.insight_text || '',
|
||||
};
|
||||
} else {
|
||||
parsed = parseAiResult(text);
|
||||
}
|
||||
|
||||
if (!parsed || (!parsed.summary && !parsed.insight)) {
|
||||
throw new Error('Respons AI tidak dapat diproses.');
|
||||
|
||||
Reference in new issue
Block a user