Skip to content

Commit 50ca0e7

Browse files
committed
Refactor wrapper functions in multiagent supervisor notebook
Moved the definition of summary_wrapper to group related wrappers together and removed its duplicate definition. This improves code organization and prevents redundancy in the notebook.
1 parent c03e16f commit 50ca0e7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ch8/yelp-navigator/langgraph_multiagent_supervisor.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@
268268
},
269269
{
270270
"cell_type": "code",
271-
"execution_count": 12,
271+
"execution_count": null,
272272
"id": "f39b8912",
273273
"metadata": {},
274274
"outputs": [],
@@ -284,7 +284,11 @@
284284
"\n",
285285
"def supervisor_approval_wrapper(state: AgentState) -> AgentState:\n",
286286
" \"\"\"Reviews summary quality and decides if revision is needed.\"\"\"\n",
287-
" return supervisor_approval_node(state, llm)"
287+
" return supervisor_approval_node(state, llm)\n",
288+
"\n",
289+
"def summary_wrapper(state: AgentState) -> AgentState:\n",
290+
" \"\"\"Synthesizes all information into a user-friendly response.\"\"\"\n",
291+
" return summary_node(state, llm)"
288292
]
289293
},
290294
{
@@ -302,7 +306,7 @@
302306
},
303307
{
304308
"cell_type": "code",
305-
"execution_count": 13,
309+
"execution_count": null,
306310
"id": "eecfdc78",
307311
"metadata": {},
308312
"outputs": [],
@@ -319,11 +323,7 @@
319323
"\n",
320324
"def sentiment_wrapper(state: AgentState) -> AgentState:\n",
321325
" \"\"\"Analyzes review sentiment via Hayhooks sentiment pipeline.\"\"\"\n",
322-
" return sentiment_node(state, analyze_reviews_sentiment)\n",
323-
"\n",
324-
"def summary_wrapper(state: AgentState) -> AgentState:\n",
325-
" \"\"\"Synthesizes all information into a user-friendly response.\"\"\"\n",
326-
" return summary_node(state, llm)"
326+
" return sentiment_node(state, analyze_reviews_sentiment)"
327327
]
328328
},
329329
{

0 commit comments

Comments
 (0)