import { S as streamWithPayloadPatch } from "./provider-stream-shared-CTxmQWZX.js";
import { t as applyAnthropicEphemeralCacheControlMarkers } from "./anthropic-payload-policy-IuWp16to.js";
import "./provider-stream-RD7gb64z.js";
//#region extensions/deepinfra/cache-wrapper.ts
function createDeepInfraAnthropicCacheWrapper(baseStreamFn) {
	return ((model, context, options) => {
		const modelIdRaw = model.id;
		if (!(typeof modelIdRaw === "string" ? modelIdRaw.toLowerCase() : "").startsWith("anthropic/")) return baseStreamFn(model, context, options);
		return streamWithPayloadPatch(baseStreamFn, model, context, options, (payload) => {
			applyAnthropicEphemeralCacheControlMarkers(payload);
		});
	});
}
//#endregion
export { createDeepInfraAnthropicCacheWrapper as t };
