Check if modelID includes "claude" for antropic/claude prompt caching (#1284)

This commit is contained in:
Jesse van der Pluijm
2025-07-24 17:31:28 +02:00
committed by GitHub
parent a11999137f
commit 34f6ffe1d7

View File

@@ -3,7 +3,7 @@ import { unique } from "remeda"
export namespace ProviderTransform {
export function message(msgs: ModelMessage[], providerID: string, modelID: string) {
if (providerID === "anthropic" || modelID.includes("anthropic")) {
if (providerID === "anthropic" || modelID.includes("anthropic") || modelID.includes("claude")) {
const system = msgs.filter((msg) => msg.role === "system").slice(0, 2)
const final = msgs.filter((msg) => msg.role !== "system").slice(-2)