38 lines
1.6 KiB
Go
38 lines
1.6 KiB
Go
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"`
|
|
}
|