QA Recall:
- {qaResult.map((item, index) => (
-
-
- Score:
- {item.scores.toFixed(2)}
-
-
-
Question:
-
{item.question}
-
-
-
Explanation:
-
{item.explanation}
-
-
-
Answer:
-
{item.answer}
-
-
- ))}
+ {qaResult && qaResult.length
+ ? qaResult.map((item, index) => (
+
+
+ Score:
+ {item.scores.toFixed(2)}
+
+
+
Question:
+
{item.question}
+
+
+
Explanation:
+
{item.explanation}
+
+
+
Answer:
+
{`${item.answer}`}
+
+
+ ))
+ : null}
KeyPath Recall:
- {keyPathResult.map((item, index) => (
-
-
- Score:
- {item.scores.toFixed(2)}
-
-
-
content:
-
{item.text}
-
- {ragOption.type === 'qa' && (
-
-
Answer:
-
{item.answer}
-
- )}
-
-
- ))}
+ {keyPathResult && keyPathResult.length
+ ? keyPathResult.map((item, index) => (
+
+
+ Score:
+ {item.scores.toFixed(2)}
+
+
+
content:
+
{item.text}
+
+ {ragOption.type === 'qa' ? (
+
+
Answer:
+
{`${item.answer}`}
+
+ ) : null}
+
+
+ ))
+ : null}