@bluecopa/harness 0.1.0-snapshot.15 → 0.1.0-snapshot.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -170,9 +170,9 @@ export interface VercelAgentLoopConfig {
|
|
|
170
170
|
export class VercelAgentLoop implements AgentLoop {
|
|
171
171
|
private readonly model: string;
|
|
172
172
|
private readonly systemPrompt: string;
|
|
173
|
-
/** System prompt
|
|
173
|
+
/** System prompt with Anthropic cache_control for prompt caching. */
|
|
174
174
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
175
|
-
private readonly
|
|
175
|
+
private readonly cachedSystem: any;
|
|
176
176
|
private readonly tools: Record<string, AnyTool>;
|
|
177
177
|
private readonly validToolNames: Set<string>;
|
|
178
178
|
|
|
@@ -192,10 +192,10 @@ export class VercelAgentLoop implements AgentLoop {
|
|
|
192
192
|
'When the task is fully complete, respond with a brief text summary (no tool call).',
|
|
193
193
|
].join(' ');
|
|
194
194
|
|
|
195
|
-
//
|
|
196
|
-
this.
|
|
197
|
-
|
|
198
|
-
|
|
195
|
+
// SystemModelMessage format with Anthropic cache_control
|
|
196
|
+
this.cachedSystem = [{
|
|
197
|
+
role: 'system' as const,
|
|
198
|
+
content: this.systemPrompt,
|
|
199
199
|
providerOptions: { anthropic: { cacheControl: { type: 'ephemeral' } } },
|
|
200
200
|
}];
|
|
201
201
|
|
|
@@ -214,7 +214,7 @@ export class VercelAgentLoop implements AgentLoop {
|
|
|
214
214
|
model: anthropic(this.model),
|
|
215
215
|
tools: this.tools,
|
|
216
216
|
toolChoice: 'auto',
|
|
217
|
-
system: this.
|
|
217
|
+
system: this.cachedSystem,
|
|
218
218
|
messages: toModelMessages(messages),
|
|
219
219
|
stopWhen: stepCountIs(1),
|
|
220
220
|
});
|
|
@@ -263,7 +263,7 @@ export class VercelAgentLoop implements AgentLoop {
|
|
|
263
263
|
model: anthropic(this.model),
|
|
264
264
|
tools: this.tools,
|
|
265
265
|
toolChoice: 'auto',
|
|
266
|
-
system: this.
|
|
266
|
+
system: this.cachedSystem,
|
|
267
267
|
messages: toModelMessages(messages),
|
|
268
268
|
stopWhen: stepCountIs(1),
|
|
269
269
|
});
|