-
Notifications
You must be signed in to change notification settings - Fork 819
Refined youtube summary outputs #363
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
base: master
Are you sure you want to change the base?
Conversation
Added functionality to get different levels of summaries: TLDR Key Highlights Detailed Summary Conclusion
looks good |
da53d37
to
62a093f
Compare
It looks like there are some conflicts that need to be resolved. |
Will it have a timestamp summary? It would be amazing |
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.
Pull Request Overview
This PR enhances the YouTube adapter’s summary prompt by providing a more structured template and explicit sections for different summary levels.
- Expanded the AI prompt to guide generation of TLDR, Key Highlights, Detailed Summary, and Conclusion.
- Added Markdown structuring instructions (headers, lists, bold/italic styling, table usage).
Comments suppressed due to low confidence (2)
src/content-script/site-adapters/youtube/index.mjs:84
- The prompt is split across multiple concatenated template literals, which can be error-prone. Consider combining them into a single template literal to simplify the code and avoid manual concatenation.
...)` +
src/content-script/site-adapters/youtube/index.mjs:53
- The new prompt template introduces multiple summary sections (TLDR, Key Points, Detailed Summary, Conclusion) but lacks tests to verify each section is correctly included. Consider adding unit or integration tests to validate the generated prompt structure.
return cropText(
return cropText( | ||
`Provide a structured summary of the following video in markdown format, focusing on key takeaways and crucial information, and ensuring to include the video title. The summary should be easy to read and concise, yet comprehensive.` + | ||
`Think step by step and provide a clear, concise, yet comprehensive summary of the provided YouTube video. Your task is to distil the video's content into a structured written format, using markdown for readability and organization. | ||
|
||
In your summary, please ensure to: | ||
|
||
1. **Include the video title**: This will set the context and provide an idea about the video's content. | ||
2. **Identify and summarize the key points/highlights**: List out the primary points, arguments, discoveries, or themes presented in the video. Consider these as the "need-to-know" points for understanding the video's core message/content. | ||
3. **Provide detail without losing clarity**: After the key points, provide a more detailed summary. Include significant sub-points, illustrative examples, discussions, and any conclusions or implications. Aim for this detailed section to complement and expand on the key points, but ensure it remains digestible and clear. | ||
4. **Structure your summary with markdown**: Use headers for different sections (e.g., Key Points, Detailed Summary), bullet points for listing items, bold or italic text for emphasis, and tables where appropriate. | ||
5. **Capture the video's essence without unnecessary length**: Strive for a balance of detail and brevity. Capture all the necessary information, but avoid overly long sentences and excessive detail. | ||
|
||
Remember, the goal is to ensure that someone who reads your summary will gain a complete and accurate understanding of the video's content, even if they haven't watched it themselves. | ||
If a video includes visual elements crucial to its understanding (like a graph, diagram, or scene description), please describe it briefly within the relevant part of the summary. | ||
|
||
Here's a template to guide your summary: | ||
# [title] | ||
|
||
## TLDR | ||
(Provide a short summary of the video in a maximum of 3 sentences) | ||
|
||
## Key Points/Highlights | ||
- Main Point/Highlight 1 | ||
- Main Point/Highlight 2 | ||
- ... | ||
|
||
## Detailed Summary | ||
(Expand on the key points with sub-points, examples, discussions, conclusions or implications) | ||
|
||
## Conclusion | ||
(Any conclusions made in the video, the final thoughts of the speaker, etc.)` + | ||
`The video title is "${title}". The subtitle content is as follows:\n${subtitleContent}`, | ||
) |
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.
The instruction string is very long and embedded inline, which can hinder readability and maintainability. Consider extracting this multi-line prompt into a named constant (e.g., YOUTUBE_SUMMARY_TEMPLATE) outside the function and referencing it here.
Copilot uses AI. Check for mistakes.
/review |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
/improve |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨
|
More likely to be consistent with formatting
+
Added functionality to get different levels of summaries: