feat(qa): support synthesis-wide chat context (#63)

This commit is contained in:
2026-11-26 14:40:03 +01:00
parent d42cd00315
commit 0a19d1c617
14 changed files with 411 additions and 38 deletions

View File

@ -0,0 +1,11 @@
package summaryqa
// ContextBytes measures the original UTF-8 content, not rune count or JSON
// escaping. Both adapters use the same bound and must never trim chat context.
func (r StatelessRequest) ContextBytes() int {
size := len(r.Summary) + len(r.Passage) + len(r.Question)
for _, turn := range r.History {
size += len(turn.Passage) + len(turn.Question) + len(turn.Answer)
}
return size
}