Skip to content

Commit 1c575fa

Browse files
author
AWS
committed
Amazon Bedrock Runtime Update: Add Prompt Caching support to Converse and ConverseStream APIs
1 parent 3e65c7e commit 1c575fa

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"type": "feature",
3+
"category": "Amazon Bedrock Runtime",
4+
"contributor": "",
5+
"description": "Add Prompt Caching support to Converse and ConverseStream APIs"
6+
}

services/bedrockruntime/src/main/resources/codegen-resources/service-2.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,21 @@
392392
"min":0,
393393
"sensitive":true
394394
},
395+
"CachePointBlock":{
396+
"type":"structure",
397+
"required":["type"],
398+
"members":{
399+
"type":{
400+
"shape":"CachePointType",
401+
"documentation":"<p>Specifies the type of cache point within the CachePointBlock.</p>"
402+
}
403+
},
404+
"documentation":"<p>Defines a section of content to be cached for reuse in subsequent API calls.</p>"
405+
},
406+
"CachePointType":{
407+
"type":"string",
408+
"enum":["default"]
409+
},
395410
"ConflictException":{
396411
"type":"structure",
397412
"members":{
@@ -435,6 +450,10 @@
435450
"shape":"GuardrailConverseContentBlock",
436451
"documentation":"<p>Contains the content to assess with the guardrail. If you don't specify <code>guardContent</code> in a call to the Converse API, the guardrail (if passed in the Converse API) assesses the entire message.</p> <p>For more information, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>. <pre><code> &lt;/p&gt; </code></pre>"
437452
},
453+
"cachePoint":{
454+
"shape":"CachePointBlock",
455+
"documentation":"<p>CachePoint to include in the message.</p>"
456+
},
438457
"reasoningContent":{
439458
"shape":"ReasoningContentBlock",
440459
"documentation":"<p>Contains content regarding the reasoning that is carried out by the model. Reasoning refers to a Chain of Thought (CoT) that the model generates to enhance the accuracy of its final response.</p>"
@@ -2641,6 +2660,10 @@
26412660
"guardContent":{
26422661
"shape":"GuardrailConverseContentBlock",
26432662
"documentation":"<p>A content block to assess with the guardrail. Use with the <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html\">Converse</a> or <a href=\"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ConverseStream.html\">ConverseStream</a> API operations. </p> <p>For more information, see <i>Use a guardrail with the Converse API</i> in the <i>Amazon Bedrock User Guide</i>.</p>"
2663+
},
2664+
"cachePoint":{
2665+
"shape":"CachePointBlock",
2666+
"documentation":"<p>CachePoint to include in the system prompt.</p>"
26442667
}
26452668
},
26462669
"documentation":"<p>A system content block.</p>",
@@ -2729,10 +2752,28 @@
27292752
"totalTokens":{
27302753
"shape":"TokenUsageTotalTokensInteger",
27312754
"documentation":"<p>The total of input tokens and tokens generated by the model.</p>"
2755+
},
2756+
"cacheReadInputTokens":{
2757+
"shape":"TokenUsageCacheReadInputTokensInteger",
2758+
"documentation":"<p>The number of input tokens read from the cache for the request.</p>"
2759+
},
2760+
"cacheWriteInputTokens":{
2761+
"shape":"TokenUsageCacheWriteInputTokensInteger",
2762+
"documentation":"<p>The number of input tokens written to the cache for the request.</p>"
27322763
}
27332764
},
27342765
"documentation":"<p>The tokens used in a message API inference call. </p>"
27352766
},
2767+
"TokenUsageCacheReadInputTokensInteger":{
2768+
"type":"integer",
2769+
"box":true,
2770+
"min":0
2771+
},
2772+
"TokenUsageCacheWriteInputTokensInteger":{
2773+
"type":"integer",
2774+
"box":true,
2775+
"min":0
2776+
},
27362777
"TokenUsageInputTokensInteger":{
27372778
"type":"integer",
27382779
"box":true,
@@ -2754,6 +2795,10 @@
27542795
"toolSpec":{
27552796
"shape":"ToolSpecification",
27562797
"documentation":"<p>The specfication for the tool.</p>"
2798+
},
2799+
"cachePoint":{
2800+
"shape":"CachePointBlock",
2801+
"documentation":"<p>CachePoint to include in the tool configuration.</p>"
27572802
}
27582803
},
27592804
"documentation":"<p>Information about a tool that you can use with the Converse API. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html\">Tool use (function calling)</a> in the Amazon Bedrock User Guide.</p>",

0 commit comments

Comments
 (0)