feat(httpapi): 添加模型名称字段并创建查询模型命令工具

- 在 modelResponse 结构体中添加 Name 字段用于返回模型名称
- 实现 handleModels 接口返回模型的名称信息
- 创建 query-models 命令行工具用于查询和展示模型列表
- 实现 IPC 连接和模型数据提取功能
- 添加模型 ID 和场景键识别逻辑
- 支持多种模型字段映射和遍历解析
This commit is contained in:
coolxll
2026-04-04 13:39:45 +08:00
parent 7f35852fd9
commit c49b4b63e7
2 changed files with 153 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ type modelResponse struct {
Object string `json:"object"`
Created int64 `json:"created"`
OwnedBy string `json:"owned_by"`
Name string `json:"name,omitempty"`
}
func NewServer(addr string, svc *service.Service) *Server {
@@ -122,6 +123,7 @@ func (s *Server) handleModels(w http.ResponseWriter, r *http.Request) {
Object: "model",
Created: created,
OwnedBy: "lingma",
Name: model.Name,
})
}
writeJSON(w, http.StatusOK, map[string]any{