mirror of
https://github.com/google-gemini/gemini-fullstack-langgraph-quickstart.git
synced 2025-08-08 00:41:45 +03:00
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",
|
||||
data: event.reflection.is_sufficient
|
||||
? "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) {
|
||||
processedEvent = {
|
||||
|
||||
Reference in New Issue
Block a user