AmazonBedrockProvider
Namespace: Vercel.AI.AmazonBedrock
public sealed class AmazonBedrockProvider : ProviderBaseAmazon Bedrock Converse provider.
Inheritance: object → ProviderBase
Constructors
Section titled “Constructors”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 |
Fields
Section titled “Fields”ProviderName
Section titled “ProviderName”public const string ProviderName = "amazon-bedrock"Provider id.
Value: string
Properties
Section titled “Properties”public ProviderHttp Http { get; }HTTP helper.
Value: ProviderHttp
HttpClient
Section titled “HttpClient”public HttpClient HttpClient { get; }HTTP client that receives the signed request.
Value: HttpClient
Options
Section titled “Options”public AmazonBedrockOptions Options { get; }Options.
Value: AmazonBedrockOptions
Methods
Section titled “Methods”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
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
EmbeddingModel(string)
Section titled “EmbeddingModel(string)”public override IEmbeddingModel EmbeddingModel(string modelId)Returns an embedding model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IEmbeddingModel
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
LanguageModel(string)
Section titled “LanguageModel(string)”public override ILanguageModel LanguageModel(string modelId)Returns a language model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: ILanguageModel
RerankingModel(string)
Section titled “RerankingModel(string)”public override IRerankingModel RerankingModel(string modelId)Returns a reranking model.
Parameters
| Name | Type | Description |
|---|---|---|
modelId |
string |
Returns: IRerankingModel
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product