feat(bloomberg): enrich article content for summaries (#36)

This commit is contained in:
2026-11-24 13:44:52 +01:00
parent 686f66a437
commit a53aec7947
22 changed files with 1148 additions and 127 deletions

View File

@ -43,7 +43,7 @@ func TestTicket34NoulQuestionsDistinctAndAnyGroupYesRequiresEveryGroup(t *testin
raw, _ := json.Marshal(map[string]any{"results": []any{map[string]any{"answers": map[string]any{key: map[string]any{"type": "noul", "noul": probability, "answer_confidence": 0.99}}, "usage": map[string]any{"truncated": false}}}})
return &http.Response{StatusCode: 200, Body: io.NopCloser(strings.NewReader(string(raw))), Header: make(http.Header)}, nil
})}
assets := []models.UserAsset{{Name: strings.Repeat("a", 700), Symbol: "ONE"}, {Name: strings.Repeat("b", 700), Symbol: "TWO"}}
assets := []models.UserAsset{{Name: strings.Repeat("a", 400), Symbol: "ONE"}, {Name: strings.Repeat("b", 400), Symbol: "TWO"}}
got, err := r.DecideMentions(context.Background(), "title", pass, assets, []generation.Candidate{{ID: "one"}})
if err != nil || len(got) != 1 || calls != 2 {
t.Fatalf("calls=%d err=%v", calls, err)
@ -72,7 +72,7 @@ func TestTicket34NoulRejectsMissingInvalidAbstainedOrTruncatedGroup(t *testing.T
raw := `{"results":[{"answers":{"` + key + `":` + value + `},"usage":{"truncated":false}}]}`
return &http.Response{StatusCode: 200, Body: io.NopCloser(strings.NewReader(raw)), Header: make(http.Header)}, nil
})}
got, err := r.DecideMentions(context.Background(), "title", generation.MentionDirect, []models.UserAsset{{Name: strings.Repeat("a", 700)}, {Name: strings.Repeat("b", 700)}}, []generation.Candidate{{ID: "one"}})
got, err := r.DecideMentions(context.Background(), "title", generation.MentionDirect, []models.UserAsset{{Name: strings.Repeat("a", 400)}, {Name: strings.Repeat("b", 400)}}, []generation.Candidate{{ID: "one"}})
if err == nil || got != nil || calls != 2 {
t.Fatal("accepted partial/invalid group")
}