Make the chats settings and chat completions route experimental

This commit is contained in:
Kerollmops 2025-05-30 15:56:57 +02:00 committed by Clément Renault
parent ae135d1d46
commit 3b931e75d9
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
7 changed files with 37 additions and 3 deletions

View file

@ -74,9 +74,6 @@ async fn chat(
search_queue: web::Data<SearchQueue>,
web::Json(chat_completion): web::Json<CreateChatCompletionRequest>,
) -> impl Responder {
// To enable later on, when the feature will be experimental
// index_scheduler.features().check_chat("Using the /chat route")?;
let ChatsParam { workspace_uid } = chats_param.into_inner();
assert_eq!(
@ -317,6 +314,7 @@ async fn non_streamed_chat(
req: HttpRequest,
mut chat_completion: CreateChatCompletionRequest,
) -> Result<HttpResponse, ResponseError> {
index_scheduler.features().check_chat_completions("Using the /chats chat completions route")?;
let filters = index_scheduler.filters();
let rtxn = index_scheduler.read_txn()?;
@ -414,6 +412,7 @@ async fn streamed_chat(
req: HttpRequest,
mut chat_completion: CreateChatCompletionRequest,
) -> Result<impl Responder, ResponseError> {
index_scheduler.features().check_chat_completions("Using the /chats chat completions route")?;
let filters = index_scheduler.filters();
let rtxn = index_scheduler.read_txn()?;