summaryrefslogtreecommitdiffstats
path: root/src/client.rs
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2023-03-11 11:26:24 +0800
committerGitHub <noreply@github.com>2023-03-11 11:26:24 +0800
commitdc09cb38d480342c9fe781a19fe72d2bb892b70c (patch)
treeace3617cb623f68e6a4fe06e850f5f5aa0162a05 /src/client.rs
parentd48cd64162416c906451a0f81b71676acd185610 (diff)
downloadaichat-dc09cb38d480342c9fe781a19fe72d2bb892b70c.tar.gz
feat: support more env vars (#63)
- AICHAT_CONFIG_DIR: sepecify the configuration directory - AICHAT_ROLES_FILE: set the `roles.yaml` file path - AICHAT_API_KEY: set the api key
Diffstat (limited to 'src/client.rs')
-rw-r--r--src/client.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client.rs b/src/client.rs
index 361f897..29dc592 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -155,7 +155,7 @@ impl ChatGptClient {
let builder = self
.build_client()?
.post(API_URL)
- .bearer_auth(&self.config.lock().api_key)
+ .bearer_auth(self.config.lock().get_api_key())
.json(&body);
Ok(builder)