Disable the cache by default and make it experimental

This commit is contained in:
Louis Dureuil 2025-03-13 14:54:31 +01:00
parent 1876132172
commit e2d372823a
No known key found for this signature in database
14 changed files with 101 additions and 34 deletions

View file

@ -176,7 +176,7 @@ pub struct Embedder {
}
impl Embedder {
pub fn new(options: EmbedderOptions) -> Result<Self, NewEmbedderError> {
pub fn new(options: EmbedderOptions, cache_cap: usize) -> Result<Self, NewEmbedderError> {
let mut inferred_api_key = Default::default();
let api_key = options.api_key.as_ref().unwrap_or_else(|| {
inferred_api_key = infer_api_key();
@ -201,6 +201,7 @@ impl Embedder {
}),
headers: Default::default(),
},
cache_cap,
super::rest::ConfigurationSource::OpenAi,
)?;