Table of Contents

Constructor BedrockEmbedder

Namespace
LMKit.Integrations.Aws.Embeddings
Assembly
LM-Kit.NET.Integrations.Aws.dll

BedrockEmbedder(IAmazonBedrockRuntime, string, ModelFamily?, int?, bool)

Initializes a new instance of the BedrockEmbedder class with an already-configured Bedrock runtime client.

public BedrockEmbedder(IAmazonBedrockRuntime client, string modelId, BedrockEmbedder.ModelFamily? family = null, int? dimensions = null, bool normalize = true)

Parameters

client IAmazonBedrockRuntime

The Bedrock runtime client to use. Cannot be null.

modelId string

The Bedrock model id, for example amazon.titan-embed-text-v2:0. Cannot be null or empty.

family BedrockEmbedder.ModelFamily?

The model family; inferred from modelId when null.

dimensions int?

The output dimension to request (Titan v2 supports 256, 512, or 1024). When null, the model default is used.

normalize bool

Whether to request normalized vectors (Titan). Cohere always normalizes.

Exceptions

ArgumentNullException

Thrown when client or modelId is null.

ArgumentException

Thrown when the family cannot be inferred from modelId.

BedrockEmbedder(string, RegionEndpoint, ModelFamily?, int?, bool)

Initializes a new instance of the BedrockEmbedder class, creating a Bedrock runtime client for the given region using the default AWS credential provider chain.

public BedrockEmbedder(string modelId, RegionEndpoint region, BedrockEmbedder.ModelFamily? family = null, int? dimensions = null, bool normalize = true)

Parameters

modelId string

The Bedrock model id, for example amazon.titan-embed-text-v2:0. Cannot be null or empty.

region RegionEndpoint

The AWS region hosting the model. Cannot be null.

family BedrockEmbedder.ModelFamily?

The model family; inferred from modelId when null.

dimensions int?

The output dimension to request (Titan v2). When null, the model default is used.

normalize bool

Whether to request normalized vectors (Titan).

Share