Skip to content

Commit 096ebfc

Browse files
committed
fix broken stuff
1 parent 7cb2833 commit 096ebfc

19 files changed

+55
-139
lines changed

src/langgraph-platform/langgraph-basics/1-build-basic-chatbot.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Build a basic chatbot
33
sidebarTitle: 1. Build a basic chatbot
44
---
55

6-
import ChatModelTabs from '/snippets/chat_model_tabs.mdx';
6+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
77

88
In this tutorial, you will build a basic chatbot. This chatbot is the basis for the following series of tutorials where you will progressively add more sophisticated capabilities, and be introduced to key LangGraph concepts along the way. Let’s dive in! 🌟
99

src/langgraph-platform/langgraph-basics/2-add-tools.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Add tools
33
sidebarTitle: 2. Add tools
44
---
55

6-
import ChatModelTabs from '/snippets/chat_model_tabs.mdx';
6+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
77

88
To handle queries that your chatbot can't answer "from memory", integrate a web search tool. The chatbot can use this tool to find relevant information and provide better responses.
99

src/langgraph-platform/langgraph-basics/3-add-memory.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Add memory
33
sidebarTitle: 3. Add memory
44
---
55

6-
import ChatModelTabs from '/snippets/chat_model_tabs.mdx';
6+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
77

88
<Note>
99
This tutorial builds on [Add Tools](/langgraph-platform/langgraph-basics/2-add-tools).

src/langgraph-platform/langgraph-basics/4-human-in-the-loop.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Add human-in-the-loop controls
33
sidebarTitle: 4. Add human-in-the-loop controls
44
---
55

6-
import ChatModelTabs from '/snippets/chat_model_tabs.mdx';
6+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
77

88
<Note>
99
This tutorial builds on [Add Memory](/langgraph-platform/langgraph-basics/3-add-memory).

src/langgraph-platform/langgraph-basics/5-customize-state.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Customize state
33
sidebarTitle: 5. Customize state
44
---
55

6-
import ChatModelTabs from '/snippets/chat_model_tabs.mdx';
6+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
77

88
In this tutorial, you will add additional fields to the state to define complex behavior without relying on the message list. The chatbot will use its search tool to find specific information and forward them to a human for review.
99

src/langgraph-platform/langgraph-basics/6-time-travel.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Time travel
33
sidebarTitle: 6. Time travel
44
---
55

6-
import ChatModelTabs from '/snippets/chat_model_tabs.mdx';
6+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
77

88
In a typical chatbot workflow, the user interacts with the bot one or more times to accomplish a task. [Memory](/langgraph-platform/langgraph-basics/3-add-memory) and a [human-in-the-loop](/langgraph-platform/langgraph-basics/4-human-in-the-loop) enable checkpoints in the graph state and control future responses.
99

src/oss/1-build-basic-chatbot.mdx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: Build a basic chatbot
33
---
4+
5+
import ChatModelTabs from '/snippets/chat-model-tabs.mdx';
6+
47
In this tutorial, you will build a basic chatbot. This chatbot is the basis for the following series of tutorials where you will progressively add more sophisticated capabilities, and be introduced to key LangGraph concepts along the way. Let's dive in! 🌟
58

69
## Prerequisites
@@ -106,17 +109,9 @@ Next, add a "`chatbot`" node. **Nodes** represent units of work and are typicall
106109
Let's first select a chat model:
107110

108111
:::python
109-
{% include-markdown "../../../snippets/chat_model_tabs.md" %}
110-
111-
<!---
112-
113-
```python
114-
from langchain.chat_models import init_chat_model
115112

116-
llm = init_chat_model("anthropic:claude-3-5-sonnet-latest")
117-
```
113+
<ChatModelTabs />
118114

119-
-->
120115
:::
121116

122117
:::js

src/oss/2-add-tools.mdx

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: Add tools
33
---
4+
5+
import chatTabs from '/snippets/chat-model-tabs.mdx';
6+
47
To handle queries that your chatbot can't answer "from memory", integrate a web search tool. The chatbot can use this tool to find relevant information and provide better responses.
58

