mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
fix: enhance error handling in evaluateAnswer
This commit is contained in:
@@ -653,12 +653,17 @@ export async function evaluateAnswer(
|
|||||||
logError(`Unknown evaluation type: ${evaluationType}`);
|
logError(`Unknown evaluation type: ${evaluationType}`);
|
||||||
}
|
}
|
||||||
if (prompt) {
|
if (prompt) {
|
||||||
result = await performEvaluation(
|
try {
|
||||||
evaluationType,
|
result = await performEvaluation(
|
||||||
prompt,
|
evaluationType,
|
||||||
trackers,
|
prompt,
|
||||||
schemaGen
|
trackers,
|
||||||
);
|
schemaGen
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
logError(`Error performing ${evaluationType} evaluation`, { error });
|
||||||
|
return { pass: false, think: `Error ${evaluationType} immedidately return false, probably due to bad prompt?`, type: evaluationType } as EvaluationResponse
|
||||||
|
}
|
||||||
|
|
||||||
// fail one, return immediately
|
// fail one, return immediately
|
||||||
if (!(result?.object as EvaluationResponse)?.pass) {
|
if (!(result?.object as EvaluationResponse)?.pass) {
|
||||||
|
|||||||
Reference in New Issue
Block a user