feat(summary): send complete articles within user budget (#39)

This commit is contained in:
2026-11-24 17:39:26 +01:00
parent d0c7cb7cae
commit 79953ce49f
73 changed files with 1688 additions and 288 deletions

View File

@ -174,7 +174,7 @@ func TestTicket28LaterGroupFailureDiscardsAllScoresWithExplicitBudgetedExcerpt(t
}))
defer srv.Close()
ranker, _ := NewLayaHTTPRanker(LayaHTTPConfig{BaseURL: srv.URL, BatchSize: 1})
got, err := ranker.Rank(context.Background(), "title_content", []models.UserAsset{{Name: strings.Repeat("a", 400), Symbol: "ONE"}, {Name: strings.Repeat("b", 400), Symbol: "TWO"}, {Name: strings.Repeat("c", 400), Symbol: "THREE"}}, []generation.Candidate{{ID: "c", Article: scraper.Article{Title: "private title", Content: longContent}}})
got, err := ranker.Rank(context.Background(), "title_content", []models.UserAsset{{Name: strings.Repeat("a", 400), Symbol: "ONE"}, {Name: strings.Repeat("b", 400), Symbol: "TWO"}, {Name: strings.Repeat("c", 400), Symbol: "THREE"}}, []generation.Candidate{{ID: "c", Article: scraper.Article{Title: "private title", ContentState: scraper.ContentComplete, Content: longContent}}})
if err == nil || got != nil || calls != 2 {
t.Fatalf("partial ranking/fallback: calls=%d err=%v", calls, err)
}