[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel 3308449761 133/273: gptel: Fix prompt string handlin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel 3308449761 133/273: gptel: Fix prompt string handling in gptel-request |
Date: |
Wed, 1 May 2024 10:02:13 -0400 (EDT) |
branch: elpa/gptel
commit 33084497619f159997f605f4bcdb39c75f887ec7
Author: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
gptel: Fix prompt string handling in gptel-request
* gptel.el (gptel-request): When `gptel-request` is supplied a
string, it creates the full prompt plist according to the OpenAI
API. Fix by inserting it into a temp buffer and using the
cl-generic dispatch to parse the buffer instead. This is a janky
solution but the best possible one without defining another
generic function just to handle prompt strings differently per API.
---
gptel.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/gptel.el b/gptel.el
index 3d019069c3..95c9fde84d 100644
--- a/gptel.el
+++ b/gptel.el
@@ -632,14 +632,18 @@ Model parameters can be let-bound around calls to this
function."
((integerp position)
(set-marker (make-marker) position buffer))))
(full-prompt
- (cond
- ((null prompt)
- (let ((gptel--system-message system))
- (gptel--create-prompt start-marker)))
- ((stringp prompt)
- `((:role "system" :content ,system)
- (:role "user" :content ,prompt)))
- ((consp prompt) prompt)))
+ (cond
+ ((null prompt)
+ (let ((gptel--system-message system))
+ (gptel--create-prompt start-marker)))
+ ((stringp prompt)
+ ;; FIXME Dear reader, welcome to Jank City:
+ (with-temp-buffer
+ (let ((gptel--system-message system)
+ (gptel-backend (buffer-local-value 'gptel-backend buffer)))
+ (insert prompt)
+ (gptel--create-prompt))))
+ ((consp prompt) prompt)))
(info (list :prompt full-prompt
:buffer buffer
:position start-marker)))
- [nongnu] elpa/gptel 2e92c0303c 156/273: gptel: gptel-backend-url can accept functions, (continued)
- [nongnu] elpa/gptel 2e92c0303c 156/273: gptel: gptel-backend-url can accept functions, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 2c87acddd5 200/273: gptel: Add request logging (Fix #165), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d8c604b53b 202/273: README: Update with instructions for perplexity.ai (#204), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel eb088f2f21 213/273: gptel-anthropic: support Anthropic AI's Claude 3 (#229), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3935a6dcf8 221/273: :recycle:: Untangle Gemini model and endpoint #212 (#213), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 260be9d8d4 230/273: gptel: Consolidate HTTP request process, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 53a905dafc 253/273: gptel: Show chosen system message in header-line, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 306fe3bd8c 269/273: gptel-ollama: Fix parsing error (#179), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 97ab6cbd1e 273/273: gptel: Add .elpaignore, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 4356f6fbec 103/273: gptel: correct system message with gptel-request, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3308449761 133/273: gptel: Fix prompt string handling in gptel-request,
ELPA Syncer <=
- [nongnu] elpa/gptel 190d1d20e2 121/273: gptel: Update header line and package info description, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f571323174 163/273: gptel-gemini: Simulate system-message for gemini, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 7c2e342f35 176/273: gptel-transient: Add prompting from kill-ring, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1752f1d589 180/273: gptel-kagi: Add support for the Kagi summarizer, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel d0c685e501 189/273: gptel: checkdoc linting and indentation rules, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 8a25058eed 190/273: gptel-openai: default :header key to simplify config, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f0e4889c36 196/273: gptel: Update OpenAI model list, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 95925f3571 198/273: Automatically create parent directories for gptel-crowdsourced-prompts-file (#203), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel af5444a2ea 201/273: gptel: docstrings for multi-LLM support, bump version, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 49cfc78378 203/273: gptel: Add page boundaries, restructure files, ELPA Syncer, 2024/05/01