A memoised version of call_llm
to avoid repeated identical requests.
Arguments
- config
An
llm_config
object 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
memoise
package. Addmemoise
to your package's DESCRIPTION.Clearing the cache can be done via
memoise::forget(cache_llm_call)
or by restarting your R session.