fix: handle undefined follow_up_queries in reflection event
Add optional chaining and fallback value to prevent TypeError when event.reflection.follow_up_queries is undefined in onUpdateEvent handler.
This commit is contained in:
@@ -54,9 +54,9 @@ export default function App() {
|
|||||||
title: "Reflection",
|
title: "Reflection",
|
||||||
data: event.reflection.is_sufficient
|
data: event.reflection.is_sufficient
|
||||||
? "Search successful, generating final answer."
|
? "Search successful, generating final answer."
|
||||||
: `Need more information, searching for ${event.reflection.follow_up_queries.join(
|
: `Need more information, searching for ${event.reflection.follow_up_queries?.join(
|
||||||
", "
|
", "
|
||||||
)}`,
|
) || "additional information"}`,
|
||||||
};
|
};
|
||||||
} else if (event.finalize_answer) {
|
} else if (event.finalize_answer) {
|
||||||
processedEvent = {
|
processedEvent = {
|
||||||
|
|||||||
Reference in New Issue
Block a user