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

fix: set prompt metadata for render action as expected by dev ui #2180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelDoyle
Copy link
Member

image

Checklist (if applicable):

@@ -784,7 +785,7 @@ function loadPrompt(
type: 'prompt',
prompt: {
...promptMetadata,
template: source,
template: parsedPrompt.template,
Copy link
Member Author

Choose a reason for hiding this comment

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

Set the template to just the body, w/o the yaml header.

@@ -395,6 +395,7 @@ function promptMetadata(options: PromptConfig<any, any, any>) {
return {
...options.metadata,
prompt: {
...options.metadata?.prompt,
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know the history here, but copying existing metadata.prompt as the base, and then overriding with the few options below that were already present.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind adding unit tests for the metadata (can probably just add some assertions to existing tests)? I just feel like you've fixed this in the past and I broke it again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants