import { C as streamWithPayloadPatch } from "./provider-stream-shared-CmiFKfvZ.js";
import { t as applyAnthropicEphemeralCacheControlMarkers } from "./anthropic-payload-policy-CTCiMy6R.js";
import "./provider-stream-BkuUOaiU.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 };
