feat(ranking): add safe article ranking and limits

Rank candidate articles using the selected preference and enforce global and per-source article limits.

Refs #6

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 19:54:17 +01:00
parent 50bde816ed
commit a4d63015d4
13 changed files with 918 additions and 138 deletions

View File

@ -48,7 +48,6 @@ func NewOllamaManager(endpoint string) *OllamaProvider {
return newOllama(endpoint, "")
}
func (p *OllamaProvider) Name() string { return "ollama" }
func (p *OllamaProvider) Summarize(ctx context.Context, prompt string, opts GenOptions) (string, error) {
@ -65,6 +64,9 @@ func (p *OllamaProvider) Summarize(ctx context.Context, prompt string, opts GenO
"num_ctx": numCtx,
},
}
if opts.JSONMode {
body["format"] = "json"
}
b, _ := json.Marshal(body)
req, err := http.NewRequestWithContext(ctx, http.MethodPost, p.endpoint+"/api/generate", bytes.NewReader(b))
if err != nil {