AmazonBedrockAnthropicRequests
Namespace: Vercel.AI.AmazonBedrock
public static class AmazonBedrockAnthropicRequestsBuilds InvokeModel URLs and the Bedrock Anthropic request body.
Inheritance: object
Methods
Section titled “Methods”BuildUrl(string, string, bool)
Section titled “BuildUrl(string, string, bool)”public static string BuildUrl(string baseUrl, string modelId, bool streaming)InvokeModel URL. Streaming uses invoke-with-response-stream.
Parameters
| Name | Type | Description |
|---|---|---|
baseUrl |
string | |
modelId |
string | |
streaming |
bool |
Returns: string
ToAnthropicErrorBody(string)
Section titled “ToAnthropicErrorBody(string)”public static string ToAnthropicErrorBody(string text)Rewrites a Bedrock error body into the Anthropic { type: error, error } shape.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns: string
Transform(JsonObject, IReadOnlyList<string>?)
Section titled “Transform(JsonObject, IReadOnlyList<string>?)”public static JsonObject Transform(JsonObject source, IReadOnlyList<string>? betas = null)Drops model and stream, keeps a tool choice type and name, renames the thinking
block binding field, upgrades computer-use tool versions, moves the betas into
anthropic_beta, and sets anthropic_version to bedrock-2023-05-31.
Parameters
| Name | Type | Description |
|---|---|---|
source |
JsonObject | |
betas |
IReadOnlyList<string> |
Returns: JsonObject
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product