mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Add chat_completions to InstanceTogglableFeatures
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
da5f0de153
commit
fe7245af20
6 changed files with 5 additions and 25 deletions
|
@ -45,7 +45,6 @@ use std::path::{Path, PathBuf};
|
|||
use std::sync::{Arc, RwLock};
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::features::FeatureData;
|
||||
use crate::index_mapper::IndexMapper;
|
||||
use crate::utils::clamp_to_page_size;
|
||||
use dump::Dump;
|
||||
|
@ -136,8 +135,6 @@ pub struct IndexSchedulerOptions {
|
|||
pub embedding_cache_cap: usize,
|
||||
/// Snapshot compaction status.
|
||||
pub experimental_no_snapshot_compaction: bool,
|
||||
/// Whether the chat completions are enabled or not.
|
||||
pub experimental_chat_completions: bool,
|
||||
}
|
||||
|
||||
/// Structure which holds meilisearch's indexes and schedules the tasks
|
||||
|
@ -283,11 +280,8 @@ impl IndexScheduler {
|
|||
let queue = Queue::new(&env, &mut wtxn, &options)?;
|
||||
let index_mapper = IndexMapper::new(&env, &mut wtxn, &options, budget)?;
|
||||
let chat_settings = env.create_database(&mut wtxn, Some(CHAT_SETTINGS_DB_NAME))?;
|
||||
|
||||
wtxn.commit()?;
|
||||
|
||||
configure_experimental_features(&env, &features, &options)?;
|
||||
|
||||
// allow unreachable_code to get rids of the warning in the case of a test build.
|
||||
let this = Self {
|
||||
processing_tasks: Arc::new(RwLock::new(ProcessingTasks::new())),
|
||||
|
@ -927,22 +921,6 @@ impl IndexScheduler {
|
|||
}
|
||||
}
|
||||
|
||||
fn configure_experimental_features(
|
||||
env: &Env<WithoutTls>,
|
||||
features: &FeatureData,
|
||||
options: &IndexSchedulerOptions,
|
||||
) -> Result<()> {
|
||||
let current_features = features.features().runtime_features();
|
||||
|
||||
let new_features = RuntimeTogglableFeatures {
|
||||
chat_completions: options.experimental_chat_completions,
|
||||
..current_features
|
||||
};
|
||||
|
||||
let wtxn = env.write_txn().map_err(Error::HeedTransaction)?;
|
||||
features.put_runtime_features(wtxn, new_features)
|
||||
}
|
||||
|
||||
/// The outcome of calling the [`IndexScheduler::tick`] function.
|
||||
pub enum TickOutcome {
|
||||
/// The scheduler should immediately attempt another `tick`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue