Files
ez-api/internal/dto/provider_create.go

61 lines
1.8 KiB
Go

package dto
// ProviderPresetCreateDTO creates an official provider with sensible defaults.
// For preset providers, base_url is derived automatically; users typically only provide api_key.
type ProviderPresetCreateDTO struct {
Preset string `json:"preset"` // openai | anthropic | gemini
// Optional fields.
Name string `json:"name"`
Group string `json:"group"`
Models []string `json:"models"`
APIKey string `json:"api_key"`
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"`
}
// ProviderCustomCreateDTO creates an OpenAI-compatible provider.
// For custom providers, base_url is required.
type ProviderCustomCreateDTO struct {
Name string `json:"name"`
Group string `json:"group"`
Models []string `json:"models"`
BaseURL string `json:"base_url"`
APIKey string `json:"api_key"`
Status string `json:"status"`
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"`
}