37
server/model/app/request/ai_config.go
Normal file
37
server/model/app/request/ai_config.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package request
|
||||
|
||||
// CreateAIConfigRequest 创建AI配置请求
|
||||
type CreateAIConfigRequest struct {
|
||||
Name string `json:"name" binding:"required,max=100"`
|
||||
Provider string `json:"provider" binding:"required,oneof=openai anthropic custom"`
|
||||
BaseURL string `json:"baseUrl" binding:"required,url"`
|
||||
APIKey string `json:"apiKey" binding:"required"`
|
||||
DefaultModel string `json:"defaultModel"`
|
||||
Settings map[string]interface{} `json:"settings"`
|
||||
}
|
||||
|
||||
// UpdateAIConfigRequest 更新AI配置请求
|
||||
type UpdateAIConfigRequest struct {
|
||||
Name string `json:"name" binding:"max=100"`
|
||||
BaseURL string `json:"baseUrl" binding:"omitempty,url"`
|
||||
APIKey string `json:"apiKey"`
|
||||
DefaultModel string `json:"defaultModel"`
|
||||
Settings map[string]interface{} `json:"settings"`
|
||||
IsActive *bool `json:"isActive"`
|
||||
IsDefault *bool `json:"isDefault"`
|
||||
}
|
||||
|
||||
// TestAIConfigRequest 测试AI配置请求
|
||||
type TestAIConfigRequest struct {
|
||||
Provider string `json:"provider" binding:"required,oneof=openai anthropic custom"`
|
||||
BaseURL string `json:"baseUrl" binding:"required,url"`
|
||||
APIKey string `json:"apiKey" binding:"required"`
|
||||
Model string `json:"model"`
|
||||
}
|
||||
|
||||
// GetModelsRequest 获取模型列表请求
|
||||
type GetModelsRequest struct {
|
||||
Provider string `json:"provider" binding:"required,oneof=openai anthropic custom"`
|
||||
BaseURL string `json:"baseUrl" binding:"required,url"`
|
||||
APIKey string `json:"apiKey" binding:"required"`
|
||||
}
|
||||
Reference in New Issue
Block a user