From d91416f766bddec7bac17e28f6462fda47bde429 Mon Sep 17 00:00:00 2001 From: Javi Pacheco Date: Tue, 29 Aug 2023 16:56:30 +0200 Subject: [PATCH] OpenAIToken env var is not necessary in the endpoint --- .../xebia/functional/xef/server/http/routes/Routes.kt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt b/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt index 639355476..d633b5a36 100644 --- a/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt +++ b/server/src/main/kotlin/com/xebia/functional/xef/server/http/routes/Routes.kt @@ -53,19 +53,9 @@ fun Routing.routes( authenticate("auth-bearer") { post("/chat/completions") { - val provider: Provider = call.getProvider() val token = call.getToken() - val scope = Conversation(persistenceService.getVectorStore(provider, token)) val context = call.receive() val data = Json.decodeFromString(context) - if (!data.containsKey("model")) { - call.respondText("No model found", status = HttpStatusCode.BadRequest) - return@post - } - val model: OpenAIModel = data["model"]?.jsonPrimitive?.content?.toOpenAIModel(token) ?: run { - call.respondText("No model found", status = HttpStatusCode.BadRequest) - return@post - } val isStream = data["stream"]?.jsonPrimitive?.boolean ?: false