mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
Finalize ntbk
This commit is contained in:
@@ -243,7 +243,7 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"The design of generative agents combines LLM with memory, planning, and reflection mechanisms to enable agents to behave conditioned on past experience and interact with other agents. Memory stream is a long-term memory module that records agents' experiences in natural language. The retrieval model surfaces context to inform the agent's behavior based on relevance, recency, and importance.\n"
|
||||
"The agent's memory module is a long-term memory database that records the agent's experiences in natural language. It includes observations and events provided by the agent, which can trigger new natural language statements. The memory module is used in conjunction with other mechanisms like planning, reflection, and retrieval to inform the agent's behavior.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -406,7 +406,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 10,
|
||||
"id": "01d829bb-1074-4976-b650-ead41dcb9788",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -414,7 +414,7 @@
|
||||
"### Search\n",
|
||||
"\n",
|
||||
"from langchain_community.tools.tavily_search import TavilySearchResults\n",
|
||||
"web_search_tool = TavilySearchResults()"
|
||||
"web_search_tool = TavilySearchResults(k=3)"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -431,7 +431,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"execution_count": 11,
|
||||
"id": "e723fcdb-06e6-402d-912e-899795b78408",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -463,7 +463,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 11,
|
||||
"execution_count": 12,
|
||||
"id": "b76b5ec3-0720-443d-85b1-c0e79659ca0a",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -668,12 +668,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 12,
|
||||
"execution_count": 13,
|
||||
"id": "67854e07-9293-4c3c-bf9a-bc9a605570ee",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pprint\n",
|
||||
"from pprint import pprint\n",
|
||||
"\n",
|
||||
"from langgraph.graph import END, StateGraph\n",
|
||||
"\n",
|
||||
@@ -756,13 +756,13 @@
|
||||
"for output in app.stream(inputs):\n",
|
||||
" for key, value in output.items():\n",
|
||||
" # Node\n",
|
||||
" pprint.pprint(f\"Node '{key}':\")\n",
|
||||
" pprint(f\"Node '{key}':\")\n",
|
||||
" # Optional: print full state at each node\n",
|
||||
" # pprint.pprint(value[\"keys\"], indent=2, width=80, depth=None)\n",
|
||||
" pprint.pprint(\"\\n---\\n\")\n",
|
||||
" pprint(\"\\n---\\n\")\n",
|
||||
"\n",
|
||||
"# Final generation\n",
|
||||
"pprint.pprint(value[\"generation\"])"
|
||||
"pprint(value[\"generation\"])"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -824,13 +824,13 @@
|
||||
"for output in app.stream(inputs):\n",
|
||||
" for key, value in output.items():\n",
|
||||
" # Node\n",
|
||||
" pprint.pprint(f\"Node '{key}':\")\n",
|
||||
" pprint(f\"Node '{key}':\")\n",
|
||||
" # Optional: print full state at each node\n",
|
||||
" # pprint.pprint(value[\"keys\"], indent=2, width=80, depth=None)\n",
|
||||
" pprint.pprint(\"\\n---\\n\")\n",
|
||||
" pprint(\"\\n---\\n\")\n",
|
||||
"\n",
|
||||
"# Final generation\n",
|
||||
"pprint.pprint(value [\"generation\"])"
|
||||
"pprint(value [\"generation\"])"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user