feat: add domestic model provider presets

This commit is contained in:
Codex Local
2026-08-30 19:55:17 +08:00
parent 522785eda8
commit dcf0fc0d7f
13 changed files with 314 additions and 28 deletions
+1 -1
View File
@@ -362,7 +362,7 @@ func normalizeInput(input *CreateInput) {
func validateInput(input CreateInput) error {
parsed, err := url.Parse(input.BaseURL)
validProvider := input.Provider == "ark" || input.Provider == "openai_compatible"
validProvider := extraction.SupportsCompatibleProvider(input.Provider)
validURL := err == nil && parsed.Host != "" && (parsed.Scheme == "https" || (parsed.Scheme == "http" && isApprovedLocalModelHost(parsed.Hostname())))
if !validUUID(input.TenantID) || len([]rune(input.DisplayName)) < 1 || len([]rune(input.DisplayName)) > 120 || !validProvider || !validURL || input.ModelID == "" || len(input.APIKey) < 8 || input.Temperature < 0 || input.Temperature > 2 || input.MaxTokens < 256 || input.MaxTokens > 8192 {
return ErrInvalid