Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-10-02 11:16:11 +02:00
parent d7dee3a5ec
commit 8f507c39c0
6 changed files with 776 additions and 2 deletions

View file

@ -2,6 +2,7 @@ package routes
import (
"github.com/gofiber/fiber/v2"
"github.com/gofiber/websocket/v2"
"github.com/mudler/LocalAI/core/application"
"github.com/mudler/LocalAI/core/http/endpoints/localai"
"github.com/mudler/LocalAI/core/http/endpoints/openai"
@ -11,6 +12,9 @@ func RegisterOpenAIRoutes(app *fiber.App,
application *application.Application) {
// openAI compatible API endpoint
// realtime
app.Get("/v1/realtime", websocket.New(openai.RegisterRealtime(cl, ml, appConfig)))
// chat
app.Post("/v1/chat/completions",
openai.ChatEndpoint(