AmazonBedrockFetch
Namespace: Vercel.AI.AmazonBedrock
public static class AmazonBedrockFetchAmazon 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
Fields
Section titled “Fields”DefaultService
Section titled “DefaultService”public const string DefaultService = "bedrock"SigV4 service name used when none is given.
Value: string
UserAgent
Section titled “UserAgent”public static readonly string UserAgentUser agent sent on every request. The runtime segment is dotnet.
Value: string
Methods
Section titled “Methods”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
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
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product