You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/browser-rendering/stagehand.mdx
+16-2Lines changed: 16 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ import {
14
14
Tabs,
15
15
PackageManagers,
16
16
Details,
17
+
DashButton,
17
18
} from"~/components";
18
19
19
20
[Stagehand](https://www.stagehand.dev/) is an open-source, AI-powered browser automation library. Stagehand lets you combine code with natural-language instructions powered by AI, eliminating the need to dictate exact steps or specify selectors. With Stagehand, your agents are more resilient to website changes and easier to maintain, helping you build more reliably and flexibly.
[AI Gateway](/ai-gateway/) is a service that adds observability to your AI applications. By routing your requests through AI Gateway, you can monitor and debug your AI applications.
189
190
190
-
To use AI Gateway with a third-party model, first create a gateway in the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/ai-gateway). In this example, we've named the gateway `stagehand-example-gateway`.
191
+
To use AI Gateway with a third-party model, first create a gateway in the **AI Gateway** page of the Cloudflare dashboard.
192
+
193
+
<DashButtonurl="/?to=/:account/ai/ai-gateway" />
194
+
195
+
In this example, we've named the gateway `stagehand-example-gateway`.
191
196
192
197
```typescript
193
198
const stagehand =newStagehand({
@@ -228,18 +233,27 @@ const stagehand = new Stagehand({
228
233
229
234
[AI Gateway](/ai-gateway/) is a service that adds observability to your AI applications. By routing your requests through AI Gateway, you can monitor and debug your AI applications.
230
235
231
-
To use AI Gateway, first create a gateway in the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/ai-gateway). In this example, we are using [OpenAI with AI Gateway](https://developers.cloudflare.com/ai-gateway/usage/providers/openai/). Make sure to add the `baseURL` as shown below, with your own Account ID and Gateway ID.
236
+
To use AI Gateway with a third-party model, first create a gateway in the **AI Gateway** page of the Cloudflare dashboard.
237
+
238
+
<DashButtonurl="/?to=/:account/ai/ai-gateway" />
239
+
240
+
In this example, we are using [OpenAI with AI Gateway](/ai-gateway/usage/providers/openai/). Make sure to add the `baseURL` as shown below, with your own Account ID and Gateway ID.
241
+
242
+
You must specify the `apiKey` in the `modelClientOptions`:
If you are using an authenticated AI Gateway, follow the instructions in [AI Gateway authentication](/ai-gateway/configuration/authentication/) and include `cf-aig-authorization` as a header.
257
+
244
258
## Stagehand API
245
259
For the full list of Stagehand methods and capabilities, refer to the official [Stagehand API documentation](https://docs.stagehand.dev/first-steps/introduction).
0 commit comments