refactor(digest): consolidate AI-generated groups #58

Merged
eleith merged 2 commits from gemini/refactor/consolidate-ai-groups into main 2025-09-12 22:23:59 +00:00
Owner

This change addresses the creation of too many similar primary groups by adding an LLM-powered consolidation step.

The GroupAIEntries function now processes entry chunks in parallel. A new consolidatePrimaryGroups function is introduced, which calls an LLM to merge the initial, numerous group titles into a smaller set. The logic preserves any group titles that the LLM fails to map, and this behavior is verified in a new unit test.

Additionally, all prompt constants have been moved from ai.go into a new internal/digest/view/ai_prompts.go file.

This change addresses the creation of too many similar primary groups by adding an LLM-powered consolidation step. The GroupAIEntries function now processes entry chunks in parallel. A new consolidatePrimaryGroups function is introduced, which calls an LLM to merge the initial, numerous group titles into a smaller set. The logic preserves any group titles that the LLM fails to map, and this behavior is verified in a new unit test. Additionally, all prompt constants have been moved from ai.go into a new internal/digest/view/ai_prompts.go file.
eleith added 1 commit 2025-09-12 22:07:11 +00:00
This change addresses the creation of too many similar primary groups by adding an LLM-powered consolidation step.

The GroupAIEntries function now processes entry chunks in parallel. A new consolidatePrimaryGroups function is introduced, which calls an LLM to merge the initial, numerous group titles into a smaller set. The logic preserves any group titles that the LLM fails to map, and this behavior is verified in a new unit test.

Additionally, all prompt constants have been moved from ai.go into a new internal/digest/view/ai_prompts.go file.
eleith added 1 commit 2025-09-12 22:20:13 +00:00
Moves the Go structs for LLM responses into the `ai_prompts.go` file, alongside the prompts that generate them.

The structs have been renamed to better associate them with their corresponding prompt variables:
- `GroupingResponse` is now `InitialGroupingResponse`
- `AIGroupSummaryResponse` is now `SummaryResponse`
- `AISubGroupingResponse` is now `SubGroupingResponse`

This change improves maintainability by keeping the prompt, its expected response type, and its schema in the same file.
eleith merged commit b2795d95fc into main 2025-09-12 22:23:59 +00:00
eleith deleted branch gemini/refactor/consolidate-ai-groups 2025-09-12 22:23:59 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: eleith/miniflux-digest#58