feat(qa): add synthesis conversations with source retention (#52)

This commit is contained in:
2026-11-25 19:46:06 +01:00
parent 90dd2a65d2
commit 287811184f
49 changed files with 2636 additions and 47 deletions

View File

@ -4,7 +4,7 @@ import { summariesApi, type Summary, type GenerationOutcome, type GenerationHist
import { preferencesApi, type UserPreferences, type SummaryModelOption } from '@/api/preferences'
import { assetsApi, type Asset } from '@/api/assets'
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
import { Markdown } from '@/components/ui/markdown'
import { SummaryQA } from '@/components/SummaryQA'
import { Button } from '@/components/ui/button'
import { Spinner } from '@/components/ui/spinner'
import { useAuth } from '@/lib/auth'
@ -12,10 +12,6 @@ import { generationCopy, generationLimitMessage, generationFailureMessage } from
// ── Summary content renderer ────────────────────────────────────────────────
function SummaryContent({ content }: { content: string }) {
return <Markdown content={content} />
}
function PromptBudgetRemoval({ outcome }: { outcome?: GenerationOutcome | null }) {
const count = outcome?.articles_removed_for_prompt_budget
if (!outcome || !Number.isSafeInteger(count) || !count || count < 1) return null
@ -210,7 +206,7 @@ export function Dashboard() {
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground mb-3">Langue de cette synthèse : {currentOutcome ? (currentOutcome.language === 'fr' ? 'Français' : 'English') : 'non renseignée'}</p>
<SummaryContent content={current.content} />
<SummaryQA summaryId={current.id} content={current.content} />
<p className="mt-3 text-sm text-muted-foreground">Modèle utilisé : {current.provider_name && current.model_name ? `${current.provider_name} · ${current.model_name}` : 'non renseigné pour cette synthèse historique'}</p>
</CardContent>
</Card>