Skip to content

Commit

Permalink
docs: clean up how-to docs to make them runnable (#1666)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbarda authored Sep 10, 2024
1 parent 215b872 commit ed0f55a
Show file tree
Hide file tree
Showing 25 changed files with 1,239 additions and 1,243 deletions.
915 changes: 459 additions & 456 deletions examples/human_in_the_loop/breakpoints.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/human_in_the_loop/dynamic_breakpoints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
1,253 changes: 627 additions & 626 deletions examples/human_in_the_loop/wait-user-input.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/map-reduce.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/memory/delete-messages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/pass-config-to-tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
14 changes: 9 additions & 5 deletions examples/pass-run-time-values-to-tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@
"import getpass\n",
"import os\n",
"\n",
"os.environ[\"OPENAI_API_KEY\"] = os.environ.get(\"OPENAI_API_KEY\") or getpass.getpass(\n",
" \"OpenAI API Key:\"\n",
")"
"\n",
"def _set_env(var: str):\n",
" if not os.environ.get(var):\n",
" os.environ[var] = getpass.getpass(f\"{var}: \")\n",
"\n",
"\n",
"_set_env(\"OPENAI_API_KEY\")"
]
},
{
Expand Down Expand Up @@ -524,9 +528,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "poetry-venv-311",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "poetry-venv-311"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/persistence_mongodb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/persistence_postgres.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/persistence_redis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1000,9 +1000,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
81 changes: 32 additions & 49 deletions examples/state-model.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/stream-multiple.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"outputs": [],
"source": [
"%%capture --no-stderr\n",
"%pip install -U langgraph langchain-openai"
"%pip install -U langgraph langchain-openai langchain-community"
]
},
{
Expand Down Expand Up @@ -188,9 +188,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -202,7 +202,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions examples/stream-updates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"outputs": [],
"source": [
"%%capture --no-stderr\n",
"%pip install -U langgraph langchain-openai"
"%pip install -U langgraph langchain-openai langchain-community"
]
},
{
Expand Down Expand Up @@ -164,9 +164,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -178,7 +178,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
8 changes: 4 additions & 4 deletions examples/stream-values.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"outputs": [],
"source": [
"%%capture --no-stderr\n",
"%pip install -U langgraph langchain-openai"
"%pip install -U langgraph langchain-openai langchain-community"
]
},
{
Expand Down Expand Up @@ -226,9 +226,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -240,7 +240,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/streaming-content.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
6 changes: 3 additions & 3 deletions examples/streaming-events-from-within-tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -294,7 +294,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions examples/streaming-from-final-node.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"outputs": [],
"source": [
"%%capture --no-stderr\n",
"%pip install -U langgraph langchain-openai"
"%pip install -U langgraph langchain-openai langchain-community"
]
},
{
Expand Down Expand Up @@ -317,9 +317,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/streaming-tokens-without-langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
2 changes: 1 addition & 1 deletion examples/streaming-tokens.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.2"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions examples/subgraph-transform-state.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/subgraph.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/tool-calling-errors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
4 changes: 2 additions & 2 deletions examples/tool-calling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "langgraph",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "langgraph"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
Loading

0 comments on commit ed0f55a

Please sign in to comment.