Skip to content

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

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

Conversation

alwinraju
Copy link
Contributor

@alwinraju alwinraju commented May 24, 2023

More likely to be consistent with formatting
+
Added functionality to get different levels of summaries:

  1. TLDR
  2. Key Highlights
  3. Detailed Summary
  4. Conclusion

Added functionality to get different levels of summaries: 
TLDR
Key Highlights
Detailed Summary
Conclusion
@alwinraju alwinraju closed this May 24, 2023
@alwinraju alwinraju reopened this May 24, 2023
@AI-Chef
Copy link
Contributor

AI-Chef commented Jul 20, 2023

looks good

@PeterDaveHello
Copy link
Member

It looks like there are some conflicts that need to be resolved.

@eric2788
Copy link

Will it have a timestamp summary? It would be amazing

@PeterDaveHello PeterDaveHello requested a review from Copilot May 31, 2025 20:18
Copy link

@Copilot Copilot AI left a 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(

Comment on lines 55 to 86
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}`,
)
Copy link
Preview

Copilot AI May 31, 2025

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.

@PeterDaveHello
Copy link
Member

/review

Copy link

qodo-merge-pro bot commented Jun 2, 2025

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:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Prompt Formatting

The prompt has inconsistent indentation which might affect how it's processed. Consider removing the leading spaces in each line of the prompt to ensure consistent formatting.

`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.)` +
String Concatenation

The prompt template and the video information are concatenated in a potentially confusing way. Consider using template literals more effectively to clearly separate the prompt template from the dynamic content.

(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}`,

@PeterDaveHello
Copy link
Member

/improve

Copy link

qodo-merge-pro bot commented Jun 2, 2025

Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

PR Code Suggestions ✨

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix template formatting issue

The template section and the video title are concatenated without proper
spacing, which will cause formatting issues. Add a newline character between the
template and the actual content to ensure proper markdown formatting.

src/content-script/site-adapters/youtube/index.mjs [55-86]

 return cropText(
     `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}`,
+    (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}`,
   )

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies a formatting issue where the template and actual content are concatenated without proper spacing. Adding a newline would improve the output formatting and readability of the generated summary.

Low
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants