Skip to content

AmazonBedrockFetch

Namespace: Vercel.AI.AmazonBedrock

public static class AmazonBedrockFetch

Amazon Bedrock fetch behavior. GET requests and POST requests without a body skip signing. POST bodies are signed with SigV4. Caller headers are signed, except values with non-ASCII characters.

Inheritance: object

View source

public const string DefaultService = "bedrock"

SigV4 service name used when none is given.

Value: string

View source

public static readonly string UserAgent

User agent sent on every request. The runtime segment is dotnet.

Value: string

View source

Prepare(string, string?, string?, byte[]?, JsonNode?, IReadOnlyDictionary<string, string?>?, IReadOnlyDictionary<string, string?>?, AmazonBedrockCredentials, string, DateTimeOffset?)

Section titled “Prepare(string, string?, string?, byte[]?, JsonNode?, IReadOnlyDictionary<string, string?>?, IReadOnlyDictionary<string, string?>?, AmazonBedrockCredentials, string, DateTimeOffset?)”
public static AmazonBedrockPreparedCall Prepare(string url, string? method, string? body, byte[]? binaryBody, JsonNode? objectBody, IReadOnlyDictionary<string, string?>? headers, IReadOnlyDictionary<string, string?>? requestHeaders, AmazonBedrockCredentials credentials, string service = "bedrock", DateTimeOffset? utcNow = null)

Prepares a call. Non-POST requests and POST requests without a body are not signed. String bodies are left unchanged. Byte bodies are decoded as UTF-8. Other objects are JSON.

Parameters

Name Type Description
url string
method string
body string
binaryBody byte[]
objectBody JsonNode
headers IReadOnlyDictionary<string, string>
requestHeaders IReadOnlyDictionary<string, string>
credentials AmazonBedrockCredentials
service string
utcNow DateTimeOffset?

Returns: AmazonBedrockPreparedCall

View source

PrepareApiKey(string, string, string?, string?, IReadOnlyDictionary<string, string?>?)

Section titled “PrepareApiKey(string, string, string?, string?, IReadOnlyDictionary<string, string?>?)”
public static AmazonBedrockPreparedCall PrepareApiKey(string apiKey, string url, string? method, string? body, IReadOnlyDictionary<string, string?>? headers)

Adds Authorization: Bearer and the user-agent without signing. The API key replaces any caller-supplied Authorization.

Parameters

Name Type Description
apiKey string
url string
method string
body string
headers IReadOnlyDictionary<string, string>

Returns: AmazonBedrockPreparedCall

View source

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