A memoised version of call_llm to avoid repeated identical requests.
Arguments
- config
An
llm_configobject fromllm_config.- messages
A list of message objects or character vector for embeddings.
- verbose
Logical. If TRUE, prints the full API response (passed to
call_llm).
Value
The (memoised) response object from call_llm.
Details
Requires the
memoisepackage. Addmemoiseto your package's DESCRIPTION.Clearing the cache can be done via
memoise::forget(cache_llm_call)or by restarting your R session.