Skip to content

BedrockModelConfig

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

Configuration interface for AWS Bedrock model provider.

Extends BaseModelConfig with Bedrock-specific configuration options for model parameters, caching, and additional request/response fields.

const config: BedrockModelConfig = {
modelId: 'global.anthropic.claude-sonnet-4-6',
maxTokens: 1024,
temperature: 0.7,
cacheConfig: { strategy: 'auto' }
}
maxTokens?: number;

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

Maximum number of tokens to generate in the response.

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

BaseModelConfig.maxTokens


temperature?: number;

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

Controls randomness in generation.

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

BaseModelConfig.temperature


topP?: number;

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

Controls diversity via nucleus sampling.

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

BaseModelConfig.topP


stopSequences?: string[];

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

Array of sequences that will stop generation when encountered.


cacheConfig?: CacheConfig;

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

Configuration for prompt caching.

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


additionalRequestFields?: JSONValue;

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

Additional fields to include in the Bedrock request.


additionalResponseFieldPaths?: string[];

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

Additional response field paths to extract from the Bedrock response.


additionalArgs?: JSONValue;

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

Additional arguments to pass through to the Bedrock Converse API.

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


stream?: boolean;

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

Whether or not to stream responses from the model.

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


includeToolResultStatus?: boolean | "auto";

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

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)

guardrailConfig?: BedrockGuardrailConfig;

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

Guardrail configuration for content filtering and safety controls.

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


useNativeTokenCount?: boolean;

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

Whether to use the native Bedrock CountTokens API.

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

false

strictTools?: boolean;

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

Constrain the model to emit tool names and inputs that conform to each tool’s schema.

When true, every tool is sent with strict: true and a copy of its inputSchema with additionalProperties: false added to each object type, so a free-form { type: 'object' } parameter becomes one the model can only fill with {}. Bedrock rejects schemas that use features outside its strict subset (recursive or external $ref, minimum/maximum/ multipleOf, minLength/maxLength, additionalProperties other than false) with a 400 at request time, and compiles each new schema on first use, which can take minutes. Incompatible with citations for Anthropic models.

false

modelId?: string;

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

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

BaseModelConfig.modelId


contextWindowLimit?: number;

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

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.

BaseModelConfig.contextWindowLimit