Skip to content

AmazonBedrockProvider

Namespace: Vercel.AI.AmazonBedrock

public sealed class AmazonBedrockProvider : ProviderBase

Amazon Bedrock Converse provider.

Inheritance: object → ProviderBase

View source

AmazonBedrockProvider(HttpClient, AmazonBedrockOptions?)

Section titled “AmazonBedrockProvider(HttpClient, AmazonBedrockOptions?)”
public AmazonBedrockProvider(HttpClient httpClient, AmazonBedrockOptions? options = null)

Creates a provider.

Parameters

Name Type Description
httpClient HttpClient
options AmazonBedrockOptions

View source

public const string ProviderName = "amazon-bedrock"

Provider id.

Value: string

View source

public ProviderHttp Http { get; }

HTTP helper.

Value: ProviderHttp

View source

public HttpClient HttpClient { get; }

HTTP client that receives the signed request.

Value: HttpClient

View source

public AmazonBedrockOptions Options { get; }

Options.

Value: AmazonBedrockOptions

View source

AddHeadersAsync(HttpRequestMessage, IEnumerable<KeyValuePair<string, string?>>?, CancellationToken)

Section titled “AddHeadersAsync(HttpRequestMessage, IEnumerable<KeyValuePair<string, string?>>?, CancellationToken)”
public Task AddHeadersAsync(HttpRequestMessage request, IEnumerable<KeyValuePair<string, string?>>? callHeaders, CancellationToken cancellationToken)

Adds the provider headers, then HeadersProvider, then the call headers (which win; a null value drops the header), then the ai-sdk-amazon-bedrock user agent. Call before signing.

Parameters

Name Type Description
request HttpRequestMessage
callHeaders IEnumerable<KeyValuePair<string, string>>
cancellationToken CancellationToken

Returns: Task

View source

Create(AmazonBedrockOptions?, HttpMessageHandler?)

Section titled “Create(AmazonBedrockOptions?, HttpMessageHandler?)”
public static AmazonBedrockProvider Create(AmazonBedrockOptions? options = null, HttpMessageHandler? handler = null)

Creates a provider.

Parameters

Name Type Description
options AmazonBedrockOptions
handler HttpMessageHandler

Returns: AmazonBedrockProvider

View source

public override IEmbeddingModel EmbeddingModel(string modelId)

Returns an embedding model.

Parameters

Name Type Description
modelId string

Returns: IEmbeddingModel

View source

EmbeddingModel(string, AmazonBedrockEmbeddingModelSettings?)

Section titled “EmbeddingModel(string, AmazonBedrockEmbeddingModelSettings?)”
public AmazonBedrockEmbeddingModel EmbeddingModel(string modelId, AmazonBedrockEmbeddingModelSettings? settings)

Creates an embedding model with <code class=“paramref”>settings</code>.

Parameters

Name Type Description
modelId string
settings AmazonBedrockEmbeddingModelSettings

Returns: AmazonBedrockEmbeddingModel

View source

public override ILanguageModel LanguageModel(string modelId)

Returns a language model.

Parameters

Name Type Description
modelId string

Returns: ILanguageModel

View source

public override IRerankingModel RerankingModel(string modelId)

Returns a reranking model.

Parameters

Name Type Description
modelId string

Returns: IRerankingModel

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product