Change the /chat route to /chat/completions to be OpenAI-compatible

This commit is contained in:
Clément Renault 2025-05-20 10:14:56 +02:00
parent 39320a6fce
commit 1a84f00fbf
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -42,7 +42,7 @@ use crate::search_queue::SearchQueue;
const EMBEDDER_NAME: &str = "openai"; const EMBEDDER_NAME: &str = "openai";
pub fn configure(cfg: &mut web::ServiceConfig) { pub fn configure(cfg: &mut web::ServiceConfig) {
cfg.service(web::resource("").route(web::post().to(chat))); cfg.service(web::resource("/completions").route(web::post().to(chat)));
} }
/// Get a chat completion /// Get a chat completion