Files
relata/internal/web/templates/partial_answer.html
T
2026-08-11 10:40:10 +01:00

69 lines
2.2 KiB
HTML

{{define "partial_answer.html"}}
<section class="answer" aria-labelledby="answer-heading">
<h2 id="answer-heading">Answer from stored knowledge</h2>
<p class="answer-caveat">
This answer was generated from the stored items listed below and nothing else.
It is a summary of what those sources say — not a verified statement of fact.
</p>
{{if not .Answer.Sufficient}}
<p class="flash flash-warn" role="status">
The stored material does not fully answer this question. Treat what follows as partial.
</p>
{{end}}
<div class="answer-body">
{{range .AnswerParagraphs}}<p>{{.}}</p>{{end}}
</div>
<h3>Sources used</h3>
{{if .Answer.Sources}}
<ol class="source-list">
{{range .Answer.Sources}}
<li class="source {{if not .Cited}}source-uncited{{end}}">
<p class="source-head">
<span class="ref">{{.Ref}}</span>
<a href="/items/{{.ItemID}}">{{.Title}}</a>
{{if .Date}}<span class="muted">{{.Date}}</span>{{end}}
{{if not .Cited}}<span class="pill pill-quiet">retrieved but not cited</span>{{end}}
</p>
<blockquote>{{truncate 500 .Excerpt}}</blockquote>
</li>
{{end}}
</ol>
{{else}}
<p class="muted">No stored sources were used.</p>
{{end}}
{{if .Answer.Uncertainty}}
<h3>Uncertainty and conflicts</h3>
<ul class="conflict-list">
{{range .Answer.Uncertainty}}<li>{{.}}</li>{{end}}
</ul>
{{end}}
{{if .Answer.InferredRelationshipsUsed}}
<h3>Inferred relationships used in retrieval</h3>
<p class="muted">
These links were proposed by analysis and have not been confirmed by anyone.
They influenced which sources were retrieved; they are not evidence in themselves.
</p>
<ul>
{{range .Answer.InferredRelationshipsUsed}}
<li>
<a href="/items/{{.ItemID}}">{{if .Title}}{{.Title}}{{else}}(item){{end}}</a>
— {{relTypeLabel .Type}}, strength {{score2 .Strength}} ({{strengthLabel .Strength}})
</li>
{{end}}
</ul>
{{end}}
<p class="answer-meta muted">
Generated by {{if .Answer.Model}}{{.Answer.Model}}{{else}}the configured model{{end}}
from {{.Answer.Retrieved}} retrieved item{{if ne .Answer.Retrieved 1}}s{{end}}
in {{.Answer.TookMS}} ms.
</p>
</section>
{{end}}