Skip to content

Commit c5cea55

Browse files
committed
Update services based on release-2025-08-20 of AWS Go SDK
Reference: https://github.com/aws/aws-sdk-go-v2/releases/tag/release-2025-08-20
1 parent ef5b9c0 commit c5cea55

File tree

8 files changed

+669
-111
lines changed

8 files changed

+669
-111
lines changed

.latest-tag-aws-sdk-go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
release-2025-08-19
1+
release-2025-08-20

lib/aws/generated/bedrock_runtime.ex

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ defmodule AWS.BedrockRuntime do
1111

1212
@typedoc """
1313
14+
## Example:
15+
16+
count_tokens_response() :: %{
17+
"inputTokens" => [integer()]
18+
}
19+
20+
"""
21+
@type count_tokens_response() :: %{(String.t() | atom()) => any()}
22+
23+
@typedoc """
24+
1425
## Example:
1526
1627
guardrail_automated_reasoning_rule() :: %{
@@ -176,6 +187,18 @@ defmodule AWS.BedrockRuntime do
176187

177188
@typedoc """
178189
190+
## Example:
191+
192+
converse_tokens_request() :: %{
193+
"messages" => list(message()),
194+
"system" => list(list())
195+
}
196+
197+
"""
198+
@type converse_tokens_request() :: %{(String.t() | atom()) => any()}
199+
200+
@typedoc """
201+
179202
## Example:
180203
181204
any_tool_choice() :: %{}
@@ -283,6 +306,17 @@ defmodule AWS.BedrockRuntime do
283306

284307
@typedoc """
285308
309+
## Example:
310+
311+
count_tokens_request() :: %{
312+
required("input") => list()
313+
}
314+
315+
"""
316+
@type count_tokens_request() :: %{(String.t() | atom()) => any()}
317+
318+
@typedoc """
319+
286320
## Example:
287321
288322
citations_content_block() :: %{
@@ -1329,6 +1363,17 @@ defmodule AWS.BedrockRuntime do
13291363

13301364
@typedoc """
13311365
1366+
## Example:
1367+
1368+
invoke_model_tokens_request() :: %{
1369+
"body" => binary()
1370+
}
1371+
1372+
"""
1373+
@type invoke_model_tokens_request() :: %{(String.t() | atom()) => any()}
1374+
1375+
@typedoc """
1376+
13321377
## Example:
13331378
13341379
guardrail_pii_entity_filter() :: %{
@@ -1495,6 +1540,14 @@ defmodule AWS.BedrockRuntime do
14951540
| resource_not_found_exception()
14961541
| model_not_ready_exception()
14971542

1543+
@type count_tokens_errors() ::
1544+
throttling_exception()
1545+
| validation_exception()
1546+
| access_denied_exception()
1547+
| internal_server_exception()
1548+
| service_unavailable_exception()
1549+
| resource_not_found_exception()
1550+
14981551
@type get_async_invoke_errors() ::
14991552
throttling_exception()
15001553
| validation_exception()
@@ -1771,6 +1824,65 @@ defmodule AWS.BedrockRuntime do
17711824
)
17721825
end
17731826

1827+
@doc """
1828+
Returns the token count for a given inference request.
1829+
1830+
This operation helps you estimate token usage before sending requests to
1831+
foundation models by returning the token count that would be used if the same
1832+
input were sent to the model in an inference request.
1833+
1834+
Token counting is model-specific because different models use different
1835+
tokenization strategies. The token count returned by this operation will match
1836+
the token count that would be charged if the same input were sent to the model
1837+
in an `InvokeModel` or `Converse` request.
1838+
1839+
You can use this operation to:
1840+
1841+
* Estimate costs before sending inference requests.
1842+
1843+
* Optimize prompts to fit within token limits.
1844+
1845+
* Plan for token usage in your applications.
1846+
1847+
This operation accepts the same input formats as `InvokeModel` and `Converse`,
1848+
allowing you to count tokens for both raw text inputs and structured
1849+
conversation formats.
1850+
1851+
The following operations are related to `CountTokens`:
1852+
1853+
*
1854+
[InvokeModel](https://docs.aws.amazon.com/bedrock/latest/API/API_runtime_InvokeModel.html) - Sends inference requests to foundation models
1855+
1856+
*
1857+
[Converse](https://docs.aws.amazon.com/bedrock/latest/API/API_runtime_Converse.html)
1858+
- Sends conversation-based inference requests to foundation models
1859+
"""
1860+
@spec count_tokens(map(), String.t() | atom(), count_tokens_request(), list()) ::
1861+
{:ok, count_tokens_response(), any()}
1862+
| {:error, {:unexpected_response, any()}}
1863+
| {:error, term()}
1864+
| {:error, count_tokens_errors()}
1865+
def count_tokens(%Client{} = client, model_id, input, options \\ []) do
1866+
url_path = "/model/#{AWS.Util.encode_uri(model_id)}/count-tokens"
1867+
headers = []
1868+
custom_headers = []
1869+
query_params = []
1870+
1871+
meta = metadata()
1872+
1873+
Request.request_rest(
1874+
client,
1875+
meta,
1876+
:post,
1877+
url_path,
1878+
query_params,
1879+
custom_headers ++ headers,
1880+
input,
1881+
options,
1882+
200
1883+
)
1884+
end
1885+
17741886
@doc """
17751887
Retrieve information about an asynchronous invocation.
17761888
"""

lib/aws/generated/billing.ex

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
defmodule AWS.Billing do
55
@moduledoc """
6-
76
You can use the Billing API to programatically list the billing views available
87
to you for a given time period.
98
@@ -536,7 +535,6 @@ defmodule AWS.Billing do
536535
end
537536

538537
@doc """
539-
540538
Creates a billing view with the specified billing view attributes.
541539
"""
542540
@spec create_billing_view(map(), create_billing_view_request(), list()) ::
@@ -646,7 +644,6 @@ defmodule AWS.Billing do
646644
end
647645

648646
@doc """
649-
650647
An API operation for adding one or more tags (key-value pairs) to a resource.
651648
"""
652649
@spec tag_resource(map(), tag_resource_request(), list()) ::
@@ -661,7 +658,6 @@ defmodule AWS.Billing do
661658
end
662659

663660
@doc """
664-
665661
Removes one or more tags from a resource.
666662
667663
Specify only tag keys in your request. Don't specify the value.

0 commit comments

Comments
 (0)