Skip to content

BedrockModelOptions

Defined in: src/models/bedrock.ts:298

Options for creating a BedrockModel instance.

optional maxTokens?: number;

Defined in: src/models/bedrock.ts:217

Maximum number of tokens to generate in the response.

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InferenceConfiguration.html

BedrockModelConfig.maxTokens


optional temperature?: number;

Defined in: src/models/bedrock.ts:224

Controls randomness in generation.

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InferenceConfiguration.html

BedrockModelConfig.temperature


optional topP?: number;

Defined in: src/models/bedrock.ts:231

Controls diversity via nucleus sampling.

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_InferenceConfiguration.html

BedrockModelConfig.topP


optional stopSequences?: string[];

Defined in: src/models/bedrock.ts:236

Array of sequences that will stop generation when encountered.

BedrockModelConfig.stopSequences


optional cacheConfig?: CacheConfig;

Defined in: src/models/bedrock.ts:243

Configuration for prompt caching.

https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html

BedrockModelConfig.cacheConfig


optional additionalRequestFields?: JSONValue;

Defined in: src/models/bedrock.ts:248

Additional fields to include in the Bedrock request.

BedrockModelConfig.additionalRequestFields


optional additionalResponseFieldPaths?: string[];

Defined in: src/models/bedrock.ts:253

Additional response field paths to extract from the Bedrock response.

BedrockModelConfig.additionalResponseFieldPaths


optional additionalArgs?: JSONValue;

Defined in: src/models/bedrock.ts:259

Additional arguments to pass through to the Bedrock Converse API.

https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock-runtime/command/ConverseStreamCommand/

BedrockModelConfig.additionalArgs


optional stream?: boolean;

Defined in: src/models/bedrock.ts:269

Whether or not to stream responses from the model.

This will use the ConverseStream API instead of the Converse API.

BedrockModelConfig.stream


optional includeToolResultStatus?: boolean | "auto";

Defined in: src/models/bedrock.ts:277

Flag to include status field in tool results.

  • true: Always include status field
  • false: Never include status field
  • 'auto': Automatically determine based on model ID (default)

BedrockModelConfig.includeToolResultStatus


optional guardrailConfig?: BedrockGuardrailConfig;

Defined in: src/models/bedrock.ts:283

Guardrail configuration for content filtering and safety controls.

https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails.html

BedrockModelConfig.guardrailConfig


optional useNativeTokenCount?: boolean;

Defined in: src/models/bedrock.ts:292

Whether to use the native Bedrock CountTokens API.

When true (default), countTokens() calls the Bedrock CountTokens API for accurate counts. When false, skips the API call and uses the character-based heuristic estimator.

BedrockModelConfig.useNativeTokenCount


optional region?: string;

Defined in: src/models/bedrock.ts:302

AWS region to use for the Bedrock service.


optional clientConfig?: BedrockRuntimeClientConfig;

Defined in: src/models/bedrock.ts:307

Configuration for the Bedrock Runtime client.


optional apiKey?: string;

Defined in: src/models/bedrock.ts:314

Amazon Bedrock API key for bearer token authentication. When provided, requests use the API key instead of SigV4 signing.

https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html


optional modelId?: string;

Defined in: src/models/model.ts:91

The model identifier. This typically specifies which model to use from the provider’s catalog.

BedrockModelConfig.modelId


optional contextWindowLimit?: number;

Defined in: src/models/model.ts:124

Maximum context window size in tokens for the model.

This value represents the total token capacity shared between input and output. When not provided, it is automatically resolved from a built-in lookup table based on the configured model ID. An explicit value always takes precedence.

When modelId is changed via updateConfig(), this value is automatically re-resolved if it was initially auto-populated. Explicitly set values are preserved.

BedrockModelConfig.contextWindowLimit