feat(api): align provider creation with presets/custom/google sdk

This commit is contained in:
zenfun
2025-12-17 22:19:17 +08:00
parent 174735f152
commit 2b0ed3d3d5
5 changed files with 214 additions and 10 deletions

View File

@@ -33,3 +33,28 @@ type ProviderCustomCreateDTO struct {
Weight int `json:"weight,omitempty"`
AutoBan *bool `json:"auto_ban,omitempty"`
}
// ProviderGoogleCreateDTO creates a Google SDK provider (Gemini API or Vertex).
// It intentionally does not require base_url.
type ProviderGoogleCreateDTO struct {
// Type must be a Google-family provider type, e.g.:
// - gemini/google/aistudio (Gemini API)
// - vertex/vertex-express (Vertex)
Type string `json:"type"`
// Optional fields.
Name string `json:"name"`
Group string `json:"group"`
Models []string `json:"models"`
// Gemini API
APIKey string `json:"api_key,omitempty"`
// Vertex
GoogleProject string `json:"google_project,omitempty"`
GoogleLocation string `json:"google_location,omitempty"`
Status string `json:"status"`
Weight int `json:"weight,omitempty"`
AutoBan *bool `json:"auto_ban,omitempty"`
}