MCPcopy
hub / github.com/Effect-TS/effect / getCacheControl

Function getCacheControl

packages/ai/openrouter/src/OpenRouterLanguageModel.ts:1097–1107  ·  view source on GitHub ↗
(
  part:
    | Prompt.SystemMessage
    | Prompt.UserMessage
    | Prompt.AssistantMessage
    | Prompt.ToolMessage
    | Prompt.TextPart
    | Prompt.ReasoningPart
    | Prompt.FilePart
    | Prompt.ToolResultPart
)

Source from the content-addressed store, hash-verified

1095// =============================================================================
1096
1097const getCacheControl = (
1098 part:
1099 | Prompt.SystemMessage
1100 | Prompt.UserMessage
1101 | Prompt.AssistantMessage
1102 | Prompt.ToolMessage
1103 | Prompt.TextPart
1104 | Prompt.ReasoningPart
1105 | Prompt.FilePart
1106 | Prompt.ToolResultPart
1107): typeof Generated.CacheControlEphemeral.Encoded | undefined => part.options.openrouter?.cacheControl
1108
1109const getMediaType = (dataUrl: string): string | undefined => {
1110 const match = dataUrl.match(/^data:([^;]+)/)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected