[LLM Classification] Skip duplicate LLM calls on no-op feed updates#470
Open
tcx4c70 wants to merge 1 commit into
Open
[LLM Classification] Skip duplicate LLM calls on no-op feed updates#470tcx4c70 wants to merge 1 commit into
tcx4c70 wants to merge 1 commit into
Conversation
Some RSS sources re-publish existing articles with no semantic change (reformatted author, tweaked date, new enclosure attribute, etc.). FreshRSS detects these as updated entries via hash mismatch and calls EntryBeforeInsert again, which previously triggered another LLM API call for every such pseudo-update. The extension now stores a SHA-1 of the prompt it sent (plus the exact list of tags it assigned) on each classified entry, under the 'llm_classification' attribute namespace. On a feed update of an already-classified entry: - if the new prompt hashes to the same value, the prior tags are restored and no LLM call is made; - otherwise, behaviour follows the new 'Re-classify when content changes' toggle (default on): call the LLM and refresh, or keep the prior tags untouched. When re-classifying, the prior tag list is used to remove only those exact tags (instead of the previous prefix-based heuristic), so manual tags sharing the prefix are preserved.
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Some RSS sources re-publish existing articles with no semantic change (reformatted author, tweaked date, new enclosure attribute, etc.). FreshRSS detects these as updated entries via hash mismatch and calls EntryBeforeInsert again, which previously triggered another LLM API call for every such pseudo-update.
The extension now stores a SHA-1 of the prompt it sent (plus the exact list of tags it assigned) on each classified entry, under the 'llm_classification' attribute namespace. On a feed update of an already-classified entry:
When re-classifying, the prior tag list is used to remove only those exact tags (instead of the previous prefix-based heuristic), so manual tags sharing the prefix are preserved.