diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2024-03-09 13:13:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-09 13:13:53 +0100 |
| commit | bb018930969076cd3cbd6f283eb851fc4e7d2985 (patch) | |
| tree | 441e0fdfa3d5ddb05d87fbccca1b92dbd7d762b3 /py/utils.py | |
| parent | 2c68098308cb59c2a5dd13c3b3f4323ae1b602e2 (diff) | |
| parent | 6d77f57ae9e4e11fc4785d7d285f893c939818b6 (diff) | |
| download | vim-ai-bb018930969076cd3cbd6f283eb851fc4e7d2985.tar.gz | |
Merge pull request #80 from jiangyinzuo/main
feat: add an option to customize api key file location
Diffstat (limited to 'py/utils.py')
| -rw-r--r-- | py/utils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/py/utils.py b/py/utils.py index a5c489f..1e2ae95 100644 --- a/py/utils.py +++ b/py/utils.py @@ -19,7 +19,8 @@ class KnownError(Exception): pass def load_api_key(): - config_file_path = os.path.join(os.path.expanduser("~"), ".config/openai.token") + config_file_path = os.path.expanduser(vim.eval("g:vim_ai_token_file_path")) + print(config_file_path) api_key_param_value = os.getenv("OPENAI_API_KEY") try: with open(config_file_path, 'r') as file: |