69
<Note>
@@ -162,17 +165,9 @@ For the `StateGraph` you created in the [first tutorial](/oss/1-build-basic-chat
162165
Let's first select our LLM:
163166

164167
:::python
165-
{% include-markdown "../../../snippets/chat_model_tabs.md" %}
166168

167-
<!---
169+
<chatTabs />
168170

169-
```python
170-
from langchain.chat_models import init_chat_model
171-
172-
llm = init_chat_model("anthropic:claude-3-5-sonnet-latest")
173-
```
174-
175-
-->
176171
:::
177172

178173
:::js
@@ -600,27 +595,8 @@ For ease of use, adjust your code to replace the following with LangGraph prebui
600595
* `BasicToolNode` is replaced with the prebuilt [ToolNode](https://langchain-ai.github.io/langgraph/reference/prebuilt/#toolnode)
601596
* `route_tools` is replaced with the prebuilt [tools_condition](https://langchain-ai.github.io/langgraph/reference/prebuilt/#tools_condition)
602597

603-
{% include-markdown "../../../snippets/chat_model_tabs.md" %}
604-
605-
<!---
606-
607-
```python
608-
from langchain.chat_models import init_chat_model
609-
610-
llm = init_chat_model("anthropic:claude-3-5-sonnet-latest")
611-
```
612-
613-
-->
614-
615-
<!---
616-
617-
```python
618-
from langchain.chat_models import init_chat_model
619-
620-
llm = init_chat_model("anthropic:claude-3-5-sonnet-latest")
621-
```
598+
<chatTabs />
622599

623-
-->
624600

625601
```python hl_lines="25 30"
626602
from typing import Annotated

src/oss/3-add-memory.mdx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: Add memory
33
---
4+
5+
import chatTabs from '/snippets/chat-model-tabs.mdx';
6+
47
The chatbot can now [use tools](/oss/2-add-tools) to answer user questions, but it does not remember the context of previous interactions. This limits its ability to have coherent, multi-turn conversations.
58

69
LangGraph solves this problem through **persistent checkpointing**. If you provide a `checkpointer` when compiling the graph and a `thread_id` when calling your graph, LangGraph automatically saves the state after each step. When you invoke the graph again using the same `thread_id`, the graph loads its saved state, allowing the chatbot to pick up where it left off.
@@ -326,17 +329,7 @@ The snapshot above contains the current state values, corresponding config, and
326329
Check out the code snippet below to review the graph from this tutorial:
327330

328331
:::python
329-
{% include-markdown "../../../snippets/chat_model_tabs.md" %}
330-
331-
<!---
332-
333-
```python
334-
from langchain.chat_models import init_chat_model
335-
336-
llm = init_chat_model("anthropic:claude-3-5-sonnet-latest")
337-
```
338-
339-
-->
332+
<chatTabs />
340333

341334
```python hl_lines="36 37"
342335
from typing import Annotated

src/oss/4-human-in-the-loop.mdx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: Add human-in-the-loop controls
33
---
4+
5+
import chatTabs from '/snippets/chat-model-tabs.mdx';
6+
47
Agents can be unreliable and may need human input to successfully accomplish tasks. Similarly, for some actions, you may want to require human approval before running to ensure that everything is running as intended.
58

69
LangGraph's [persistence](.././persistence) layer supports **human-in-the-loop** workflows, allowing execution to pause and resume based on user feedback. The primary interface to this functionality is the [`interrupt`](.././human_in_the_loop/add-human-in-the-loop) function. Calling `interrupt` inside a node will pause execution. Execution can be resumed, together with new input from a human, by passing in a [Command](.././low_level#command).
@@ -25,17 +28,9 @@ Starting with the existing code from the [Add memory to the chatbot](./3-add-mem
2528
Let's first select a chat model:
2629

2730
:::python
28-
{% include-markdown "../../../snippets/chat_model_tabs.md" %}
29-
30-
<!---
31-
32-
```python
33-
from langchain.chat_models import init_chat_model
3431

35-
llm = init_chat_model("anthropic:claude-3-5-sonnet-latest")
36-
```
32+
<chatTabs />
3733

38-
-->
3934
:::
4035

4136
:::js
@@ -373,11 +368,11 @@ snapshot.next;
373368
}),
374369
},
375370
);
371+
```
376372
377373
Take a closer look at the `humanAssistance` tool:
378374
379-
```
380-
375+
```javascript
381376
const humanAssistance = tool(
382377
async ({ query }) => {
383378
const humanResponse = interrupt({ query });
@@ -391,7 +386,6 @@ snapshot.next;
391386
}),
392387
},
393388
);
394-
395389
```
396390
397391
Calling `interrupt` inside the tool will pause execution. Progress is persisted based on the [checkpointer](.././persistence#checkpointer-libraries); so if it is persisting with Postgres, it can resume at any time as long as the database is alive. In this example, it is persisting with the in-memory checkpointer and can resume any time if the JavaScript runtime is running.
@@ -518,7 +512,7 @@ snapshot.next;
518512
519513
:::python
520514
521-
{% include-markdown "../../../snippets/chat_model_tabs.md" %}
515+
<chatTabs />
522516
523517
```
524518

0 commit comments

Comments
 (0)