qwen.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package model_setting
  2. import (
  3. "strings"
  4. "github.com/QuantumNous/new-api/setting/config"
  5. )
  6. // QwenSettings defines Qwen model configuration. 注意bool要以enabled结尾才可以生效编辑
  7. type QwenSettings struct {
  8. SyncImageModels []string `json:"sync_image_models"`
  9. }
  10. // 默认配置
  11. var defaultQwenSettings = QwenSettings{
  12. SyncImageModels: []string{
  13. "z-image",
  14. "qwen-image",
  15. "wan2.6",
  16. "wan2.7",
  17. "qwen-image-edit",
  18. "qwen-image-edit-max",
  19. "qwen-image-edit-max-2026-01-16",
  20. "qwen-image-edit-plus",
  21. "qwen-image-edit-plus-2025-12-15",
  22. "qwen-image-edit-plus-2025-10-30",
  23. },
  24. }
  25. // 全局实例
  26. var qwenSettings = defaultQwenSettings
  27. func init() {
  28. // 注册到全局配置管理器
  29. config.GlobalConfig.Register("qwen", &qwenSettings)
  30. }
  31. // GetQwenSettings
  32. func GetQwenSettings() *QwenSettings {
  33. return &qwenSettings
  34. }
  35. // IsSyncImageModel
  36. func IsSyncImageModel(model string) bool {
  37. for _, m := range qwenSettings.SyncImageModels {
  38. if strings.Contains(model, m) {
  39. return true
  40. }
  41. }
  42. return false
  43. }