Skip to content

Commit 918eb4e

Browse files
Version Packages (#401)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ad0c2e1 commit 918eb4e

File tree

3 files changed

+36
-20
lines changed

3 files changed

+36
-20
lines changed

.changeset/fix-system-cache-control.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# @openrouter/ai-sdk-provider
22

3+
## 2.2.0
4+
5+
### Minor Changes
6+
7+
- [#399](https://github.com/OpenRouterTeam/ai-sdk-provider/pull/399) [`ad0c2e1`](https://github.com/OpenRouterTeam/ai-sdk-provider/commit/ad0c2e11ab31fe91e2d1e9ff2f218572f57706be) Thanks [@robert-j-y](https://github.com/robert-j-y)! - Fix system message cache control to use block-level format
8+
9+
When cache control is specified on a system message via `providerOptions`, the content is now converted to array format with `cache_control` on the text block, matching the existing behavior for user messages. This ensures consistent Anthropic prompt caching behavior across all message types.
10+
11+
Before (message-level cache_control):
12+
13+
```json
14+
{
15+
"role": "system",
16+
"content": "...",
17+
"cache_control": { "type": "ephemeral" }
18+
}
19+
```
20+
21+
After (block-level cache_control):
22+
23+
```json
24+
{
25+
"role": "system",
26+
"content": [
27+
{
28+
"type": "text",
29+
"text": "...",
30+
"cache_control": { "type": "ephemeral" }
31+
}
32+
]
33+
}
34+
```
35+
36+
Fixes #389
37+
338
## 2.1.3
439

540
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/ai-sdk-provider",
3-
"version": "2.1.3",
3+
"version": "2.2.0",
44
"license": "Apache-2.0",
55
"pnpm": {
66
"overrides": {

0 commit comments

Comments
 (0)