diff options
| author | sigoden <sigoden@gmail.com> | 2023-10-28 22:10:17 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-28 22:10:17 +0800 |
| commit | 2ab2e23bb0539a7fac0d990e3d7e08b7fade1030 (patch) | |
| tree | deed79015792eadf40b3e69c6e365af377759d46 /src/config/mod.rs | |
| parent | bc44026ff8828f532e9eba138e2ba35f7c247271 (diff) | |
| download | aichat-2ab2e23bb0539a7fac0d990e3d7e08b7fade1030.tar.gz | |
refactor: improve environment variables (#163)
Rename `AICHAT_API_KEY` to `OPENAI_API_KEY`
Add `LOCALAI_API_KEY`
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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<Self> { 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 { |
