Skip to content

Commit e622d96

Browse files
feat: update AWS API models
1 parent a397e23 commit e622d96

20 files changed

+2716
-1718
lines changed

codegen/sdk/aws-models/bedrock-runtime.json

Lines changed: 181 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
},
5050
{
5151
"target": "com.amazonaws.bedrockruntime#InferenceResource"
52+
},
53+
{
54+
"target": "com.amazonaws.bedrockruntime#TokenizerResource"
5255
}
5356
],
5457
"traits": {
@@ -2039,6 +2042,26 @@
20392042
"smithy.api#documentation": "<p>The trace object in a response from <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html\">ConverseStream</a>. Currently, you can only trace guardrails.</p>"
20402043
}
20412044
},
2045+
"com.amazonaws.bedrockruntime#ConverseTokensRequest": {
2046+
"type": "structure",
2047+
"members": {
2048+
"messages": {
2049+
"target": "com.amazonaws.bedrockruntime#Messages",
2050+
"traits": {
2051+
"smithy.api#documentation": "<p>An array of messages to count tokens for.</p>"
2052+
}
2053+
},
2054+
"system": {
2055+
"target": "com.amazonaws.bedrockruntime#SystemContentBlocks",
2056+
"traits": {
2057+
"smithy.api#documentation": "<p>The system content blocks to count tokens for. System content provides instructions or context to the model about how it should behave or respond. The token count will include any system content provided.</p>"
2058+
}
2059+
}
2060+
},
2061+
"traits": {
2062+
"smithy.api#documentation": "<p>The inputs from a <code>Converse</code> API request for token counting.</p> <p>This structure mirrors the input format for the <code>Converse</code> operation, allowing you to count tokens for conversation-based inference requests.</p>"
2063+
}
2064+
},
20422065
"com.amazonaws.bedrockruntime#ConverseTrace": {
20432066
"type": "structure",
20442067
"members": {
@@ -2059,6 +2082,102 @@
20592082
"smithy.api#documentation": "<p>The trace object in a response from <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html\">Converse</a>. Currently, you can only trace guardrails.</p>"
20602083
}
20612084
},
2085+
"com.amazonaws.bedrockruntime#CountTokens": {
2086+
"type": "operation",
2087+
"input": {
2088+
"target": "com.amazonaws.bedrockruntime#CountTokensRequest"
2089+
},
2090+
"output": {
2091+
"target": "com.amazonaws.bedrockruntime#CountTokensResponse"
2092+
},
2093+
"errors": [
2094+
{
2095+
"target": "com.amazonaws.bedrockruntime#AccessDeniedException"
2096+
},
2097+
{
2098+
"target": "com.amazonaws.bedrockruntime#InternalServerException"
2099+
},
2100+
{
2101+
"target": "com.amazonaws.bedrockruntime#ResourceNotFoundException"
2102+
},
2103+
{
2104+
"target": "com.amazonaws.bedrockruntime#ServiceUnavailableException"
2105+
},
2106+
{
2107+
"target": "com.amazonaws.bedrockruntime#ThrottlingException"
2108+
},
2109+
{
2110+
"target": "com.amazonaws.bedrockruntime#ValidationException"
2111+
}
2112+
],
2113+
"traits": {
2114+
"smithy.api#documentation": "<p>Returns the token count for a given inference request. This operation helps you estimate token usage before sending requests to foundation models by returning the token count that would be used if the same input were sent to the model in an inference request.</p> <p>Token counting is model-specific because different models use different tokenization strategies. The token count returned by this operation will match the token count that would be charged if the same input were sent to the model in an <code>InvokeModel</code> or <code>Converse</code> request.</p> <p>You can use this operation to:</p> <ul> <li> <p>Estimate costs before sending inference requests.</p> </li> <li> <p>Optimize prompts to fit within token limits.</p> </li> <li> <p>Plan for token usage in your applications.</p> </li> </ul> <p>This operation accepts the same input formats as <code>InvokeModel</code> and <code>Converse</code>, allowing you to count tokens for both raw text inputs and structured conversation formats.</p> <p>The following operations are related to <code>CountTokens</code>:</p> <ul> <li> <p> <a href=\"https://docs.aws.amazon.com/bedrock/latest/API/API_runtime_InvokeModel.html\">InvokeModel</a> - Sends inference requests to foundation models</p> </li> <li> <p> <a href=\"https://docs.aws.amazon.com/bedrock/latest/API/API_runtime_Converse.html\">Converse</a> - Sends conversation-based inference requests to foundation models</p> </li> </ul>",
2115+
"smithy.api#http": {
2116+
"code": 200,
2117+
"method": "POST",
2118+
"uri": "/model/{modelId}/count-tokens"
2119+
},
2120+
"smithy.api#readonly": {}
2121+
}
2122+
},
2123+
"com.amazonaws.bedrockruntime#CountTokensInput": {
2124+
"type": "union",
2125+
"members": {
2126+
"invokeModel": {
2127+
"target": "com.amazonaws.bedrockruntime#InvokeModelTokensRequest",
2128+
"traits": {
2129+
"smithy.api#documentation": "<p>An <code>InvokeModel</code> request for which to count tokens. Use this field when you want to count tokens for a raw text input that would be sent to the <code>InvokeModel</code> operation.</p>"
2130+
}
2131+
},
2132+
"converse": {
2133+
"target": "com.amazonaws.bedrockruntime#ConverseTokensRequest",
2134+
"traits": {
2135+
"smithy.api#documentation": "<p>A <code>Converse</code> request for which to count tokens. Use this field when you want to count tokens for a conversation-based input that would be sent to the <code>Converse</code> operation.</p>"
2136+
}
2137+
}
2138+
},
2139+
"traits": {
2140+
"smithy.api#documentation": "<p>The input value for token counting. The value should be either an <code>InvokeModel</code> or <code>Converse</code> request body. </p>"
2141+
}
2142+
},
2143+
"com.amazonaws.bedrockruntime#CountTokensRequest": {
2144+
"type": "structure",
2145+
"members": {
2146+
"modelId": {
2147+
"target": "com.amazonaws.bedrockruntime#FoundationModelVersionIdentifier",
2148+
"traits": {
2149+
"smithy.api#documentation": "<p>The unique identifier or ARN of the foundation model to use for token counting. Each model processes tokens differently, so the token count is specific to the model you specify.</p>",
2150+
"smithy.api#httpLabel": {},
2151+
"smithy.api#required": {}
2152+
}
2153+
},
2154+
"input": {
2155+
"target": "com.amazonaws.bedrockruntime#CountTokensInput",
2156+
"traits": {
2157+
"smithy.api#documentation": "<p>The input for which to count tokens. The structure of this parameter depends on whether you're counting tokens for an <code>InvokeModel</code> or <code>Converse</code> request:</p> <ul> <li> <p>For <code>InvokeModel</code> requests, provide the request body in the <code>invokeModel</code> field</p> </li> <li> <p>For <code>Converse</code> requests, provide the messages and system content in the <code>converse</code> field</p> </li> </ul> <p>The input format must be compatible with the model specified in the <code>modelId</code> parameter.</p>",
2158+
"smithy.api#required": {}
2159+
}
2160+
}
2161+
},
2162+
"traits": {
2163+
"smithy.api#input": {}
2164+
}
2165+
},
2166+
"com.amazonaws.bedrockruntime#CountTokensResponse": {
2167+
"type": "structure",
2168+
"members": {
2169+
"inputTokens": {
2170+
"target": "smithy.api#Integer",
2171+
"traits": {
2172+
"smithy.api#documentation": "<p>The number of tokens in the provided input according to the specified model's tokenization rules. This count represents the number of input tokens that would be processed if the same input were sent to the model in an inference request. Use this value to estimate costs and ensure your inputs stay within model token limits.</p>",
2173+
"smithy.api#required": {}
2174+
}
2175+
}
2176+
},
2177+
"traits": {
2178+
"smithy.api#output": {}
2179+
}
2180+
},
20622181
"com.amazonaws.bedrockruntime#DocumentBlock": {
20632182
"type": "structure",
20642183
"members": {
@@ -2324,6 +2443,17 @@
23242443
"smithy.api#documentation": "<p>Contains the content of a document.</p>"
23252444
}
23262445
},
2446+
"com.amazonaws.bedrockruntime#FoundationModelVersionIdentifier": {
2447+
"type": "string",
2448+
"traits": {
2449+
"smithy.api#documentation": "ARN or ID of a Bedrock model",
2450+
"smithy.api#length": {
2451+
"min": 1,
2452+
"max": 256
2453+
},
2454+
"smithy.api#pattern": "^[a-zA-Z_\\.\\-/0-9:]+$"
2455+
}
2456+
},
23272457
"com.amazonaws.bedrockruntime#GetAsyncInvoke": {
23282458
"type": "operation",
23292459
"input": {
@@ -2545,25 +2675,46 @@
25452675
"type": "union",
25462676
"members": {
25472677
"valid": {
2548-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningValidFinding"
2678+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningValidFinding",
2679+
"traits": {
2680+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation determines that the claims in the input are logically valid and definitively true based on the provided premises and policy rules.</p>"
2681+
}
25492682
},
25502683
"invalid": {
2551-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningInvalidFinding"
2684+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningInvalidFinding",
2685+
"traits": {
2686+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation determines that the claims in the input are logically invalid and contradict the established premises or policy rules.</p>"
2687+
}
25522688
},
25532689
"satisfiable": {
2554-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningSatisfiableFinding"
2690+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningSatisfiableFinding",
2691+
"traits": {
2692+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation determines that the claims in the input could be either true or false depending on additional assumptions not provided in the input context.</p>"
2693+
}
25552694
},
25562695
"impossible": {
2557-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningImpossibleFinding"
2696+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningImpossibleFinding",
2697+
"traits": {
2698+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation determines that no valid logical conclusions can be drawn due to contradictions in the premises or policy rules themselves.</p>"
2699+
}
25582700
},
25592701
"translationAmbiguous": {
2560-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationAmbiguousFinding"
2702+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTranslationAmbiguousFinding",
2703+
"traits": {
2704+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation detects that the input has multiple valid logical interpretations, requiring additional context or clarification to proceed with validation.</p>"
2705+
}
25612706
},
25622707
"tooComplex": {
2563-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTooComplexFinding"
2708+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningTooComplexFinding",
2709+
"traits": {
2710+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation cannot process the input due to its complexity or volume exceeding the system's processing capacity for logical analysis.</p>"
2711+
}
25642712
},
25652713
"noTranslations": {
2566-
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningNoTranslationsFinding"
2714+
"target": "com.amazonaws.bedrockruntime#GuardrailAutomatedReasoningNoTranslationsFinding",
2715+
"traits": {
2716+
"smithy.api#documentation": "<p>Contains the result when the automated reasoning evaluation cannot extract any relevant logical information from the input that can be validated against the policy rules.</p>"
2717+
}
25672718
}
25682719
},
25692720
"traits": {
@@ -4775,6 +4926,21 @@
47754926
"smithy.api#output": {}
47764927
}
47774928
},
4929+
"com.amazonaws.bedrockruntime#InvokeModelTokensRequest": {
4930+
"type": "structure",
4931+
"members": {
4932+
"body": {
4933+
"target": "com.amazonaws.bedrockruntime#Body",
4934+
"traits": {
4935+
"smithy.api#documentation": "<p>The request body to count tokens for, formatted according to the model's expected input format. To learn about the input format for different models, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">Model inference parameters and responses</a>.</p>",
4936+
"smithy.api#required": {}
4937+
}
4938+
}
4939+
},
4940+
"traits": {
4941+
"smithy.api#documentation": "<p>The body of an <code>InvokeModel</code> API request for token counting. This structure mirrors the input format for the <code>InvokeModel</code> operation, allowing you to count tokens for raw text inference requests.</p>"
4942+
}
4943+
},
47784944
"com.amazonaws.bedrockruntime#InvokeModelWithBidirectionalStream": {
47794945
"type": "operation",
47804946
"input": {
@@ -6096,6 +6262,14 @@
60966262
"smithy.api#documentation": "<p>The tokens used in a message API inference call. </p>"
60976263
}
60986264
},
6265+
"com.amazonaws.bedrockruntime#TokenizerResource": {
6266+
"type": "resource",
6267+
"operations": [
6268+
{
6269+
"target": "com.amazonaws.bedrockruntime#CountTokens"
6270+
}
6271+
]
6272+
},
60996273
"com.amazonaws.bedrockruntime#Tool": {
61006274
"type": "union",
61016275
"members": {

0 commit comments

Comments
 (0)