mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00

* docs(swagger): comment LocalAI gallery endpoints and rerankers Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Update core/http/endpoints/jina/rerank.go Co-authored-by: Dave <dave@gray101.com> Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com> * Update core/http/endpoints/jina/rerank.go Co-authored-by: Dave <dave@gray101.com> Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com> * Update core/http/endpoints/localai/gallery.go Co-authored-by: Dave <dave@gray101.com> Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com> * Update core/http/endpoints/localai/gallery.go Co-authored-by: Dave <dave@gray101.com> Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Signed-off-by: Ettore Di Giacinto <mudler@users.noreply.github.com> Co-authored-by: Dave <dave@gray101.com>
66 lines
1.7 KiB
Go
66 lines
1.7 KiB
Go
package schema
|
|
|
|
import (
|
|
gopsutil "github.com/shirou/gopsutil/v3/process"
|
|
)
|
|
|
|
type BackendMonitorRequest struct {
|
|
Model string `json:"model" yaml:"model"`
|
|
}
|
|
|
|
type BackendMonitorResponse struct {
|
|
MemoryInfo *gopsutil.MemoryInfoStat
|
|
MemoryPercent float32
|
|
CPUPercent float64
|
|
}
|
|
|
|
type GalleryResponse struct {
|
|
ID string `json:"uuid"`
|
|
StatusURL string `json:"status"`
|
|
}
|
|
|
|
// @Description TTS request body
|
|
type TTSRequest struct {
|
|
Model string `json:"model" yaml:"model"` // model name or full path
|
|
Input string `json:"input" yaml:"input"` // text input
|
|
Voice string `json:"voice" yaml:"voice"` // voice audio file or speaker id
|
|
Backend string `json:"backend" yaml:"backend"`
|
|
Language string `json:"language,omitempty" yaml:"language,omitempty"` // (optional) language to use with TTS model
|
|
}
|
|
|
|
type StoresSet struct {
|
|
Store string `json:"store,omitempty" yaml:"store,omitempty"`
|
|
|
|
Keys [][]float32 `json:"keys" yaml:"keys"`
|
|
Values []string `json:"values" yaml:"values"`
|
|
}
|
|
|
|
type StoresDelete struct {
|
|
Store string `json:"store,omitempty" yaml:"store,omitempty"`
|
|
|
|
Keys [][]float32 `json:"keys"`
|
|
}
|
|
|
|
type StoresGet struct {
|
|
Store string `json:"store,omitempty" yaml:"store,omitempty"`
|
|
|
|
Keys [][]float32 `json:"keys" yaml:"keys"`
|
|
}
|
|
|
|
type StoresGetResponse struct {
|
|
Keys [][]float32 `json:"keys" yaml:"keys"`
|
|
Values []string `json:"values" yaml:"values"`
|
|
}
|
|
|
|
type StoresFind struct {
|
|
Store string `json:"store,omitempty" yaml:"store,omitempty"`
|
|
|
|
Key []float32 `json:"key" yaml:"key"`
|
|
Topk int `json:"topk" yaml:"topk"`
|
|
}
|
|
|
|
type StoresFindResponse struct {
|
|
Keys [][]float32 `json:"keys" yaml:"keys"`
|
|
Values []string `json:"values" yaml:"values"`
|
|
Similarities []float32 `json:"similarities" yaml:"similarities"`
|
|
}
|