mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
Add comment about fetching from the frontend (#439)
This commit is contained in:
@@ -236,7 +236,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import sqlite3\n",
|
||||
"from datetime import date, datetime, timedelta\n",
|
||||
"from datetime import date, datetime\n",
|
||||
"from typing import Optional\n",
|
||||
"\n",
|
||||
"import pytz\n",
|
||||
@@ -904,6 +904,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from langchain_core.runnables import RunnableLambda\n",
|
||||
"from langchain_core.messages import ToolMessage\n",
|
||||
"\n",
|
||||
"from langgraph.prebuilt import ToolNode\n",
|
||||
"\n",
|
||||
@@ -2322,9 +2323,9 @@
|
||||
" _print_event(event, _printed)\n",
|
||||
" snapshot = part_2_graph.get_state(config)\n",
|
||||
" while snapshot.next:\n",
|
||||
" # We have an interrupt! The agent is\n",
|
||||
" # trying to use a tool.\n",
|
||||
" # The user can approve or deny it\n",
|
||||
" # We have an interrupt! The agent is trying to use a tool, and the user can approve or deny it\n",
|
||||
" # Note: This code is all outside of your graph. Typically, you would stream the output to a UI.\n",
|
||||
" # Then, you would have the frontend trigger a new run via an API call when the user has provided input.\n",
|
||||
" user_input = input(\n",
|
||||
" \"Do you approve of the above actions? Type 'y' to continue;\"\n",
|
||||
" \" otherwise, explain your requested changed.\\n\\n\"\n",
|
||||
@@ -2418,7 +2419,6 @@
|
||||
"\n",
|
||||
" def __call__(self, state: State, config: RunnableConfig):\n",
|
||||
" while True:\n",
|
||||
" passenger_id = config.get(\"passenger_id\", None)\n",
|
||||
" result = self.runnable.invoke(state)\n",
|
||||
" # If the LLM happens to return an empty response, we will re-prompt it\n",
|
||||
" # for an actual response.\n",
|
||||
@@ -2514,7 +2514,7 @@
|
||||
"\n",
|
||||
"from langgraph.checkpoint.sqlite import SqliteSaver\n",
|
||||
"from langgraph.graph import END, StateGraph\n",
|
||||
"from langgraph.prebuilt import ToolNode, tools_condition\n",
|
||||
"from langgraph.prebuilt import tools_condition\n",
|
||||
"\n",
|
||||
"builder = StateGraph(State)\n",
|
||||
"\n",
|
||||
@@ -2944,9 +2944,9 @@
|
||||
" _print_event(event, _printed)\n",
|
||||
" snapshot = part_3_graph.get_state(config)\n",
|
||||
" while snapshot.next:\n",
|
||||
" # We have an interrupt! The agent is\n",
|
||||
" # trying to use a tool.\n",
|
||||
" # The user can approve or deny it\n",
|
||||
" # We have an interrupt! The agent is trying to use a tool, and the user can approve or deny it\n",
|
||||
" # Note: This code is all outside of your graph. Typically, you would stream the output to a UI.\n",
|
||||
" # Then, you would have the frontend trigger a new run via an API call when the user has provided input.\n",
|
||||
" user_input = input(\n",
|
||||
" \"Do you approve of the above actions? Type 'y' to continue;\"\n",
|
||||
" \" otherwise, explain your requested changed.\\n\\n\"\n",
|
||||
@@ -4352,9 +4352,9 @@
|
||||
" _print_event(event, _printed)\n",
|
||||
" snapshot = part_4_graph.get_state(config)\n",
|
||||
" while snapshot.next:\n",
|
||||
" # We have an interrupt! The agent is\n",
|
||||
" # trying to use a tool.\n",
|
||||
" # The user can approve or deny it\n",
|
||||
" # We have an interrupt! The agent is trying to use a tool, and the user can approve or deny it\n",
|
||||
" # Note: This code is all outside of your graph. Typically, you would stream the output to a UI.\n",
|
||||
" # Then, you would have the frontend trigger a new run via an API call when the user has provided input.\n",
|
||||
" user_input = input(\n",
|
||||
" \"Do you approve of the above actions? Type 'y' to continue;\"\n",
|
||||
" \" otherwise, explain your requested changed.\\n\\n\"\n",
|
||||
|
||||
Reference in New Issue
Block a user