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
[docs] add aisdk workaround before npm release + add versions to work with LanguageModelV1 + LiteLLM works for python (#1086)
# why
1. aisdk not yet available through npm package
2. customLLM provider only works with LanguageModelV1
3. LiteLLM compatible providers are supported in python
# what changed
1. change docs to install stagehand from git repo
2. pin versions that use LanguageModelV1
# test plan
local test
Copy file name to clipboardExpand all lines: docs/configuration/models.mdx
+32-9Lines changed: 32 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,46 +156,69 @@ stagehand = Stagehand(
156
156
## Custom LLM Integration
157
157
158
158
<Note>
159
-
Custom LLMs are currently only supported in TypeScript.
159
+
Only [LiteLLM compatible providers](https://docs.litellm.ai/docs/providers) are available in Python. Some may require extra setup.
160
160
</Note>
161
161
162
162
Integrate any LLM with Stagehand using custom clients. The only requirement is **structured output support** for consistent automation behavior.
163
163
164
164
### Vercel AI SDK
165
165
The [Vercel AI SDK](https://sdk.vercel.ai/providers/ai-sdk-providers) is a popular library for interacting with LLMs. You can use any of the providers supported by the Vercel AI SDK to create a client for your model, **as long as they support structured outputs**.
166
166
167
-
Vercel AI SDK supports providers for OpenAI, Anthropic, and Google, along with support for **Amazon Bedrock** and **Azure OpenAI**.
167
+
Vercel AI SDK supports providers for OpenAI, Anthropic, and Google, along with support for **Amazon Bedrock** and **Azure OpenAI**. For a full list, see the [Vercel AI SDK providers page](https://sdk.vercel.ai/providers/ai-sdk-providers).
168
168
169
-
To get started, you'll need to install the `ai` package and the provider you want to use. For example, to use Amazon Bedrock, you'll need to install the `@ai-sdk/amazon-bedrock` package.
169
+
To get started, you'll need to install the `ai` package (version 4) and the provider you want to use (version 1 - both need to be compatible with LanguageModelV1). For example, to use Amazon Bedrock, you'll need to install the `@ai-sdk/amazon-bedrock` package.
170
170
171
-
You'll also need to import the [Vercel AI SDK external client](https://github.com/browserbase/stagehand/blob/main/lib/llm/aisdk.ts)which is exposed as `AISdkClient` to create a client for your model.
171
+
You'll also need to import the [Vercel AI SDK external client](https://github.com/browserbase/stagehand/blob/main/lib/llm/aisdk.ts)through Stagehand to create a client for your model.
172
172
173
173
<Tabs>
174
174
<Tabtitle="npm">
175
175
```bash
176
-
npm install ai @ai-sdk/amazon-bedrock
176
+
npm install ai@4 @ai-sdk/amazon-bedrock@1
177
177
```
178
178
</Tab>
179
179
180
180
<Tabtitle="pnpm">
181
181
```bash
182
-
pnpm install ai @ai-sdk/amazon-bedrock
182
+
pnpm install ai@4 @ai-sdk/amazon-bedrock@1
183
183
```
184
184
</Tab>
185
185
186
186
<Tabtitle="yarn">
187
187
```bash
188
-
yarn add ai @ai-sdk/amazon-bedrock
188
+
yarn add ai@4 @ai-sdk/amazon-bedrock@1
189
189
```
190
190
</Tab>
191
191
</Tabs>
192
192
193
-
To get started, you can use the [Vercel AI SDK external client](https://github.com/browserbase/stagehand/blob/main/lib/llm/aisdk.ts) which is exposed as `AISdkClient` to create a client for your model.
193
+
<Note>
194
+
The `AISdkClient` is not yet available via the Stagehand npm package. For now, install Stagehand as a git repository to access the `AISdkClient` (this will be included in the npm package in an upcoming release).
0 commit comments