Skip to content

Commit 0f2b75f

Browse files
committed
Add requirements.txt and update boto3 minimum to 1.42.0
TTL support in cachePoint requires boto3 >= 1.42.0 (older versions lack the ttl field in CachePointBlock). Consolidated dependency into a single requirements.txt and updated all README/notebook references.
1 parent feee008 commit 0f2b75f

File tree

13 files changed

+13
-12
lines changed

13 files changed

+13
-12
lines changed

introduction-to-bedrock/prompt-caching/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The **Converse API** `cachePoint` syntax is identical across all model families.
6060

6161
- AWS account with Amazon Bedrock access
6262
- Model access enabled for the target model
63-
- Python 3.9+ with `boto3 >= 1.35.76`
63+
- Python 3.9+ with dependencies: `pip install -r requirements.txt`
6464
- AWS credentials configured (default profile or environment variables)
6565

6666
## Additional Resources

introduction-to-bedrock/prompt-caching/converse_api/notebooks/02_system_prompt_caching.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"id": "intro",
66
"metadata": {},
7-
"source": "# System Prompt Caching — Converse API\n\nThis notebook demonstrates how to cache system prompts — persona definitions, guidelines, and domain knowledge that stay constant across multiple user messages — using the **Converse** and **ConverseStream** APIs.\n\n## What you'll learn\n\n- **Converse API**: Cache system prompts using `cachePoint` in the `system` parameter\n- **ConverseStream API**: Same syntax with streaming response parsing\n- Practical pattern: same cached persona, varying user queries\n\n## Prerequisites\n\n- AWS credentials configured (default profile)\n- Access to Claude Sonnet 4.6 on Amazon Bedrock\n- `boto3 >= 1.35.76`\n\n## Token threshold\n\nClaude Sonnet 4.6 requires at least **2,048 tokens** per cache checkpoint."
7+
"source": "# System Prompt Caching — Converse API\n\nThis notebook demonstrates how to cache system prompts — persona definitions, guidelines, and domain knowledge that stay constant across multiple user messages — using the **Converse** and **ConverseStream** APIs.\n\n## What you'll learn\n\n- **Converse API**: Cache system prompts using `cachePoint` in the `system` parameter\n- **ConverseStream API**: Same syntax with streaming response parsing\n- Practical pattern: same cached persona, varying user queries\n\n## Prerequisites\n\n- AWS credentials configured (default profile)\n- Access to Claude Sonnet 4.6 on Amazon Bedrock\n- `boto3 >= 1.42.0`\n\n## Token threshold\n\nClaude Sonnet 4.6 requires at least **2,048 tokens** per cache checkpoint."
88
},
99
{
1010
"cell_type": "code",

introduction-to-bedrock/prompt-caching/converse_api/notebooks/03_tool_definition_caching.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"\n",
3131
"- AWS credentials configured (default profile)\n",
3232
"- Access to Claude Sonnet 4.6 on Amazon Bedrock\n",
33-
"- `boto3 >= 1.35.76`\n",
33+
"- `boto3 >= 1.42.0`\n",
3434
"\n",
3535
"## Token threshold\n",
3636
"\n",

introduction-to-bedrock/prompt-caching/converse_api/notebooks/04_mixed_ttl_caching.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"\n",
2525
"- AWS credentials configured (default profile)\n",
2626
"- Access to Claude Sonnet 4.6 on Amazon Bedrock\n",
27-
"- `boto3 >= 1.35.76`\n",
27+
"- `boto3 >= 1.42.0`\n",
2828
"\n",
2929
"## Token threshold\n",
3030
"\n",

introduction-to-bedrock/prompt-caching/converse_api/notebooks/05_tenant_isolation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"\n",
2929
"- AWS credentials configured (default profile)\n",
3030
"- Access to Claude Sonnet 4.6 on Amazon Bedrock\n",
31-
"- `boto3 >= 1.35.76`"
31+
"- `boto3 >= 1.42.0`"
3232
]
3333
},
3434
{

introduction-to-bedrock/prompt-caching/converse_api/notebooks/06_langchain_integration.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"\n",
2020
"- AWS credentials configured (default profile)\n",
2121
"- Access to Claude Sonnet 4.6 on Amazon Bedrock\n",
22-
"- `langchain-aws >= 0.2.12`, `boto3 >= 1.35.76`"
22+
"- `langchain-aws >= 0.2.12`, `boto3 >= 1.42.0`"
2323
]
2424
},
2525
{

introduction-to-bedrock/prompt-caching/converse_api/scripts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Modify these values as needed before running. The `cachePoint` syntax is model-a
4646
## Requirements
4747

4848
- Python 3.9+
49-
- `boto3 >= 1.35.76`
49+
- `pip install -r ../../requirements.txt`
5050
- AWS credentials configured for the specified profile
5151
- Access to the specified model on Amazon Bedrock
5252

introduction-to-bedrock/prompt-caching/invoke_model_api/anthropic/notebooks/01_message_content_caching.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"\n",
2929
"- AWS credentials configured (default profile)\n",
3030
"- Access to Claude Sonnet 4.6 on Amazon Bedrock\n",
31-
"- `boto3 >= 1.35.76`\n",
31+
"- `boto3 >= 1.42.0`\n",
3232
"\n",
3333
"## Token threshold\n",
3434
"\n",

introduction-to-bedrock/prompt-caching/invoke_model_api/anthropic/notebooks/02_system_prompt_caching.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cell_type": "markdown",
55
"id": "intro",
66
"metadata": {},
7-
"source": "# System Prompt Caching — InvokeModel API (Anthropic)\n\nThis notebook demonstrates how to cache system prompts using the **InvokeModel** and **InvokeModelWithResponseStream** APIs with Anthropic Claude's native `cache_control` syntax.\n\n## What you'll learn\n\n- **InvokeModel API**: Cache system prompts using `cache_control` in the `system` array\n- **InvokeModelWithResponseStream**: Same syntax with streaming response parsing\n- Practical pattern: same cached persona, varying user queries\n\n## Anthropic-specific syntax\n\n```python\n\"system\": [{\n \"type\": \"text\",\n \"text\": \"<system prompt>\",\n \"cache_control\": {\"type\": \"ephemeral\", \"ttl\": \"5m\"}\n}]\n```\n\nFor the model-agnostic Converse API syntax (`cachePoint`), see [converse_api/](../../converse_api/).\n\n## Prerequisites\n\n- AWS credentials configured (default profile)\n- Access to Claude Sonnet 4.6 on Amazon Bedrock\n- `boto3 >= 1.35.76`\n\n## Token threshold\n\nClaude Sonnet 4.6 requires at least **2,048 tokens** per cache checkpoint."
7+
"source": "# System Prompt Caching — InvokeModel API (Anthropic)\n\nThis notebook demonstrates how to cache system prompts using the **InvokeModel** and **InvokeModelWithResponseStream** APIs with Anthropic Claude's native `cache_control` syntax.\n\n## What you'll learn\n\n- **InvokeModel API**: Cache system prompts using `cache_control` in the `system` array\n- **InvokeModelWithResponseStream**: Same syntax with streaming response parsing\n- Practical pattern: same cached persona, varying user queries\n\n## Anthropic-specific syntax\n\n```python\n\"system\": [{\n \"type\": \"text\",\n \"text\": \"<system prompt>\",\n \"cache_control\": {\"type\": \"ephemeral\", \"ttl\": \"5m\"}\n}]\n```\n\nFor the model-agnostic Converse API syntax (`cachePoint`), see [converse_api/](../../converse_api/).\n\n## Prerequisites\n\n- AWS credentials configured (default profile)\n- Access to Claude Sonnet 4.6 on Amazon Bedrock\n- `boto3 >= 1.42.0`\n\n## Token threshold\n\nClaude Sonnet 4.6 requires at least **2,048 tokens** per cache checkpoint."
88
},
99
{
1010
"cell_type": "code",

introduction-to-bedrock/prompt-caching/invoke_model_api/anthropic/notebooks/03_tool_definition_caching.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"\n",
3131
"- AWS credentials configured (default profile)\n",
3232
"- Access to Claude Sonnet 4.6 on Amazon Bedrock\n",
33-
"- `boto3 >= 1.35.76`\n",
33+
"- `boto3 >= 1.42.0`\n",
3434
"\n",
3535
"## Token threshold\n",
3636
"\n",

0 commit comments

Comments
 (0)