-
Notifications
You must be signed in to change notification settings - Fork 165
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -395,6 +395,7 @@ function promptMetadata(options: PromptConfig<any, any, any>) { | |
return { | ||
...options.metadata, | ||
prompt: { | ||
...options.metadata?.prompt, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
config: options.config, | ||
input: { | ||
schema: options.input ? toJsonSchema(options.input) : undefined, | ||
|
@@ -784,7 +785,7 @@ function loadPrompt( | |
type: 'prompt', | ||
prompt: { | ||
...promptMetadata, | ||
template: source, | ||
template: parsedPrompt.template, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Set the template to just the body, w/o the yaml header. |
||
}, | ||
}, | ||
maxTurns: promptMetadata.raw?.['maxTurns'], | ||
|
There was a problem hiding this comment.
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...