Change summary
assets/settings/default.json | 5 ++---
crates/vector_store/src/vector_store.rs | 6 +++---
crates/vector_store/src/vector_store_settings.rs | 6 ++----
3 files changed, 7 insertions(+), 10 deletions(-)
Detailed changes
@@ -293,9 +293,8 @@
},
// Difference settings for vector_store
"vector_store": {
- "enable": false,
- "reindexing_delay_seconds": 600,
- "embedding_batch_size": 150
+ "enabled": false,
+ "reindexing_delay_seconds": 600
},
// Different settings for specific languages.
"languages": {
@@ -37,6 +37,7 @@ use util::{
use workspace::{Workspace, WorkspaceCreated};
const VECTOR_STORE_VERSION: usize = 0;
+const EMBEDDINGS_BATCH_SIZE: usize = 150;
pub fn init(
fs: Arc<dyn Fs>,
@@ -70,7 +71,7 @@ pub fn init(
);
if *RELEASE_CHANNEL == ReleaseChannel::Stable
- || !settings::get::<VectorStoreSettings>(cx).enable
+ || !settings::get::<VectorStoreSettings>(cx).enabled
{
return;
}
@@ -353,7 +354,6 @@ impl VectorStore {
});
// batch_tx/rx: Batch Files to Send for Embeddings
- let batch_size = settings::get::<VectorStoreSettings>(cx).embedding_batch_size;
let (batch_files_tx, batch_files_rx) = channel::unbounded::<EmbeddingJob>();
let _batch_files_task = cx.background().spawn(async move {
let mut queue_len = 0;
@@ -368,7 +368,7 @@ impl VectorStore {
} => {
queue_len += &document_spans.len();
embeddings_queue.push((worktree_id, parsed_file, document_spans));
- queue_len >= batch_size
+ queue_len >= EMBEDDINGS_BATCH_SIZE
}
EmbeddingJob::Flush => true,
};
@@ -5,16 +5,14 @@ use settings::Setting;
#[derive(Deserialize, Debug)]
pub struct VectorStoreSettings {
- pub enable: bool,
+ pub enabled: bool,
pub reindexing_delay_seconds: usize,
- pub embedding_batch_size: usize,
}
#[derive(Clone, Default, Serialize, Deserialize, JsonSchema, Debug)]
pub struct VectorStoreSettingsContent {
- pub enable: Option<bool>,
+ pub enabled: Option<bool>,
pub reindexing_delay_seconds: Option<usize>,
- pub embedding_batch_size: Option<usize>,
}
impl Setting for VectorStoreSettings {