An open source framework for building AI-powered apps with familiar code-centric patterns. Genkit makes it easy to integrate, test, and deploy sophisticated AI features to Firebase or Google Cloud.
Apache License 2.0
607
stars
74
forks
source link
[dotprompt] dotprompt variants don't fall through to "defaults" as documented #496
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:
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.
Describe the bug The Prompt Variants section of the documentation for
.prompt
files states: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.tsTo Reproduce Create a prompt file with the following name:
Then try to load the prompt with the following set up:
Rather than loading the prompt, you will see the error:
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.