47
server/model/app/request/preset.go
Normal file
47
server/model/app/request/preset.go
Normal file
@@ -0,0 +1,47 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user