From 2ab2e23bb0539a7fac0d990e3d7e08b7fade1030 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 28 Oct 2023 22:10:17 +0800 Subject: refactor: improve environment variables (#163) Rename `AICHAT_API_KEY` to `OPENAI_API_KEY` Add `LOCALAI_API_KEY` --- src/config/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/config') diff --git a/src/config/mod.rs b/src/config/mod.rs index 73c9444..6e6251d 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -105,7 +105,7 @@ impl Config { pub fn init(is_interactive: bool) -> Result { let config_path = Self::config_file()?; - let api_key = env::var(get_env_name("api_key")).ok(); + let api_key = env::var("OPENAI_API_KEY").ok(); let exist_config_path = config_path.exists(); if is_interactive && api_key.is_none() && !exist_config_path { -- cgit v1.2.3