Skip to content

Commit f3c1f40

Browse files
Fix documentation issues in prompt-caching examples
- Update package.json scripts to use correct anthropic- prefixed filenames - Fix file path references in comments and README - Fix model name consistency (claude-3.5-sonnet → claude-3-5-sonnet) - Update README to reference directory instead of single file
1 parent a4936cb commit f3c1f40

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

typescript/ai-sdk-v5/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bun examples
2020

2121
## Features
2222

23-
- [prompt-caching.ts](./src/prompt-caching.ts) - Anthropic caching with AI SDK v5
23+
- [prompt-caching](./src/prompt-caching/) - Anthropic caching examples with AI SDK v5
2424

2525
### Key Configuration
2626

typescript/ai-sdk-v5/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"examples": "bun run src/prompt-caching/user-message-cache.ts && bun run src/prompt-caching/multi-message-cache.ts && bun run src/prompt-caching/no-cache-control.ts",
7+
"examples": "bun run src/prompt-caching/anthropic-user-message-cache.ts && bun run src/prompt-caching/anthropic-multi-message-cache.ts && bun run src/prompt-caching/anthropic-no-cache-control.ts",
88
"typecheck": "tsc --noEmit"
99
},
1010
"dependencies": {

typescript/ai-sdk-v5/src/prompt-caching/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ For full prompt caching documentation including all providers, pricing, and conf
99

1010
## Examples in This Directory
1111

12-
- `user-message-cache.ts` - Cache large context in user messages
13-
- `multi-message-cache.ts` - Cache system prompt across multi-turn conversations
14-
- `no-cache-control.ts` - Control scenario (validates methodology)
12+
- `anthropic-user-message-cache.ts` - Cache large context in user messages
13+
- `anthropic-multi-message-cache.ts` - Cache system prompt across multi-turn conversations
14+
- `anthropic-no-cache-control.ts` - Control scenario (validates methodology)
1515

1616
## Quick Start
1717

1818
```bash
1919
# Run an example
20-
bun run typescript/ai-sdk-v5/src/prompt-caching/user-message-cache.ts
20+
bun run typescript/ai-sdk-v5/src/prompt-caching/anthropic-user-message-cache.ts
2121
```
2222

2323
## AI SDK v5 Usage
@@ -33,7 +33,7 @@ const openrouter = createOpenRouter({
3333

3434
// Use providerOptions.openrouter.cacheControl on content items
3535
const result = await generateText({
36-
model: openrouter('anthropic/claude-3.5-sonnet'),
36+
model: openrouter('anthropic/claude-3-5-sonnet'),
3737
messages: [{
3838
role: 'user',
3939
content: [{

typescript/ai-sdk-v5/src/prompt-caching/anthropic-user-message-cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* - **MUST** include extraBody: { stream_options: { include_usage: true } }
1313
* - Without this, usage details (including cached_tokens) are not populated
1414
*
15-
* To run: bun run typescript/ai-sdk-v5/src/prompt-caching/user-message-cache.ts
15+
* To run: bun run typescript/ai-sdk-v5/src/prompt-caching/anthropic-user-message-cache.ts
1616
*/
1717

1818
import { LARGE_SYSTEM_PROMPT } from '@openrouter-examples/shared/constants';

0 commit comments

Comments
 (0)