Go CLI: admin model framework (#16252)

This commit is contained in:
Jin Hai
2026-06-23 16:57:05 +08:00
committed by GitHub
parent 2362210caf
commit dec2ce4a60
12 changed files with 1279 additions and 355 deletions

View File

@@ -558,7 +558,8 @@ func (h *ProviderHandler) ShowTask(c *gin.Context) {
}
type AlterProviderInstanceRequest struct {
LLMName string `json:"llm_name" binding:"required"`
ModelName string `json:"model_name"`
APIKey string `json:"api_key"`
}
func (h *ProviderHandler) AlterProviderInstance(c *gin.Context) {
@@ -598,8 +599,17 @@ func (h *ProviderHandler) AlterProviderInstance(c *gin.Context) {
return
}
code, err := h.modelProviderService.AlterProviderInstance(userID, providerName, instanceName, req.ModelName, req.APIKey)
if err != nil {
c.JSON(http.StatusOK, gin.H{
"code": code,
"message": err.Error(),
})
return
}
c.JSON(http.StatusOK, gin.H{
"code": common.CodeNotFound,
"code": 0,
"message": "success",
})
}