We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5394854 commit 5972e59Copy full SHA for 5972e59
packages/agent/src/core/llm/providers/anthropic.ts
@@ -57,13 +57,16 @@ function addCacheControlToMessages(
57
if (typeof m.content === 'string') {
58
return {
59
...m,
60
- content: [
61
- {
62
- type: 'text',
63
- text: m.content,
64
- cache_control: { type: 'ephemeral' },
65
- },
66
- ],
+ content:
+ i >= messages.length - 2
+ ? [
+ {
+ type: 'text',
+ text: m.content,
+ cache_control: { type: 'ephemeral' },
67
+ },
68
+ ]
69
+ : m.content,
70
};
71
}
72
0 commit comments