diff --git a/Makefile b/Makefile index e779fc3ac..fb74512f1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all clean docs_build docs_clean docs_linkcheck api_docs_build api_docs_clean api_docs_linkcheck format lint test tests test_watch integration_tests docker_tests help extended_tests coverage spell_check spell_fix build-docs serve-docs +.PHONY: all clean format lint test tests test_watch integration_tests docker_tests help extended_tests coverage spell_check spell_fix build-docs serve-docs serve-clean-docs clean-docs # Default target executed when no arguments are given to make. all: help @@ -53,8 +53,18 @@ build-docs: poetry run python docs/_scripts/copy_notebooks.py poetry run mkdocs build --clean -f docs/mkdocs.yml --strict -serve-docs: build-docs - poetry run mkdocs serve -f docs/mkdocs.yml +serve-clean-docs: clean-docs + poetry run python docs/_scripts/copy_notebooks.py + poetry run python -m mkdocs serve -c -f mkdocs.yml --strict -w ./langgraph + +serve-docs: + poetry run python docs/_scripts/copy_notebooks.py + poetry run python -m mkdocs serve -f docs/mkdocs.yml -w ./langgraph --dirty + +clean-docs: + find ./docs/docs -name "*.ipynb" -type f -delete + rm -rf docs/site + ###################### # HELP @@ -63,13 +73,7 @@ serve-docs: build-docs help: @echo '====================' @echo '-- DOCUMENTATION --' - @echo 'clean - run docs_clean and api_docs_clean' - @echo 'docs_build - build the documentation' - @echo 'docs_clean - clean the documentation build artifacts' - @echo 'docs_linkcheck - run linkchecker on the documentation' - @echo 'api_docs_build - build the API Reference documentation' - @echo 'api_docs_clean - clean the API Reference documentation build artifacts' - @echo 'api_docs_linkcheck - run linkchecker on the API Reference documentation' + @echo '-- LINTING --' @echo 'format - run code formatters' @echo 'lint - run linters' diff --git a/docs/_scripts/copy_notebooks.py b/docs/_scripts/copy_notebooks.py index 021afcec3..51b5e1eb7 100644 --- a/docs/_scripts/copy_notebooks.py +++ b/docs/_scripts/copy_notebooks.py @@ -19,7 +19,6 @@ _MANUAL = { "visualization.ipynb", "state-model.ipynb", "subgraph.ipynb", - "persistence_postgres.ipynb", "force-calling-a-tool-first.ipynb", "dynamic-returning-direct.ipynb", "managing-agent-steps.ipynb", diff --git a/examples/async.ipynb b/examples/async.ipynb index 4e94cb217..147ffdb68 100644 --- a/examples/async.ipynb +++ b/examples/async.ipynb @@ -10,7 +10,15 @@ "In this example we will build a ReAct agent with native [async](https://docs.python.org/3/library/asyncio.html) implementations of the core logic. When Chat Models have async clients, this can give us some nice performance improvements if you\n", "are running concurrent branches in your graph or if your graph is running within a larger web server process.\n", "\n", - "In general, you don't need to change anything about your graph to add `async` support. That's one of the beauties of [Runnables](https://python.langchain.com/docs/expression_language/interface/). " + "In general, you don't need to change anything about your graph to add `async` support. That's one of the beauties of [Runnables](https://python.langchain.com/docs/expression_language/interface/). \n", + "\n", + "\n", + "
\n", + "

Note:

\n", + "

\n", + " In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using the create_react_agent(model, tools=tool) (API doc) constructor. This may be more appropriate if you are used to LangChain’s AgentExecutor class.\n", + "

\n", + "
" ] }, { diff --git a/examples/chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb b/examples/chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb index 1d1bc8316..172aecd75 100644 --- a/examples/chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb +++ b/examples/chat_agent_executor_with_function_calling/dynamically-returning-directly.ipynb @@ -11,7 +11,15 @@ "\n", "This examples builds off the base chat executor. It is highly recommended you learn about that executor before going through this notebook. You can find documentation for that example [here](./base.ipynb).\n", "\n", - "Any modifications of that example are called below with **MODIFICATION**, so if you are looking for the differences you can just search for that." + "Any modifications of that example are called below with **MODIFICATION**, so if you are looking for the differences you can just search for that.\n", + "\n", + "\n", + "
\n", + "

