fix tts provider and lint

This commit is contained in:
Huaaudio 2026-03-23 15:25:41 +01:00
parent 3e26c37db1
commit a88b539402
2 changed files with 3 additions and 3 deletions

View file

@ -12,7 +12,7 @@ import (
)
func initPanicFile(panicFile string) io.WriteCloser {
file, err := os.OpenFile(panicFile, os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_APPEND, 0600)
file, err := os.OpenFile(panicFile, os.O_WRONLY|os.O_CREATE|os.O_SYNC|os.O_APPEND, 0o600)
if err != nil {
panic(fmt.Sprintf("error in open panic: %v", err))
}

View file

@ -136,8 +136,8 @@ func (t *OpenAITTSProvider) Synthesize(ctx context.Context, text string) (io.Rea
func DetectTTS(cfg *config.Config) TTSProvider {
for _, mc := range cfg.ModelList {
if strings.Contains(strings.ToLower(mc.ModelName), "tts") && mc.APIKey != "" {
return NewOpenAITTSProvider(mc.APIKey, mc.APIBase, mc.Proxy)
if strings.Contains(strings.ToLower(mc.ModelName), "tts") && mc.APIKey() != "" {
return NewOpenAITTSProvider(mc.APIKey(), mc.APIBase, mc.Proxy)
}
}
return nil