Row-proxy / internal /handler /models.go
ss22345's picture
refactor: split internal package into domain-based sub-packages
48d903a
raw
history blame
490 Bytes
package handler
import (
"encoding/json"
"net/http"
"zai-proxy/internal/model"
)
func HandleModels(w http.ResponseWriter, r *http.Request) {
var models []model.ModelInfo
for _, id := range model.ModelList {
models = append(models, model.ModelInfo{
ID: id,
Object: "model",
OwnedBy: "z.ai",
})
}
response := model.ModelsResponse{
Object: "list",
Data: models,
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(response)
}