@wix/evalforge-evaluator 0.199.0 → 0.200.0

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/build/index.js CHANGED
@@ -11021,22 +11021,38 @@ async function executeWithAiSdk(context) {
11021
11021
  ...topLevelExtras,
11022
11022
  model,
11023
11023
  abortSignal: abortController.signal,
11024
- system: systemPrompt,
11025
- ...hasImages ? {
11026
- messages: [
11024
+ // Anthropic prompt caching: the Vercel AI SDK can't attach cache_control
11025
+ // to the top-level `system` string, so the system prompt is sent as a
11026
+ // `system` message carrying an ephemeral cache breakpoint (Anthropic only).
11027
+ // Anthropic renders tools -> system -> messages, so a breakpoint on the
11028
+ // system block caches the tool definitions too — high value for MCP
11029
+ // scenarios that share a large tool set + system prompt across runs.
11030
+ messages: [
11031
+ ...systemPrompt ? [
11027
11032
  {
11028
- role: "user",
11029
- content: [
11030
- { type: "text", text: scenario.triggerPrompt },
11031
- ...triggerPromptImages.map((img) => ({
11032
- type: "image",
11033
- image: img.base64,
11034
- mediaType: img.mediaType
11035
- }))
11036
- ]
11033
+ role: "system",
11034
+ content: systemPrompt,
11035
+ ...isAnthropic ? {
11036
+ providerOptions: {
11037
+ anthropic: {
11038
+ cacheControl: { type: "ephemeral" }
11039
+ }
11040
+ }
11041
+ } : {}
11037
11042
  }
11038
- ]
11039
- } : { prompt: scenario.triggerPrompt },
11043
+ ] : [],
11044
+ {
11045
+ role: "user",
11046
+ content: hasImages ? [
11047
+ { type: "text", text: scenario.triggerPrompt },
11048
+ ...triggerPromptImages.map((img) => ({
11049
+ type: "image",
11050
+ image: img.base64,
11051
+ mediaType: img.mediaType
11052
+ }))
11053
+ ] : scenario.triggerPrompt
11054
+ }
11055
+ ],
11040
11056
  temperature: supportsThinking ? void 0 : cfg.temperature,
11041
11057
  topP: supportsThinking ? void 0 : cfg.topP,
11042
11058
  frequencyPenalty: cfg.frequencyPenalty,