Write a raw API response to the cache, indexed by prompt_hash
Source:R/api_response_cache.R
cache_response.RdIf the cache is disabled, returns NA_character_ without writing.
If a file with the same prompt_hash already exists (i.e., the same request
was made earlier in the run), the write is skipped (deduplication) and
the existing relative path is returned. Otherwise, writes the
raw_response as pretty-printed JSON.
Arguments
- cache
A ResponseCache object from
init_response_cache.- ai_result
The structured list returned by
ai_complete. Must containprompt_hash(used as the key) andraw_response(the payload to cache).