Просмотр исходного кода

fix(openrouter): set api key from env (#129)

Hunter Casten 1 год назад
Родитель
Сommit
76275e533e
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      internal/config/config.go

+ 3 - 0
internal/config/config.go

@@ -228,6 +228,9 @@ func setProviderDefaults() {
 	if apiKey := os.Getenv("GROQ_API_KEY"); apiKey != "" {
 		viper.SetDefault("providers.groq.apiKey", apiKey)
 	}
+	if apiKey := os.Getenv("OPENROUTER_API_KEY"); apiKey != "" {
+		viper.SetDefault("providers.openrouter.apiKey", apiKey)
+	}
 
 	// Use this order to set the default models
 	// 1. Anthropic