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
clientIAmazonBedrockRuntimeThe Bedrock runtime client to use. Cannot be null.
modelIdstringThe Bedrock model id, for example
amazon.titan-embed-text-v2:0. Cannot be null or empty.familyBedrockEmbedder.ModelFamily?The model family; inferred from
modelIdwhen null.dimensionsint?The output dimension to request (Titan v2 supports 256, 512, or 1024). When null, the model default is used.
normalizeboolWhether to request normalized vectors (Titan). Cohere always normalizes.
Exceptions
- ArgumentNullException
Thrown when
clientormodelIdis 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
modelIdstringThe Bedrock model id, for example
amazon.titan-embed-text-v2:0. Cannot be null or empty.regionRegionEndpointThe AWS region hosting the model. Cannot be null.
familyBedrockEmbedder.ModelFamily?The model family; inferred from
modelIdwhen null.dimensionsint?The output dimension to request (Titan v2). When null, the model default is used.
normalizeboolWhether to request normalized vectors (Titan).