2024-06-01 18:26:27 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
import (
|
2024-07-15 06:31:38 +00:00
|
|
|
"github.com/mudler/LocalAI/core/p2p"
|
2024-06-01 18:26:27 +00:00
|
|
|
gopsutil "github.com/shirou/gopsutil/v3/process"
|
|
|
|
)
|
|
|
|
|
|
|
|
type BackendMonitorRequest struct {
|
|
|
|
Model string `json:"model" yaml:"model"`
|
|
|
|
}
|
|
|
|
|
2024-10-01 12:41:20 +00:00
|
|
|
type TokenMetricsRequest struct {
|
|
|
|
Model string `json:"model" yaml:"model"`
|
|
|
|
}
|
|
|
|
|
2024-06-01 18:26:27 +00:00
|
|
|
type BackendMonitorResponse struct {
|
|
|
|
MemoryInfo *gopsutil.MemoryInfoStat
|
|
|
|
MemoryPercent float32
|
|
|
|
CPUPercent float64
|
|
|
|
}
|
|
|
|
|
2024-07-14 03:46:42 +00:00
|
|
|
type GalleryResponse struct {
|
|
|
|
ID string `json:"uuid"`
|
|
|
|
StatusURL string `json:"status"`
|
|
|
|
}
|
|
|
|
|
2024-06-01 18:26:27 +00:00
|
|
|
// @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"`
|
2024-11-20 13:48:40 +00:00
|
|
|
Language string `json:"language,omitempty" yaml:"language,omitempty"` // (optional) language to use with TTS model
|
2024-11-02 19:13:35 +00:00
|
|
|
Format string `json:"response_format,omitempty" yaml:"response_format,omitempty"` // (optional) output format
|
2024-06-01 18:26:27 +00:00
|
|
|
}
|
|
|
|
|
2024-11-20 13:48:40 +00:00
|
|
|
// @Description VAD request body
|
|
|
|
type VADRequest struct {
|
|
|
|
Model string `json:"model" yaml:"model"` // model name or full path
|
|
|
|
Audio []float32 `json:"audio" yaml:"audio"` // model name or full path
|
|
|
|
}
|
|
|
|
|
2024-06-01 18:26:27 +00:00
|
|
|
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"`
|
|
|
|
}
|
2024-07-15 06:31:38 +00:00
|
|
|
|
|
|
|
type P2PNodesResponse struct {
|
|
|
|
Nodes []p2p.NodeData `json:"nodes" yaml:"nodes"`
|
|
|
|
FederatedNodes []p2p.NodeData `json:"federated_nodes" yaml:"federated_nodes"`
|
|
|
|
}
|
2024-09-05 18:44:30 +00:00
|
|
|
|
2024-11-14 13:12:29 +00:00
|
|
|
type SysInfoModel struct {
|
|
|
|
ID string `json:"id"`
|
|
|
|
}
|
|
|
|
|
2024-09-05 18:44:30 +00:00
|
|
|
type SystemInformationResponse struct {
|
2024-11-14 13:12:29 +00:00
|
|
|
Backends []string `json:"backends"`
|
|
|
|
Models []SysInfoModel `json:"loaded_models"`
|
2024-09-05 18:44:30 +00:00
|
|
|
}
|