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

[dotprompt] dotprompt variants don't fall through to "defaults" as documented #496

Closed
njpearman opened this issue Jun 27, 2024 · 2 comments · Fixed by #558
Closed

[dotprompt] dotprompt variants don't fall through to "defaults" as documented #496

njpearman opened this issue Jun 27, 2024 · 2 comments · Fixed by #558
Assignees
Labels
bug Something isn't working docs Improvements or additions to documentation js

Comments

@njpearman
Copy link

Describe the bug
The Prompt Variants section of the documentation for .prompt files states:

The prompt loader will attempt to load the variant of that name, and fall back to the baseline if none exists.

However, it seems that this is not the case and, looking at the registry file, there doesn't seem to be any logic to attempt to load a file without the variant when a variant has been used. I'm looking in particular at maybeLoadPrompt but I've looked around related areas too: https://github.com/firebase/genkit/blob/main/js/plugins/dotprompt/src/registry.ts

To Reproduce
Create a prompt file with the following name:

prompts/
  random-recipe.prompt

Then try to load the prompt with the following set up:

const prompt = await loadPrompt("random-recipe", { variant: "wacky" });

Rather than loading the prompt, you will see the error:

Error: dotprompt: NOT_FOUND: Could not find 'random-recipe.wacky.prompt' in the prompts folder.

Expected behavior
I would expect behaviour as per the documents, which is that the random-recipe.prompt file is loaded as a fallback and then executed.

Additional context
I'd be happy to pick this up with a bit of guidance on expectations around behaviour.

@njpearman njpearman added bug Something isn't working js labels Jun 27, 2024
@MichaelDoyle
Copy link
Member

Thanks for reporting - we'll take a closer look.

@maxl0rd
Copy link
Contributor

maxl0rd commented Jun 27, 2024

This was a feature of an earlier iteration of dotprompt, but it was removed in the final plugin. We'll update the docs to reflect that change.

@i14h i14h added the docs Improvements or additions to documentation label Jul 3, 2024
@MichaelDoyle MichaelDoyle reopened this Jul 8, 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 docs Improvements or additions to documentation js
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants