|
@@ -13,22 +13,15 @@ export namespace ProviderTransform {
|
|
|
anthropic: {
|
|
anthropic: {
|
|
|
cacheControl: { type: "ephemeral" },
|
|
cacheControl: { type: "ephemeral" },
|
|
|
},
|
|
},
|
|
|
- openaiCompatible: {
|
|
|
|
|
|
|
+ openrouter: {
|
|
|
cache_control: { type: "ephemeral" },
|
|
cache_control: { type: "ephemeral" },
|
|
|
},
|
|
},
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (providerID === "amazon-bedrock" || modelID.includes("anthropic")) {
|
|
|
|
|
- const system = msgs.filter((msg) => msg.role === "system").slice(0, 2)
|
|
|
|
|
- const final = msgs.filter((msg) => msg.role !== "system").slice(-2)
|
|
|
|
|
-
|
|
|
|
|
- for (const msg of unique([...system, ...final])) {
|
|
|
|
|
- msg.providerOptions = {
|
|
|
|
|
- ...msg.providerOptions,
|
|
|
|
|
bedrock: {
|
|
bedrock: {
|
|
|
cachePoint: { type: "ephemeral" },
|
|
cachePoint: { type: "ephemeral" },
|
|
|
},
|
|
},
|
|
|
|
|
+ openaiCompatible: {
|
|
|
|
|
+ cache_control: { type: "ephemeral" },
|
|
|
|
|
+ },
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|