-
Notifications
You must be signed in to change notification settings - Fork 623
Description
Problem
The existence of both definePrompt and defineDotPrompt is causing confusion. See also: discussion https://github.com/firebase/genkit/discussions/337. I believe this at least partially stems from the following documentation which frames definePrompt as a starting point, and dotprompt as a more advanced capability:
https://firebase.google.com/docs/genkit/prompts
I don't think this is what we intend; rather I think we intend for developers to start with dotprompt.
Background history/context:
When we first implemented the dotprompt library, we had a method definePrompt that was used to create and register a prompt action in the registry. Calling this action conveniently hydrated any input variables into the prompt and then called the model to generate a response.
Later, when we added dotprompt functionality to the Developer UI, we needed an action that would simply render the prompt template without doing the generate step. This led to the following changes:
definePromptwas repurposed as a lower level method that registers a prompt action which returns aGenerateRequestwithout doing the generate step.- A new dotprompt plugin was then created that exported a
defineDotPromptmethod, which followed the old semantics (render the template and then call generate). It usesdefinePromptunder the covers to register the prompt, which allows the Developer UI to call the underlying prompt action in cases where it only needs the rendered prompt template.
Proposal
- At minimum, we should update the docs to orient users toward dotPrompt first.
- Consider renaming
definePromptto something more indicative of what it should be used for.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status