From dc09cb38d480342c9fe781a19fe72d2bb892b70c Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 11 Mar 2023 11:26:24 +0800 Subject: 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 --- src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client.rs') 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) -- cgit v1.2.3