-
Notifications
You must be signed in to change notification settings - Fork 0
Improve Per-extractor Instructions #170
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
941f61e
Create specific Subreddit instructions
elzik 6ecdb42
Merge branch 'main' of https://github.com/elzik/breef into improve-pe…
elzik a5ee7c4
Support development in VS Code
elzik e5506c6
Ensure Subreddit summaries include valid URLs
elzik 9bdb8ef
Fix summarisation instruction typo
elzik 339b0ce
Instruct to use commet URLs for comments
elzik 5784130
Refactor method overloads & ordering
elzik 94365e9
Remove unused overloads
elzik dd6c7d8
Use configured Reddit base URL
elzik a6e5da5
Open links externally and increase likelihood of replies being refernced
elzik 134b56e
Add unhappy path & edge case tests
elzik 0550b04
Allow assigning of null literal to non-nullable reference type for te…
elzik b0f0d7a
Use ArgumentNullException.ThrowIfNull
elzik 1b7a14e
Make extract title & urls unique for subreddits to make Wallabag entr…
elzik f127eb9
Avoid Docker tests running in parallel to fix hangs
elzik b59a87f
Code quality fixes
elzik 25fd92e
Fix typos in subreddit instructions
elzik 49ef7db
Improve reddit post instructions
elzik ad66d25
Update src/Elzik.Breef.Infrastructure/SummarisationInstructions/Reddi…
elzik 7441b5b
Fix grammatical errors in instructions
elzik 4571b59
Clarify reddit instructions
elzik c5afe8a
Imrpove HTML content instructions
elzik 6f90e5d
Fix markdown indentation
elzik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "Local", | ||
| "type": "coreclr", | ||
| "request": "launch", | ||
| "program": "${workspaceFolder}/src/Elzik.Breef.Api/bin/Debug/net8.0/Elzik.Breef.Api.dll", | ||
| "cwd": "${workspaceFolder}/src/Elzik.Breef.Api", | ||
| "stopAtEntry": false | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,8 @@ | ||
| namespace Elzik.Breef.Domain; | ||
|
|
||
| public record Extract(string Title, string Content, string? PreviewImageUrl, string ExtractType); | ||
| public record Extract( | ||
| string Title, | ||
| string Content, | ||
| string OriginalUrl, | ||
| string? PreviewImageUrl, | ||
| string ExtractType); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 24 additions & 8 deletions
32
src/Elzik.Breef.Infrastructure/SummarisationInstructions/HtmlContent.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,24 @@ | ||
| You are an expert summarizer. Your task is to summarize the provided text: | ||
| - Summarise text, including HTML entities. | ||
| - Limit summaries to 10% of the original length but never more than 200 words. | ||
| - Ensure accurate attribution of information to the correct entities. | ||
| - Do not include a link to the original article. | ||
| - Do not include the title in the response. | ||
| - Do not include any metadata in the response. | ||
| - Do not include a code block in the response. | ||
| # Task | ||
|
|
||
| Summarise the provided web page text. | ||
|
|
||
| ## Input Structure | ||
|
|
||
| The provided text is the main content extracted from a web page. | ||
|
|
||
| ## Requirements | ||
|
|
||
| 1. **Overview** | ||
| - Summarise text, including HTML entities. | ||
| - Limit summaries to 10% of the original length but never more than 200 words. | ||
| - Ensure accurate attribution of information to the correct entities. | ||
| 2. **Exclude** | ||
| - Links to original article | ||
| - Web page title | ||
| - Metadata | ||
| - Code blocks | ||
|
|
||
| ## Output Formatting | ||
|
|
||
| - Strictly well-formatted HTML output | ||
| - Do not include any markdown notation nor put the summary in a codeblock |
38 changes: 30 additions & 8 deletions
38
src/Elzik.Breef.Infrastructure/SummarisationInstructions/RedditPostContent.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,30 @@ | ||
| You are an expert summarizer. Your task is to summarize the provided text: | ||
| - Summarise text, including HTML entities. | ||
| - Limit summaries to 10% of the original length but never more then 200 words. | ||
| - Ensure accurate attribution of information to the correct entities. | ||
| - Do not include a link to the original articles. | ||
| - Do not include the title in the response. | ||
| - Do not include any metadata in the response. | ||
| - Do not include a code block in the response. | ||
| # Task | ||
|
|
||
| Summarise the provided Reddit post JSON data containing a single post and its nested comments. | ||
|
|
||
| ## Input Structure | ||
|
|
||
| JSON with a top-level "Post" item containing: | ||
| - Metadata: Title, Author, Subreddit, Score, Content, CreatedUtc, PostUrl | ||
| - Comments: Array with Author, Score, Content, CreatedUtc, PostUrl and nested Replies | ||
|
|
||
| ## Requirements | ||
|
|
||
| 1. **Overview**: Describe the general state/themes of the Reddit post | ||
| 2. **Top Level Post**: Summarise the top-level post in detail | ||
| 3. **Replies**: Summarise only the highest-scoring replies in lower detail | ||
| 4. **Summaries**: | ||
| - Maximum 200 words OR 10% of original length (whichever is shorter) | ||
| - For a top-level post, include post title as HTML link to the post URL: `<a href="RedditPostContent.PostUrl" target="_blank" rel="noopener noreferrer">Title</a>` | ||
| - For a post's highest-scoring replies, also summarise them and include author attribution with comment links: `<a href="RedditComment.PostUrl" target="_blank" rel="noopener noreferrer">@author</a>`. Link to the author's comment, not to the author's profile. | ||
| 5. **Exclude**: | ||
| - Links to Subreddit | ||
| - Root post title | ||
| - Metadata timestamps/scores | ||
| - Code blocks | ||
| - General description of the subreddit itself | ||
|
|
||
| ## Output Formatting | ||
|
|
||
| - Strictly well-formatted HTML output | ||
| - Do not include any markdown notation nor put the summary in a codeblock |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.