foundry_cache_clear: Clear the foundryR embedding cache

View source: R/tidymodels.R

foundry_cache_clearR Documentation

Clear the foundryR embedding cache

Description

Delete cached embeddings written by step_foundry_embed() with cache = "disk".

Usage

foundry_cache_clear(cache_dir = NULL)

Arguments

cache_dir

Character. Cache directory. Defaults to the session's temporary embedding cache. Supply the same explicit directory used by step_foundry_embed() to clear a persistent cache.

Value

Invisibly, the number of cache files removed.

Examples

local({
  cache_dir <- tempfile("foundryR-cache-")
  dir.create(cache_dir)
  on.exit(unlink(cache_dir, recursive = TRUE))
  saveRDS(c(1, 0, 0), file.path(cache_dir, "example.rds"))
  foundry_cache_clear(cache_dir)
})

foundryR documentation built on Sept. 25, 2026, 1:10 a.m.