[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/llm 48ae59d149 14/34: Fix llm-chat-prompt-to-text, whic
From: |
Andrew Hyatt |
Subject: |
[elpa] externals/llm 48ae59d149 14/34: Fix llm-chat-prompt-to-text, which was unusable |
Date: |
Sat, 16 Sep 2023 01:32:48 -0400 (EDT) |
branch: externals/llm
commit 48ae59d14977aae60c6f2405fc9d8bbcf2182a3f
Author: Andrew Hyatt <ahyatt@gmail.com>
Commit: Andrew Hyatt <ahyatt@gmail.com>
Fix llm-chat-prompt-to-text, which was unusable
---
llm.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/llm.el b/llm.el
index 29e907a093..f83233eaaf 100644
--- a/llm.el
+++ b/llm.el
@@ -142,10 +142,10 @@ ways."
(defun llm-chat-prompt-to-text (prompt)
"Convert PROMPT `llm-chat-prompt' to a simple text.
This should only be used for logging or debugging."
- (format "Context: %s\nExamples: %s\nInteractions: %s\nTemperature: %f\nMax
tokens: %d\n"
+ (format "Context: %s\nExamples: %s\nInteractions: %s\n%s%s\n"
(llm-chat-prompt-context prompt)
(mapconcat (lambda (e) (format "User: %s\nResponse: %s" (car e) (cdr
e)))
- (llm-chat-prompt-interactions prompt) "\n")
+ (llm-chat-prompt-examples prompt) "\n")
(mapconcat (lambda (i)
(format "%s: %s"
(pcase (llm-chat-prompt-interaction-role i)
@@ -154,8 +154,12 @@ This should only be used for logging or debugging."
('assistant "Assistant"))
(llm-chat-prompt-interaction-content i)))
(llm-chat-prompt-interactions prompt) "\n")
- (llm-chat-prompt-temperature prompt)
- (llm-chat-prompt-max-tokens prompt)))
+ (if (llm-chat-prompt-temperature prompt)
+ (format "Temperature: %s\n" (llm-chat-prompt-temperature prompt))
+ "")
+ (if (llm-chat-prompt-max-tokens prompt)
+ (format "Max tokens: %s\n" (llm-chat-prompt-max-tokens prompt))
+ "")))
(provide 'llm)
- [elpa] branch externals/llm created (now 39ae6fc794), Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 3b761aca25 02/34: Add README.org, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm ad76cff80b 01/34: Initial checkin of the llm package for emacs., Andrew Hyatt, 2023/09/16
- [elpa] externals/llm cff5db8ad5 16/34: Add unit tests and fix all brokenness detected by them, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 131a7ee5d3 12/34: Solve flaky errors when using sync llm commands, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 48ae59d149 14/34: Fix llm-chat-prompt-to-text, which was unusable,
Andrew Hyatt <=
- [elpa] externals/llm 636014bf64 08/34: Make all remaining code async-friendly, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 9e3040bad2 20/34: Add warnings requested by GNU about nonfree software, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm c8b14b4d9c 19/34: Fix fake provider embedding func and remove async unit tests, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 9057a50df4 11/34: Fix indenting in llm--run-async-as-sync, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm c322577b9b 13/34: Test both sync and async commands, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm cff9ab8f3c 22/34: Centralize nonfree llm warnings, and warn with a targeted type, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm ad230d9d6b 10/34: Add methods for nil provider, to throw more meaningful errors, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 650bba65d5 25/34: Improve the docstring for llm--warn-on-nonfree, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm b2f1605514 33/34: Delete some trailing whitespace, Andrew Hyatt, 2023/09/16
- [elpa] externals/llm 39ae6fc794 34/34: Assign copyright to FSF, in preparation of inclusion to GNU ELPA, Andrew Hyatt, 2023/09/16