Files
st-react/server/model/app/request/preset.go
Echo f4e166c5ee 🎉 初始化项目
Signed-off-by: Echo <1711788888@qq.com>
2026-02-27 21:52:00 +08:00

48 lines
2.6 KiB
Go

package request
// CreatePresetRequest 创建预设请求
type CreatePresetRequest struct {
Name string `json:"name" binding:"required,min=1,max=100"`
Description string `json:"description" binding:"max=500"`
IsPublic bool `json:"isPublic"`
Temperature float64 `json:"temperature" binding:"min=0,max=2"`
TopP float64 `json:"topP" binding:"min=0,max=1"`
TopK int `json:"topK" binding:"min=0"`
FrequencyPenalty float64 `json:"frequencyPenalty" binding:"min=-2,max=2"`
PresencePenalty float64 `json:"presencePenalty" binding:"min=-2,max=2"`
MaxTokens int `json:"maxTokens" binding:"min=1,max=32000"`
RepetitionPenalty float64 `json:"repetitionPenalty"`
MinP float64 `json:"minP"`
TopA float64 `json:"topA"`
SystemPrompt string `json:"systemPrompt"`
StopSequences []string `json:"stopSequences"`
Extensions map[string]interface{} `json:"extensions"`
}
// UpdatePresetRequest 更新预设请求
type UpdatePresetRequest struct {
Name string `json:"name" binding:"min=1,max=100"`
Description string `json:"description" binding:"max=500"`
IsPublic *bool `json:"isPublic"`
Temperature *float64 `json:"temperature" binding:"omitempty,min=0,max=2"`
TopP *float64 `json:"topP" binding:"omitempty,min=0,max=1"`
TopK *int `json:"topK" binding:"omitempty,min=0"`
FrequencyPenalty *float64 `json:"frequencyPenalty" binding:"omitempty,min=-2,max=2"`
PresencePenalty *float64 `json:"presencePenalty" binding:"omitempty,min=-2,max=2"`
MaxTokens *int `json:"maxTokens" binding:"omitempty,min=1,max=32000"`
RepetitionPenalty *float64 `json:"repetitionPenalty"`
MinP *float64 `json:"minP"`
TopA *float64 `json:"topA"`
SystemPrompt *string `json:"systemPrompt"`
StopSequences []string `json:"stopSequences"`
Extensions map[string]interface{} `json:"extensions"`
}
// GetPresetListRequest 获取预设列表请求
type GetPresetListRequest struct {
Page int `form:"page" binding:"min=1"`
PageSize int `form:"pageSize" binding:"min=1,max=100"`
Keyword string `form:"keyword"`
IsPublic *bool `form:"isPublic"`
}