Note

\n", + "

\n", + " In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using the create_react_agent(model, tools=tool, interrupt_before=[\"agent\" | \"tools\"], interrupt_after=[\"agent\" | \"tools\"], checkpointer=checkpointer) (API doc) constructor. This may be more appropriate if you are used to LangChain’s AgentExecutor class.\n", + "

\n", + "
" ] }, { diff --git a/examples/human-in-the-loop.ipynb b/examples/human-in-the-loop.ipynb index e31ac89b3..36006d2e5 100644 --- a/examples/human-in-the-loop.ipynb +++ b/examples/human-in-the-loop.ipynb @@ -13,7 +13,14 @@ "\n", "This can be in several ways, but the primary supported way is to add an \"interrupt\" before a node is executed.\n", "This interrupts execution at that node.\n", - "You can then resume from that spot to continue." + "You can then resume from that spot to continue.\n", + "\n", + "
\n", + "

Note

\n", + "

\n", + " In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using either `interrupt_before` or `interrupt_after` in the create_react_agent(model, tools=tool, interrupt_before=[\"tools\" | \"agent\"], interrupt_after=[\"tools\" | \"agent\"]) (API doc) constructor. This may be more appropriate if you are used to LangChain’s AgentExecutor class.\n", + "

\n", + "
" ] }, { diff --git a/examples/persistence.ipynb b/examples/persistence.ipynb index be5735c36..37edf6afb 100644 --- a/examples/persistence.ipynb +++ b/examples/persistence.ipynb @@ -28,7 +28,14 @@ "\n", "This works for [StateGraph](https://langchain-ai.github.io/langgraph/reference/graphs/#langgraph.graph.StateGraph) and all its subclasses, such as [MessageGraph](https://langchain-ai.github.io/langgraph/reference/graphs/#messagegraph).\n", "\n", - "Below is an example." + "Below is an example.\n", + "\n", + "
\n", + "

Note

\n", + "

\n", + " In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using the create_react_agent(model, tools=tool, checkpointer=checkpointer) (API doc) constructor. This may be more appropriate if you are used to LangChain’s AgentExecutor class.\n", + "

\n", + "
" ] }, { diff --git a/examples/streaming-tokens.ipynb b/examples/streaming-tokens.ipynb index d02ee3ff9..232cc5e12 100644 --- a/examples/streaming-tokens.ipynb +++ b/examples/streaming-tokens.ipynb @@ -9,7 +9,14 @@ "\n", "In this example we will stream tokens from the language model powering an agent. We will use a ReAct agent as an example. The main thing to bear in mind here is that using [async nodes](./async.ipynb) typically offers the best behavior for this, since we will be using the `async_log` method.\n", "\n", - "This how-to guide closely follows the others in this directory, so we will call out differences with the **STREAMING** tag below (if you just want to search for those)." + "This how-to guide closely follows the others in this directory, so we will call out differences with the **STREAMING** tag below (if you just want to search for those).\n", + "\n", + "
\n", + "

Note

\n", + "

\n", + " In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using the create_react_agent(model, tools=tool) (API doc) constructor. This may be more appropriate if you are used to LangChain’s AgentExecutor class.\n", + "

\n", + "
" ] }, { diff --git a/examples/time-travel.ipynb b/examples/time-travel.ipynb index eeaf8176d..4cc6a70c6 100644 --- a/examples/time-travel.ipynb +++ b/examples/time-travel.ipynb @@ -20,7 +20,14 @@ "\n", "**Note:** this requires passing in a checkpointer.\n", "\n", - "Below is a quick example." + "Below is a quick example.\n", + "\n", + "
\n", + "

Note:

\n", + "

\n", + " In this how-to, we will create our agent from scratch to be transparent (but verbose). You can accomplish similar functionality using the create_react_agent(model, tools=tool, checkpointer=checkpointer) (API doc) constructor. This may be more appropriate if you are used to LangChain’s AgentExecutor class.\n", + "

\n", + "
" ] }, {