-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path_analysis_tab.html.erb
More file actions
51 lines (48 loc) · 1.42 KB
/
_analysis_tab.html.erb
File metadata and controls
51 lines (48 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<% if topics.present? %>
<%= render "govuk_publishing_components/components/summary_list", {
title: "Topics",
heading_size: "l",
heading_level: 2,
margin_bottom: 4,
items: [
{
field: "Primary topic",
value: topics.primary_topic.humanize,
},
{
field: "Secondary topic",
value: topics.secondary_topic&.humanize,
},
],
} %>
<% if topics.llm_responses.present? %>
<%= render "govuk_publishing_components/components/details", {
title: "LLM responses",
} do %>
<% topics.llm_responses.each do |namespace, response| %>
<h3 class="govuk-heading-m"><%= namespace %></h3>
<p class="govuk-body">
<%= render("components/code_snippet", content: JSON.pretty_generate(response)) %>
</p>
<% end %>
<% end %>
<% end %>
<% if topics.metrics.present? %>
<%= render "govuk_publishing_components/components/details", {
title: "Metrics",
} do %>
<%= render "govuk_publishing_components/components/summary_list", {
items: topics.metrics.map do |metric, value|
{
field: metric,
value: value,
}
end,
borderless: true,
} %>
<% end %>
<% end %>
<% end %>
<% if answer_relevancy_aggregate.present? %>
<%= render "generic_aggregate_auto_evaluation", aggregate: answer_relevancy_aggregate, title: "Answer relevancy" %>
<% end %>