0d5bd0a9f0
Two buttons' worth of cost: wrong, or wrong and it should have been this. The second is worth much more and is not required to give the first, so a turn marked wrong with no target still lands as a usable negative. The target is one of the seven intents, never free text: an unroutable label would enter the one table V-632 fits prototypes from. /api/correct is not behind the step-up gate. It reaches no router, no model and no act path, and a correction that costs a passkey tap is one that does not get made.
40 lines
1.7 KiB
HTML
40 lines
1.7 KiB
HTML
{{template "shellTop" "chat"}}
|
|
<h1>Chat</h1>
|
|
<section class=card>
|
|
{{if .Error}}<div class="msg msg-err">{{.Error}}</div>{{end}}
|
|
<div class="scroll chat-scroll" id=chatHistory>
|
|
{{range .Messages}}
|
|
<div class="chat-msg {{.Role}}"><strong>{{if eq .Role "user"}}you{{else}}maven{{end}}:</strong> {{.Text}}{{if .Source}} <span class="badge badge-accent" title="the query source that claimed this turn">{{.Source}}</span>{{end}}</div>
|
|
{{if and (eq .Role "assistant") .TraceID}}
|
|
{{if .Corrected}}
|
|
<div class=chat-correct><span class="badge badge-ok" title="the label is kept; the transcript still expires in 14 days">corrected: {{.Corrected}}</span></div>
|
|
{{else}}
|
|
<form method=post action=/api/correct class=chat-correct>
|
|
<input type=hidden name=trace_id value="{{.TraceID}}">
|
|
<input type=hidden name=q value="{{$.UserText}}">
|
|
<input type=hidden name=rep value="{{.Text}}">
|
|
<input type=hidden name=s value="{{.Source}}">
|
|
<button class="btn btn-sm" title="wrong, and I am not saying what it was">wrong</button>
|
|
<span class=chat-correct-label>should have been:</span>
|
|
{{range $.Targets}}<button class="btn btn-sm btn-muted" name=should_be value="{{.}}">{{.}}</button>{{end}}
|
|
</form>
|
|
{{end}}
|
|
{{end}}
|
|
{{else}}
|
|
<div class=empty>
|
|
<svg class=icon width="20" height="20"><use href="/ethos-icons.svg#i-message"/></svg>
|
|
<div>start a conversation</div>
|
|
</div>
|
|
{{end}}
|
|
</div>
|
|
<form method=post action=/api/chat class=chat-form>
|
|
<input type=text name=text class=input-wide placeholder="type a message..." required autofocus>
|
|
<button class=btn>send</button>
|
|
</form>
|
|
</section>
|
|
<script>
|
|
var ch = document.getElementById('chatHistory');
|
|
if(ch) ch.scrollTop = ch.scrollHeight;
|
|
</script>
|
|
{{template "shellBottom"}}
|