Skip to content

fix(dotprompt): properly group prompt variants#187

Merged
MichaelDoyle merged 1 commit into
mainfrom
md/prompt-variants
May 14, 2026
Merged

fix(dotprompt): properly group prompt variants#187
MichaelDoyle merged 1 commit into
mainfrom
md/prompt-variants

Conversation

@MichaelDoyle
Copy link
Copy Markdown
Contributor

@MichaelDoyle MichaelDoyle commented May 14, 2026

Variants were being displayed in Dev UI as their own prompts. This change properly groups them with their parent/base.

image

Fixes #188

@MichaelDoyle MichaelDoyle requested a review from xavidop May 14, 2026 15:26
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for prompt variants in the Genkit AI library. Key changes include adding a "variant" field to the Prompt and DotPrompt classes, updating their builders and constructors, and implementing logic to extract variants from prompt names (e.g., "recipe.robot"). The metadata generation for prompts now correctly handles base names and variants. Additionally, unit tests were added for both Prompt and DotPrompt to verify variant handling, and the sample code was updated to demonstrate the new functionality. I have no feedback to provide.

@MichaelDoyle MichaelDoyle merged commit 9c37c6e into main May 14, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dev UI] Prompt variants are not properly grouped

2 participants