[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel a673f54a3e 024/273: gptel, gptel-curl: Handle missin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel a673f54a3e 024/273: gptel, gptel-curl: Handle missing API key |
Date: |
Wed, 1 May 2024 10:01:29 -0400 (EDT) |
branch: elpa/gptel
commit a673f54a3ed6a47a964fa8173f958ce9feefdc34
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel, gptel-curl: Handle missing API key
gptel.el (gptel--url-get-response): When `gptel-send' is called
directly, the API key is assumed to exist. Ensure that it is read.
gptel-curl.el (gptel-curl--get-args): Ditto.
---
gptel-curl.el | 3 ++-
gptel.el | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/gptel-curl.el b/gptel-curl.el
index 7953790b80..4f2348f36e 100644
--- a/gptel-curl.el
+++ b/gptel-curl.el
@@ -50,7 +50,8 @@ PROMPTS is the data to send, TOKEN is a unique identifier."
(api-key
(cond
((stringp gptel-api-key) gptel-api-key)
- ((functionp gptel-api-key) (funcall gptel-api-key))))
+ ((functionp gptel-api-key) (funcall gptel-api-key))
+ (t (setq gptel-api-key (read-passwd "OpenAI API key: ")))))
(headers
`(("Content-Type" . "application/json")
("Authorization" . ,(concat "Bearer " api-key)))))
diff --git a/gptel.el b/gptel.el
index f93f44c009..b90bf54ff1 100644
--- a/gptel.el
+++ b/gptel.el
@@ -278,7 +278,8 @@ Return the message received."
(api-key
(cond
((stringp gptel-api-key) gptel-api-key)
- ((functionp gptel-api-key) (funcall gptel-api-key))))
+ ((functionp gptel-api-key) (funcall gptel-api-key))
+ (t (setq gptel-api-key (read-passwd "OpenAI API key: ")))))
(url-request-method "POST")
(url-request-extra-headers
`(("Content-Type" . "application/json")
- [nongnu] elpa/gptel 87c190076e 212/273: README: Clarify example configuration code, (continued)
- [nongnu] elpa/gptel 87c190076e 212/273: README: Clarify example configuration code, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 12340eda46 228/273: gptel-transient: Truncate system prompt when messaging, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f58ad9435c 225/273: gptel: Use libjansson support if available, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 161c77ad7f 235/273: gptel-transient: Adjust several menu options, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 2b938114cf 264/273: gptel: Add GPT 4 Turbo (#286), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 44feb1637f 267/273: gptel-transient: Update header-line in gptel--suffix-send, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f98293f004 016/273: gptel: Check header-line-format before updating, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3f7c81012b 015/273: gptel: Bump version and prepare for transient menus, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9da22155de 025/273: gptel-transient: Fix autoloads for gptel-send-menu, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a3109a4b68 022/273: gptel: Insert response below point, not at point-max, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a673f54a3e 024/273: gptel, gptel-curl: Handle missing API key,
ELPA Syncer <=
- [nongnu] elpa/gptel 1e31f550de 165/273: gptel: Declare compat as explicit dependency, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 48047c0600 167/273: gptel-transient: Improve system-message edit buffer, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5159a773a0 011/273: gptel: Use text-property based delimiting, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 4e35e998a8 014/273: gptel-curl: Rename functions for linting, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1ada9c9214 031/273: gptel: Handle insertion with region-active correctly, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d77c8f37c5 057/273: gptel: Improve header-line-format, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 6419e8f021 120/273: gptel: Add multi-llm support, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel aa50cbab70 123/273: gptel: Bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c97778d5a8 127/273: gptel: address byte-compile and checkdoc warnings, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3e361323d5 137/273: Update available OpenAI GPT models to match API (#146), ELPA Syncer, 2024/05/01