prompt library: use context.text placeholder as a string value
#2521
Closed
chrisgrieser
started this conversation in
Enhancements
Replies: 1 comment 3 replies
-
|
This would be a great PR 👍🏼 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Right now, to insert the selection in a prompt in Markdown, we need to use
${shared.code}. However, without our ownshared.luathat results in an error:For something as straightforward as the selected text, there are context placeholders, though. But using
${context.lines}sends something liketable: 0x0109b3caf8(a lua raw table) since that particular placeholder is a table, not a string.So basically, when using the
prompt_library, we need to copypaste this file into our own config.Suggested Solution
Make it more straightforward, and add
context.textas a placeholder, which is nothing butcontext.linesjoined with line breaks. Then we can just add${context.text}into the prompt, without the need for a lua function of our own for simple prompts.Beta Was this translation helpful? Give feedback.
All reactions