continue icon indicating copy to clipboard operation
continue copied to clipboard

Do `Prompt files` actually work?

Open alanwilter opened this issue 1 year ago • 4 comments

Relevant environment info

OS: macOS
Continue version: v0.9.211
IDE version:  VSCode  1.93.1
Model: GPT-4o

Description

If I try e.g. https://github.com/continuedev/prompt-file-examples/blob/main/unit-tests.prompt it actually crashes this feature and slash prompts don't work anymore. So I removed. I'm trying to do what's shown in the image, which works beautifully!

Screenshot 2024-09-20 at 09 50 36

Therefore I created pytest.prompt with:

<system>
You are an expert programmer
</system>

{{{ input }}}

Write unit tests for the above selected code, following each of these instructions:
- Use pytest
- I have pytest already setup, so need to tell me how to install it
- Properly set up and tear down if needed
- Include important edge cases
- The tests should be complete and sophisticated
- Just give the code, no need to explain
- Don't explain how to set up pytest or how to use it
- Add typings according to python 3.9 convention, so no need to use `from typing import` etc.
- Add one line docstring explaining what the test does

and tried as seen in the second image.

image

But it does not work like in my first image.

Using GPT-4o, does do what was asked. What am I missing?

alanwilter avatar Sep 21 '24 23:09 alanwilter

@alanwilter using your prompt and function definition with gpt-4o it worked for me. Can you confirm that your pytest.prompt file was properly saved?

/.prompts/pytest.prompt

<system>
You are an expert programmer
</system>

{{{ input }}}

Write unit tests for the above selected code, following each of these instructions:
- Use pytest
- I have pytest already setup, so need to tell me how to install it
- Properly set up and tear down if needed
- Include important edge cases
- The tests should be complete and sophisticated
- Just give the code, no need to explain
- Don't explain how to set up pytest or how to use it
- Add typings according to python 3.9 convention, so no need to use `from typing import` etc.
- Add one line docstring explaining what the test does
def sort_array(xs: np.ndarray, n: int) -> np.ndarray:
    return xs[xs[:, n].argsort()]
  • highlighted function definition, cmd + L to pull into chat
  • type /pytest
  • go

output (more or less matches your expected output): image

continue v0.8.52

RomneyDa avatar Sep 23 '24 12:09 RomneyDa

@RomneyDa Thanks for trying too. The thing is that release continue v0.8.52 works, but not pre-release v0.9.211. So, for me, it's clearly a bug.

alanwilter avatar Sep 23 '24 12:09 alanwilter

@alanwilter agree, switched to prerelease while keeping model prompt etc. the same and experienced same thing.

RomneyDa avatar Sep 23 '24 14:09 RomneyDa

Same on my end, neither release or pre-release works with prompts. It won't add them as custom slash commands

callum-gander avatar Sep 30 '24 19:09 callum-gander

Same behavior on Windows 11 with vs code, version 0.8.55.

  • Connected to ollama, I attempted to "Build a custom prompt" from the chat.
  • The system created a new .prompts folder in my workspace.
  • Then I copied the code smells prompt into the file and renamed it 'code-smells.prompt'.
  • Then restarted VS code and suddenly the Continue extension stopped working.
  • Tried restarting and tweaking the config.json file several different ways, nothing fixed it.
  • It didn't start working again until I deleted the .prompts folder altogether and restarted vs code again.

softwareliberationarmy avatar Oct 26 '24 15:10 softwareliberationarmy

Somehow, it didn't like --- lines in the prompts files; omitting them helped to return functionality (v0.8.55).

abalesk avatar Nov 07 '24 17:11 abalesk

Lots appears to be changing in prompts recently, including moving slash commands to @ prompts and replacing {{{ moustache calls }}} with @ calls inside the prompt file.

@softwareliberationarmy wrote:

Then restarted VS code and suddenly the Continue extension stopped working.

Yes, I've been seeing a lot of that. It usually looks like this for me, and happens when loading Continue in a new VSCode window:

image

Continue just hangs. The error is the dreaded "Cannot read properties of undefined" which is unhelpful. So far I've found:

  • @repo-map reliably causes this (or was it the EPERM error?). Don't invoke it from a prompt file until fixed.
  • I had no issue with a single '---'. Possibly problems with multiple ones.
  • These were also fine: @os, @README.me (and other filenames), @open (files opened in tabs), @diff.
  • But do not test your prompts on your config project itself: prompts in the @diff break the fourth wall.
  • Possibly embedded "```" and </system> in your @diff could also break things.
  • (Probably other context providers besides @diff!)

I have decent @code-review and @merge-review that provide open-files, readme, and diff as context. I'm installing them only in the global .continue\prompts folder for simplicity. Once that's stable I might look at project-specific prompts.

[!NOTE] The global prompts dir is not monitored: changes require re-opening the VSCode window.

ctwardy avatar Dec 11 '24 20:12 ctwardy

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar Mar 15 '25 02:03 github-actions[bot]

This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!

github-actions[bot] avatar Mar 25 '25 02:03 github-actions[bot]