Citation
A quotation of a record, rendered from the record rather than the model's paraphrase of it — so the words are the real ones. The quote is escaped text, so neither the record nor the model can inject markup.
A quoted message
cite.avatar with no block draws the gem's avatar for the author.
<div class="mx-auto max-w-2xl">
<%= ai_chat_message role: :assistant do %>
<p>She said as much last week:</p>
<%= ai_chat_citation do |cite| %>
<% cite.avatar %>
<% cite.who "Ana Silva" %>
<% cite.when @now - 6.days, url: "#" %>
<% cite.quote "I'm keen, but I'm travelling until the 18th.\nCould we talk after that? <b>Thanks!</b>" %>
<% end %>
<% end %>
</div>A list of sources
compact: true, one line each.
Four weeks, accruing monthly from the first day.
Anyone can work from anywhere in the same timezone band.
Notice is one month on either side after probation.
<div class="mx-auto max-w-2xl">
<% [ [ "Handbook · Leave", "Four weeks, accruing monthly from the first day." ],
[ "Handbook · Remote work", "Anyone can work from anywhere in the same timezone band." ],
[ "Contract template §4", "Notice is one month on either side after probation." ] ].each do |source, text| %>
<%= ai_chat_citation compact: true do |cite| %>
<% cite.who source %>
<% cite.quote text %>
<% end %>
<% end %>
</div>