[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel b212c24c4a 018/273: gptel: tweak prompt, rename url
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel b212c24c4a 018/273: gptel: tweak prompt, rename url functions |
Date: |
Wed, 1 May 2024 10:01:26 -0400 (EDT) |
branch: elpa/gptel
commit b212c24c4a85fb10db7f5c158cc360a04a8e1129
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel: tweak prompt, rename url functions
gptel.el (gptel--system-message-alist, gptel--url-get-response,
gptel--url-parse-response): Tweak default programming prompt. Rename
`gptel--get-response' to the more specific `gptel--url-parse-response'.
Likewise `gptel--parse-response' -> `gptel--url-parse-response'.
---
gptel.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/gptel.el b/gptel.el
index 75c9cb2358..ed1f5d4300 100644
--- a/gptel.el
+++ b/gptel.el
@@ -96,7 +96,7 @@ When set to nil, it is inserted all at once.
"You are a large language model living in Emacs and a helpful assistant.
Respond concisely.")
(defvar gptel--system-message-alist
`((default . ,gptel--system-message)
- (programming . "You are a large language model and a careful programmer.
Respond only with code unless explicitly asked.")
+ (programming . "You are a large language model and a careful programmer.
Provide code and only code as output without any additional text, prompt or
note.")
(writing . "You are a large language model and a writing assistant.
Respond concisely.")
(chat . "You are a large language model and a conversation partner.
Respond concisely."))
"Prompt templates (directives).")
@@ -117,13 +117,14 @@ When set to nil, it is inserted all at once.
(message "Querying ChatGPT...")
(and header-line-format
(setf (nth 1 header-line-format)
- (propertize " Waiting..." 'face 'warning)))
+ (propertize " Waiting..." 'face 'warning))
+ (force-mode-line-update))
(let* ((gptel-buffer (current-buffer))
(full-prompt (gptel--create-prompt))
(response (aio-await
(funcall
(if gptel-use-curl
- #'gptel-curl-get-response #'gptel--get-response)
+ #'gptel-curl-get-response #'gptel--url-get-response)
full-prompt)))
(content-str (plist-get response :content))
(status-str (plist-get response :status)))
@@ -205,6 +206,7 @@ instead."
prompts-plist))
(aio-defun gptel--get-response (prompts)
+(aio-defun gptel--url-get-response (prompts)
"Fetch response for PROMPTS from ChatGPT.
Return the message received."
@@ -224,10 +226,10 @@ Return the message received."
(aio-await
(aio-url-retrieve
"https://api.openai.com/v1/chat/completions"))))
(prog1
- (gptel--parse-response response-buffer)
+ (gptel--url-parse-response response-buffer)
(kill-buffer response-buffer)))))
-(defun gptel--parse-response (response-buffer)
+(defun gptel--url-parse-response (response-buffer)
"Parse response in RESPONSE-BUFFER."
(when (buffer-live-p response-buffer)
(with-current-buffer response-buffer
- [nongnu] elpa/gptel 65e6d73372 013/273: gptel: Include more API parameters, (continued)
- [nongnu] elpa/gptel 65e6d73372 013/273: gptel: Include more API parameters, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 0d26b34526 029/273: gptel: Add a debug flag, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 6f951ed690 037/273: Add gptel-api-key-from-auth-source (Fix #13), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 4f3ca23454 040/273: gptel: Update commentary and README, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9f8a984729 038/273: gptel: Change how api-key is read, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9b3db255e8 049/273: gptel: Turn API parameters into defcustoms, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel a5fe30312f 005/273: gptel: Fix spacing issues in response, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3c10147a72 009/273: gptel: Tweak README, minor linting, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 77d1010fbc 010/273: gptel-curl: Add package version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 03113afd50 008/273: gptel: Rename internal functions, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel b212c24c4a 018/273: gptel: tweak prompt, rename url functions,
ELPA Syncer <=
- [nongnu] elpa/gptel 172059060a 012/273: gptel-curl: Autoload gptel-curl-get-response, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c8f87f5554 030/273: Update README with transient menu details, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 9f8fc0e519 021/273: gptel-transient: Commands to act on region, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f0eba0cf4f 039/273: README: Update README for MELPA, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 87d9090b7a 036/273: gptel-curl: Fix process sentinel, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 552939b2f6 047/273: gptel: Fix free-variable error, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 30161850ad 032/273: gptel-transient: Allow setting num past messages to 0, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d5ad620555 059/273: gptel-curl: process filter for streaming support, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5a0deda7fc 065/273: gptel: Turn on streaming replies by default, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 937c754e57 076/273: gptel-transient: Add refactor transient, ELPA Syncer, 2024/05/01