Application result caching reuses an answer, which makes its key part of the authorization and freshness boundary. Two tenants asking the same words must not share a private result. Include the prompt and source revisions so an updated policy cannot reuse an obsolete answer.
Return a stable JSON string for tenant, prompt_revision, source_revision and normalized query. Normalize query by lowercasing and collapsing whitespace. Use sorted JSON object keys and compact separators. This is application result caching, not a provider prompt-cache API.
The notebook executes your Python against an original local mock. Use the supplied case rather than copying visible values. The hidden checks change identities, revisions and boundary inputs; no provider endpoint or external tool is contacted.
An example implementation of the function contract.