feat(qa): support synthesis-wide chat context (#63)
This commit is contained in:
@ -93,7 +93,7 @@ func TestTicket60WebSearchPersistenceReplayPrivacyAndOwnershipPostgres(t *testin
|
||||
p := &web60Provider{result: summaryqa.AnswerResult{Answer: "web answer", WebSearchPerformed: true, Citations: []summaryqa.Citation{{Title: " useful title ", URL: "https://EXAMPLE.COM:443/report#section"}, {Title: "duplicate", URL: "https://example.com/report"}, {Title: "bad", URL: "javascript:alert(1)"}}}}
|
||||
web60Bind(t, f, p)
|
||||
path := qa53Path()
|
||||
// A previous normal exchange exists, but must never be passed to web search.
|
||||
// A previous answered exchange is part of the full web chat context (#63).
|
||||
f.call(t, "POST", ticket14UserA, path+"/messages", qa53Body("00000000-0000-0000-0000-000000006001", "OLD_HISTORY"), 200)
|
||||
p.result.Answer = "web answer"
|
||||
body := `{"request_id":"` + qa53Request + `","passage":"CURRENT_PASSAGE","question":"CURRENT_QUESTION","use_web_search":true}`
|
||||
@ -110,8 +110,8 @@ func TestTicket60WebSearchPersistenceReplayPrivacyAndOwnershipPostgres(t *testin
|
||||
if !first.UseWebSearch || !first.WebSearchPerformed || first.Replayed || len(first.Citations) != 1 || first.Citations[0] != (summaryqa.Citation{Title: "useful title", URL: "https://example.com/report"}) {
|
||||
t.Fatalf("wrong structured answer: %+v", first)
|
||||
}
|
||||
if len(p.requests) != 1 || p.requests[0].Summary != "" || len(p.requests[0].History) != 0 || !p.requests[0].UseWebSearch || p.requests[0].Passage != "CURRENT_PASSAGE" || p.requests[0].Language != "fr" {
|
||||
t.Fatal("non-minimal web request", p.requests)
|
||||
if len(p.requests) != 1 || p.requests[0].Summary != "OWN_SYNTHESIS_MARKER" || len(p.requests[0].History) != 1 || p.requests[0].History[0].Question != "OLD_HISTORY" || !p.requests[0].UseWebSearch || p.requests[0].Passage != "CURRENT_PASSAGE" || p.requests[0].Language != "fr" {
|
||||
t.Fatal("incomplete web request", p.requests)
|
||||
}
|
||||
// Replay must remain available even after the selected model is disabled.
|
||||
if _, err := f.db.Exec(`UPDATE ai_provider_models SET enabled=false`); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user