Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
We recently received some feedback about our excerpt generation feature. While it seems to provide a decent summary of the content, excerpts are often meant to be used alongside the title of the content. For instance, a common design pattern is to display a featured image with the title below and the excerpt below that. In this case, ideally the excerpt pairs well with this title and doesn't just repeat the same thing.
In testing, often the generated excerpts include the title, sometime verbatim, sometimes with a word or two changed. The generated excerpt will contain more than that but often it will start with the same title. In the above mentioned scenario, this isn't ideal as you end up with the same (or close to the same) text shown back to back (first in the title, then in the excerpt).
This PR does a few things to try and help with this:
system
message instead of auser
message. From OpenAI's docs:Not sure how much this helps but feels like best practice to set our prompt in the
system
message and the actual content we want summarized into a separateuser
message.Not sure if that last part actually helps or not. Seems like the next change is the one that helped the most.
How to test the Change
Changelog Entry
Credits
Props @dkotter
Checklist: