openai: don't pass apiKey when it is empty

This commit is contained in:
Louis Dureuil 2024-07-30 15:44:19 +02:00
parent 25791e3f46
commit 9b7764575b
No known key found for this signature in database

View File

@ -183,7 +183,7 @@ impl Embedder {
let rest_embedder = RestEmbedder::new(
RestEmbedderOptions {
api_key: Some(api_key.clone()),
api_key: (!api_key.is_empty()).then(|| api_key.clone()),
distribution: None,
dimensions: Some(options.dimensions()),
url,