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

@ -83,7 +83,7 @@ func TestLayaHTTPBearerEvidenceFallbackAndStableTies(t *testing.T) {
defer srv.Close()
ranker, _ := NewLayaHTTPRanker(LayaHTTPConfig{BaseURL: srv.URL, APIKey: "test-secret"})
figi := "BBG000000001"
candidates := []generation.Candidate{{ID: "1", Article: scraper.Article{Title: "Title", Content: "Title"}}, {ID: "2", Article: scraper.Article{Title: "Second", Content: "Available evidence", Symbols: []string{"SPX"}}}}
candidates := []generation.Candidate{{ID: "1", Article: scraper.Article{Title: "Title", ContentState: scraper.ContentComplete, Content: "Title"}}, {ID: "2", Article: scraper.Article{Title: "Second", ContentState: scraper.ContentComplete, Content: "Available evidence", Symbols: []string{"SPX"}}}}
got, err := ranker.Rank(context.Background(), "title_content", []models.UserAsset{{Name: "S&P 500", Symbol: "SPX", FIGI: &figi}}, candidates)
if err != nil || !reflect.DeepEqual(got, candidates) {
t.Fatalf("unstable ties or changed evidence: %v", err)