gemini/refactor/generalize-chunk-processing #60

Merged
eleith merged 12 commits from gemini/refactor/generalize-chunk-processing into main 2025-09-16 18:35:24 +00:00
Owner
  • refactor ai.go to have smaller method sizes
  • chunk entries for primary grouping, sub grouping and summary llm jobs
  • generate content with response schema method for llm service
  • process chunks of inputs in llm util
- refactor ai.go to have smaller method sizes - chunk entries for primary grouping, sub grouping and summary llm jobs - generate content with response schema method for llm service - process chunks of inputs in llm util
eleith added 12 commits 2025-09-16 18:33:38 +00:00
Adds a generic llm.ProcessInChunks function to run jobs on data chunks in parallel.

Refactors GroupAIEntries to use this new helper function, replacing its own concurrency management.
Refactors `ProcessPrimaryGroupWithAI` to use the `llm.ProcessInChunks` helper.

For large entry groups, summarization and sub-grouping tasks are now chunked and run in parallel to prevent timeouts.

Tests for this function have been updated to cover the new chunking and failure-handling logic.
Renames `MaxEntriesForSummarization` to `MaxEntriesPerJob` to reflect its general use in all AI processing jobs.
Remove redundant `processSingleChunk` function and simplify
`ProcessPrimaryGroupWithAI` to always process chunks concurrently. This
improves readability and reduces code duplication.
Abstract out reusable logic for preparing LLM entries and executing
LLM requests. This improves readability and reduces code duplication.
Refactor the `consolidatePrimaryGroups` function to use the new
`executeLLMRequestAndParse` function. This improves readability and
reduces code duplication.
Refactor the `getSummaryForGroup` function to use the new
`executeLLMRequestAndParse` function. This improves readability and
reduces code duplication.
Move the `ExecuteLLMRequestAndParse` function from
`internal/digest/view/ai.go` to `internal/llm/util.go`. This improves
readability and reduces code duplication.
refactor large methods in view/ai.go
ci/woodpecker/push/build-docker Pipeline was successful
be5c5c3301
eleith merged commit be5c5c3301 into main 2025-09-16 18:35:24 +00:00
eleith deleted branch gemini/refactor/generalize-chunk-processing 2025-09-16 18:35:24 +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#60