Skip to content

Commit 7fef10f

Browse files
Documentation edits made through Mintlify web editor (#776)
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
1 parent 58b06eb commit 7fef10f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/integrations/langchain.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: 'Langchain JS'
3-
description: 'Integrate Stagehand with Langchain JS'
4-
icon: 'brain-circuit'
2+
title: "Langchain JS"
3+
description: "Integrate Stagehand with Langchain JS"
4+
icon: "brain-circuit"
55
---
66

77
Stagehand can be integrated into Langchain JS by wrapping Stagehand's browser automation functionality with the `StagehandToolkit`.
88

9-
This toolkit provides specialized tools such as `navigate`, `act`, `extract`, and `observe`, all powered by Stagehand's underlying capabilities.
9+
This toolkit provides specialized tools such as `navigate`, `act`, `extract`, and `observe`, all powered by Stagehand's underlying capabilities.
1010

1111
For more details on this integration and how to work with Langchain, see the [official Langchain documentation](https://js.langchain.com/docs/integrations/tools/stagehand/).
1212

@@ -24,23 +24,24 @@ npm install @langchain/langgraph @langchain/community @langchain/core @browserba
2424

2525
```typescript
2626
const stagehand = new Stagehand({
27-
env: "LOCAL",
28-
verbose: 2,
29-
enableCaching: false,
27+
env: "LOCAL",
28+
verbose: 2,
29+
enableCaching: false,
3030
});
3131
```
32-
32+
3333
## Generate a Stagehand Toolkit object
3434

3535
```typescript
3636
const stagehandToolkit = await StagehandToolkit.fromStagehand(stagehand);
3737
```
3838

3939
## Use the tools
40-
* `stagehand_navigate`: Navigate to a specific URL.
41-
* `stagehand_act`: Perform browser automation tasks like clicking buttons and typing in fields.
42-
* `stagehand_extract`: Extract structured data from pages using Zod schemas.
43-
* `stagehand_observe`: Investigate the DOM for possible actions or relevant elements.
40+
41+
- `stagehand_navigate`: Navigate to a specific URL.
42+
- `stagehand_act`: Perform browser automation tasks like clicking buttons and typing in fields.
43+
- `stagehand_extract`: Extract structured data from pages using Zod schemas.
44+
- `stagehand_observe`: Investigate the DOM for possible actions or relevant elements.
4445

4546
Example standalone usage:
4647

@@ -72,7 +73,6 @@ const currentUrl = stagehand.page.url();
7273
// e.g., ensure it contains "google.com/search"
7374
```
7475

75-
7676
## Remote Browsers (Browserbase)
7777

7878
Instead of env: "LOCAL", specify env: "BROWSERBASE" and pass in your Browserbase credentials through environment variables:
@@ -88,4 +88,4 @@ With the `StagehandToolkit`, you can quickly integrate natural-language-driven b
8888
- Automating login flows
8989
- Navigating or clicking through forms based on instructions from a larger chain of agents
9090

91-
Consult Stagehand’s and Langchain’s official references for troubleshooting and advanced integrations or reach out to us on [Slack](https://stagehand.dev/slack).
91+
Consult Stagehand’s and Langchain’s official references for troubleshooting and advanced integrations or reach out to us on [Slack](https://stagehand.dev/slack).

0 commit comments

Comments
 (0)