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

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"`
}