Mercurial Hosting > lang
diff src/lib/ai/claude/Ai_chat.luan @ 34:0fb3488a017d
show_text
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 04 Aug 2025 23:06:19 -0600 |
parents | 505185272dd7 |
children | 3117876debca |
line wrap: on
line diff
--- a/src/lib/ai/claude/Ai_chat.luan Mon Aug 04 15:56:23 2025 -0600 +++ b/src/lib/ai/claude/Ai_chat.luan Mon Aug 04 23:06:19 2025 -0600 @@ -27,7 +27,7 @@ %><%=system_prompt%><% end -function Ai_chat.output_messages_html(thread,old_thread) +function Ai_chat.output_messages_html(show_text,thread,old_thread) if thread == nil then return end @@ -39,6 +39,7 @@ local old_messages = old_thread.messages or error n = #old_messages end + local checked = show_text and "checked" or "" for i, message in ipairs(messages) do if i <= n then continue @@ -56,7 +57,15 @@ text = html_encode(text) %> <h3><%=who%></h3> - <div markdown role="<%=role%>"><%=text%></div> + <div role="<%=role%>"> + <div message markdown><%=text%></div> +<% if role=="assistant" then %> + <div controls> + <audio controls preload=none></audio> + <label clickable><input type=checkbox name=show_text <%=checked%> >Show text</label> + </div> +<% end %> + </div> <% end local content = message.content or error()