Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Dotprompt always looks in prompts/ even when initialized with other directory #867

Open
kevinthecheung opened this issue Sep 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working js

Comments

@kevinthecheung
Copy link
Contributor

kevinthecheung commented Sep 5, 2024

Describe the bug

Dotprompt always looks in prompts/ even when initialized with other directory.

(the library loads all of the prompts in the configured directory when you initialize it but thereafter if you reference a prompt that's not found it looks in the default location rather than the one you specified at initialization)

To Reproduce

  1. Put a hello.prompt file in prompts/
  2. Initialize plugin, specifying a different dir: dotprompt({ dir: './prompts2' })
  3. Try:
    const helloPrompt = await prompt('hello');
    const response = await helloPrompt.generate({}); 
    
    It still succeeds.
  4. Try with promptRef('hello'). It also succeeds.
  5. OTOH the devUI doesn't load the prompt

Expected behavior

3 and 4 should be errors. 5 is expected.

Screenshots
If applicable, add screenshots to help explain your problem.

Runtime (please complete the following information):

  • OS: [e.g. Linux, MacOS]
  • Version [e.g. 22]

** Node version

  • run node --version at paste here

Additional context
Add any other context about the problem here.

@kevinthecheung kevinthecheung added bug Something isn't working js labels Sep 5, 2024
@pr-Mais pr-Mais self-assigned this Sep 16, 2024
@pr-Mais pr-Mais assigned cabljac and unassigned pr-Mais Oct 7, 2024
@pavelgj pavelgj self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working js
Projects
Status: In Progress
Development

No branches or pull requests

4 participants