Skip to content

Commit 3b3dc77

Browse files
committed
docs: update TypeScript SDK model provider class names and import paths
Update documentation to reflect SDK model provider reorganization: - BedrockModel -> BedrockConverseModel - OpenAIModel -> OpenAIChatModel - GeminiModel -> GoogleGenAIModel - Import paths: @strands-agents/sdk/<name> -> @strands-agents/sdk/models/<name> - gemini subpath -> google subpath - Update all TypeScript code snippets, examples, API links, and tests
1 parent 3291103 commit 3b3dc77

File tree

21 files changed

+93
-93
lines changed

21 files changed

+93
-93
lines changed

SITE-ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ Namespaces
510510
└── telemetry
511511
Classes
512512
├── Agent
513-
├── BedrockModel
513+
├── BedrockConverseModel
514514
└── Tool
515515
Interfaces
516516
├── AgentConfig

docs/examples/typescript/deploy_to_bedrock_agentcore/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ const myCustomTool = strands.tool({
215215
})
216216

217217
const agent = new strands.Agent({
218-
model: new strands.BedrockModel({
218+
model: new strands.BedrockConverseModel({
219219
region: 'ap-southeast-2',
220220
}),
221221
tools: [calculatorTool, myCustomTool], // Add your tool here

docs/examples/typescript/deploy_to_bedrock_agentcore/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const calculatorTool = strands.tool({
2929

3030
// Configure the agent with Amazon Bedrock
3131
const agent = new strands.Agent({
32-
model: new strands.BedrockModel({
32+
model: new strands.BedrockConverseModel({
3333
region: 'ap-southeast-2', // Change to your preferred region
3434
}),
3535
tools: [calculatorTool],

src/content/docs/user-guide/concepts/model-providers/amazon-bedrock.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ response = agent("Tell me about Amazon Bedrock.")
188188
</Tab>
189189
<Tab label="TypeScript">
190190

191-
The [`BedrockModel`](@api/typescript/BedrockModel) provider is used by default when creating a basic Agent, and uses the [Claude Sonnet 4.5](https://aws.amazon.com/blogs/aws/introducing-claude-sonnet-4-5-in-amazon-bedrock-anthropics-most-intelligent-model-best-for-coding-and-complex-agents/) model by default. This basic example creates an agent using this default setup:
191+
The [`BedrockConverseModel`](@api/typescript/BedrockConverseModel) provider is used by default when creating a basic Agent, and uses the [Claude Sonnet 4.5](https://aws.amazon.com/blogs/aws/introducing-claude-sonnet-4-5-in-amazon-bedrock-anthropics-most-intelligent-model-best-for-coding-and-complex-agents/) model by default. This basic example creates an agent using this default setup:
192192

193193
```typescript
194194
--8<-- "user-guide/concepts/model-providers/amazon-bedrock_imports.ts:basic_default_imports"
@@ -235,7 +235,7 @@ response = agent("Tell me about Amazon Bedrock.")
235235
</Tab>
236236
<Tab label="TypeScript">
237237

238-
For more control over model configuration, you can create an instance of the [`BedrockModel`](@api/typescript/BedrockModel) class:
238+
For more control over model configuration, you can create an instance of the [`BedrockConverseModel`](@api/typescript/BedrockConverseModel) class:
239239

240240
```typescript
241241
--8<-- "user-guide/concepts/model-providers/amazon-bedrock.ts:basic_model_instance"
@@ -265,7 +265,7 @@ Common configuration parameters include:
265265
</Tab>
266266
<Tab label="TypeScript">
267267

268-
The [`BedrockModel`](@api/typescript/BedrockModelOptions) supports various configuration parameters. For a complete list of available options, see the [BedrockModelOptions API reference](@api/typescript/BedrockModelOptions).
268+
The [`BedrockConverseModel`](@api/typescript/BedrockConverseModelOptions) supports various configuration parameters. For a complete list of available options, see the [BedrockConverseModelOptions API reference](@api/typescript/BedrockConverseModelOptions).
269269

270270
Common configuration parameters include:
271271

@@ -485,7 +485,7 @@ guardrail_agent = Agent(model=bedrock_model)
485485
response = guardrail_agent("Can you tell me about the Strands SDK?")
486486
```
487487

488-
Amazon Bedrock supports guardrails to help ensure model outputs meet your requirements. Strands allows you to configure guardrails with your [`BedrockModel`](@api/typescript/BedrockModel).
488+
Amazon Bedrock supports guardrails to help ensure model outputs meet your requirements. Strands allows you to configure guardrails with your [`BedrockConverseModel`](@api/typescript/BedrockConverseModel).
489489

490490
When a guardrail is triggered:
491491

@@ -499,7 +499,7 @@ When `guardrail_latest_message=True`, only the most recent user message is sent
499499
</Tab>
500500
<Tab label="TypeScript">
501501

502-
Amazon Bedrock supports guardrails to help ensure model outputs meet your requirements. Strands allows you to configure guardrails with your [`BedrockModel`](@api/typescript/BedrockModel):
502+
Amazon Bedrock supports guardrails to help ensure model outputs meet your requirements. Strands allows you to configure guardrails with your [`BedrockConverseModel`](@api/typescript/BedrockConverseModel):
503503

504504
```typescript
505505
--8<-- "user-guide/concepts/model-providers/amazon-bedrock.ts:guardrails"
@@ -853,7 +853,7 @@ response = agent("If a train travels at 120 km/h and needs to cover 450 km, how
853853
</Tab>
854854
<Tab label="TypeScript">
855855

856-
Strands allows you to enable and configure reasoning capabilities with your [`BedrockModel`](@api/typescript/BedrockModel):
856+
Strands allows you to enable and configure reasoning capabilities with your [`BedrockConverseModel`](@api/typescript/BedrockConverseModel):
857857

858858
```typescript
859859
--8<-- "user-guide/concepts/model-providers/amazon-bedrock.ts:reasoning"

src/content/docs/user-guide/concepts/model-providers/amazon-bedrock.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
22
* TypeScript examples for Amazon Bedrock model provider documentation.
3-
* These examples demonstrate common usage patterns for the BedrockModel.
3+
* These examples demonstrate common usage patterns for the BedrockConverseModel.
44
*/
55
// @ts-nocheck
66
// Imports are in amazon-bedrock_imports.ts
77

8-
import { Agent, BedrockModel, DocumentBlock, CachePointBlock, Message } from '@strands-agents/sdk'
8+
import { Agent, BedrockConverseModel, DocumentBlock, CachePointBlock, Message } from '@strands-agents/sdk'
99

1010
// Basic usage examples
1111
async function basicUsageDefault() {
@@ -28,13 +28,13 @@ async function basicUsageModelId() {
2828
async function basicUsageModelInstance() {
2929
// --8<-- [start:basic_model_instance]
3030
// Create a Bedrock model instance
31-
const bedrockModel = new BedrockModel({
31+
const bedrockModel = new BedrockConverseModel({
3232
modelId: 'us.amazon.nova-premier-v1:0',
3333
temperature: 0.3,
3434
topP: 0.8,
3535
})
3636

37-
// Create an agent using the BedrockModel instance
37+
// Create an agent using the BedrockConverseModel instance
3838
const agent = new Agent({ model: bedrockModel })
3939

4040
// Use the agent
@@ -46,7 +46,7 @@ async function basicUsageModelInstance() {
4646
async function configurationExample() {
4747
// --8<-- [start:configuration]
4848
// Create a configured Bedrock model
49-
const bedrockModel = new BedrockModel({
49+
const bedrockModel = new BedrockConverseModel({
5050
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
5151
region: 'us-east-1', // Specify a different region than the default
5252
temperature: 0.3,
@@ -70,13 +70,13 @@ async function configurationExample() {
7070
async function streamingExample() {
7171
// --8<-- [start:streaming]
7272
// Streaming model (default)
73-
const streamingModel = new BedrockModel({
73+
const streamingModel = new BedrockConverseModel({
7474
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
7575
stream: true, // This is the default
7676
})
7777

7878
// Non-streaming model
79-
const nonStreamingModel = new BedrockModel({
79+
const nonStreamingModel = new BedrockConverseModel({
8080
modelId: 'us.meta.llama3-2-90b-instruct-v1:0',
8181
stream: false, // Disable streaming
8282
})
@@ -87,7 +87,7 @@ async function streamingExample() {
8787
async function updateConfiguration() {
8888
// --8<-- [start:update_config]
8989
// Create the model with initial configuration
90-
const bedrockModel = new BedrockModel({
90+
const bedrockModel = new BedrockConverseModel({
9191
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
9292
temperature: 0.7,
9393
})
@@ -120,7 +120,7 @@ async function toolBasedConfigUpdate() {
120120
})
121121

122122
const agent = new Agent({
123-
model: new BedrockModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
123+
model: new BedrockConverseModel({ modelId: 'anthropic.claude-sonnet-4-20250514-v1:0' }),
124124
tools: [updateTemperature],
125125
})
126126
// --8<-- [end:tool_update_config]
@@ -130,7 +130,7 @@ async function toolBasedConfigUpdate() {
130130
async function reasoningSupport() {
131131
// --8<-- [start:reasoning]
132132
// Create a Bedrock model with reasoning configuration
133-
const bedrockModel = new BedrockModel({
133+
const bedrockModel = new BedrockConverseModel({
134134
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
135135
additionalRequestFields: {
136136
thinking: {
@@ -157,7 +157,7 @@ async function customCredentials() {
157157
// See AWS SDK for JavaScript documentation for all credential options:
158158
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-credentials-node.html
159159

160-
const bedrockModel = new BedrockModel({
160+
const bedrockModel = new BedrockConverseModel({
161161
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
162162
region: 'us-west-2',
163163
clientConfig: {
@@ -174,7 +174,7 @@ async function customCredentials() {
174174
// Multimodal support
175175
async function multimodalSupport() {
176176
// --8<-- [start:multimodal_full]
177-
const bedrockModel = new BedrockModel({
177+
const bedrockModel = new BedrockConverseModel({
178178
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
179179
})
180180

@@ -197,7 +197,7 @@ async function multimodalSupport() {
197197
// S3 location support for multimodal content
198198
async function s3LocationSupport() {
199199
// --8<-- [start:s3_location]
200-
const agent = new Agent({ model: new BedrockModel() })
200+
const agent = new Agent({ model: new BedrockConverseModel() })
201201

202202
const response = await agent.invoke([
203203
new DocumentBlock({
@@ -256,7 +256,7 @@ async function systemPromptCachingFull() {
256256
// Tool caching
257257
async function toolCachingFull() {
258258
// --8<-- [start:tool_caching_full]
259-
const bedrockModel = new BedrockModel({
259+
const bedrockModel = new BedrockConverseModel({
260260
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
261261
cacheConfig: { strategy: 'auto' },
262262
})
@@ -294,7 +294,7 @@ async function toolCachingFull() {
294294
// Automatic cache strategy for messages
295295
async function automaticCacheStrategy() {
296296
// --8<-- [start:automatic_cache_strategy]
297-
const bedrockModel = new BedrockModel({
297+
const bedrockModel = new BedrockConverseModel({
298298
modelId: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',
299299
cacheConfig: { strategy: 'auto' },
300300
})
@@ -395,8 +395,8 @@ async function cacheMetrics() {
395395
// Guardrails configuration
396396
async function guardrailsExample() {
397397
// --8<-- [start:guardrails]
398-
// Using guardrails with BedrockModel
399-
const bedrockModel = new BedrockModel({
398+
// Using guardrails with BedrockConverseModel
399+
const bedrockModel = new BedrockConverseModel({
400400
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
401401
guardrailConfig: {
402402
guardrailIdentifier: 'your-guardrail-id',

src/content/docs/user-guide/concepts/model-providers/amazon-bedrock_imports.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ import { z } from 'zod'
1010
// --8<-- [end:tool_update_config_imports]
1111

1212
// --8<-- [start:custom_credentials_imports]
13-
import { BedrockModel } from '@strands-agents/sdk/bedrock'
13+
import { BedrockConverseModel } from '@strands-agents/sdk/models/bedrock'
1414
// --8<-- [end:custom_credentials_imports]

src/content/docs/user-guide/concepts/model-providers/custom_model_provider.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* These examples demonstrate how to implement a custom model provider.
44
*/
55

6-
import { Agent, BedrockModel, type BedrockModelConfig } from '@strands-agents/sdk'
6+
import { Agent, BedrockConverseModel, type BedrockConverseModelConfig } from '@strands-agents/sdk'
77
import type {
88
Model,
99
BaseModelConfig,
@@ -16,9 +16,9 @@ import type {
1616
ModelMessageStopEventData,
1717
} from '@strands-agents/sdk'
1818

19-
// Example wrapper around BedrockModel for demonstration
20-
class YourCustomModel extends BedrockModel {
21-
constructor(config: BedrockModelConfig = {
19+
// Example wrapper around BedrockConverseModel for demonstration
20+
class YourCustomModel extends BedrockConverseModel {
21+
constructor(config: BedrockConverseModelConfig = {
2222
modelId: 'anthropic.claude-3-5-sonnet-20241022-v2:0'
2323
}) {
2424
super(config)

src/content/docs/user-guide/concepts/model-providers/gemini.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ print(response)
6262

6363
```typescript
6464
import { Agent } from '@strands-agents/sdk'
65-
import { GeminiModel } from '@strands-agents/sdk/gemini'
65+
import { GoogleGenAIModel } from '@strands-agents/sdk/models/google'
6666

67-
const model = new GeminiModel({
67+
const model = new GoogleGenAIModel({
6868
apiKey: '<KEY>',
6969
modelId: 'gemini-2.5-flash',
7070
params: {
@@ -333,11 +333,11 @@ print(response)
333333
```typescript
334334
import { GoogleGenAI } from '@google/genai'
335335
import { Agent } from '@strands-agents/sdk'
336-
import { GeminiModel } from '@strands-agents/sdk/gemini'
336+
import { GoogleGenAIModel } from '@strands-agents/sdk/models/google'
337337

338338
const client = new GoogleGenAI({ apiKey: '<KEY>' })
339339

340-
const model = new GeminiModel({
340+
const model = new GoogleGenAIModel({
341341
client,
342342
modelId: 'gemini-2.5-flash',
343343
params: {
@@ -396,9 +396,9 @@ response = agent([
396396

397397
```typescript
398398
import { Agent, ImageBlock, TextBlock } from '@strands-agents/sdk'
399-
import { GeminiModel } from '@strands-agents/sdk/gemini'
399+
import { GoogleGenAIModel } from '@strands-agents/sdk/models/google'
400400

401-
const model = new GeminiModel({
401+
const model = new GoogleGenAIModel({
402402
apiKey: '<KEY>',
403403
modelId: 'gemini-2.5-flash',
404404
})

src/content/docs/user-guide/concepts/model-providers/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
// Imports are in index_imports.ts
77

88
import { Agent } from '@strands-agents/sdk'
9-
import { BedrockModel } from '@strands-agents/sdk/models/bedrock'
10-
import { OpenAIModel } from '@strands-agents/sdk/models/openai'
9+
import { BedrockConverseModel } from '@strands-agents/sdk/models/bedrock'
10+
import { OpenAIChatModel } from '@strands-agents/sdk/models/openai'
1111

1212
async function basicUsage() {
1313
// --8<-- [start:basic_usage]
1414
// Use Bedrock
15-
const bedrockModel = new BedrockModel({
15+
const bedrockModel = new BedrockConverseModel({
1616
modelId: 'anthropic.claude-sonnet-4-20250514-v1:0',
1717
})
1818
let agent = new Agent({ model: bedrockModel })
1919
let response = await agent.invoke('What can you help me with?')
2020

2121
// Alternatively, use OpenAI by just switching model provider
22-
const openaiModel = new OpenAIModel({
22+
const openaiModel = new OpenAIChatModel({
2323
apiKey: process.env.OPENAI_API_KEY,
2424
modelId: 'gpt-4o',
2525
})

src/content/docs/user-guide/concepts/model-providers/index_imports.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
// --8<-- [start:basic_usage_imports]
44
import { Agent } from '@strands-agents/sdk'
5-
import { BedrockModel } from '@strands-agents/sdk/bedrock'
6-
import { OpenAIModel } from '@strands-agents/sdk/openai'
5+
import { BedrockConverseModel } from '@strands-agents/sdk/models/bedrock'
6+
import { OpenAIChatModel } from '@strands-agents/sdk/models/openai'
77
// --8<-- [end:basic_usage_imports]

0 commit comments

Comments
 (0)