1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-12-02 20:22:52 +00:00

some fixes and display version

This commit is contained in:
Laura
2025-08-11 01:38:16 +02:00
parent d8ded61a09
commit 607e316f69
7 changed files with 145 additions and 12 deletions

View File

@@ -11,6 +11,8 @@ import (
"github.com/go-chi/chi/v5/middleware"
)
const Version = "dev"
var log = logger.New().DetectTerminal().WithOptions(logger.Options{
NoLevel: true,
})
@@ -27,8 +29,11 @@ func main() {
fs := http.FileServer(http.Dir("./static"))
r.Handle("/*", cache(http.StripPrefix("/", fs)))
r.Get("/-/models", func(w http.ResponseWriter, r *http.Request) {
RespondJson(w, http.StatusOK, models)
r.Get("/-/data", func(w http.ResponseWriter, r *http.Request) {
RespondJson(w, http.StatusOK, map[string]any{
"version": Version,
"models": models,
})
})
r.Post("/-/chat", HandleChat)