|
1 | | -<%= render "govuk_publishing_components/components/summary_list", { |
2 | | - items: [ |
3 | | - { |
4 | | - field: "Primary topic", |
5 | | - value: topics.primary_topic&.humanize, |
6 | | - }, |
7 | | - { |
8 | | - field: "Secondary topic", |
9 | | - value: topics.secondary_topic&.humanize, |
10 | | - }, |
11 | | - ], |
12 | | -} %> |
| 1 | +<% if topics.present? %> |
| 2 | + <%= render "govuk_publishing_components/components/summary_list", { |
| 3 | + title: "Topics", |
| 4 | + heading_size: "l", |
| 5 | + heading_level: 2, |
| 6 | + margin_bottom: 4, |
| 7 | + items: [ |
| 8 | + { |
| 9 | + field: "Primary topic", |
| 10 | + value: topics.primary_topic.humanize, |
| 11 | + }, |
| 12 | + { |
| 13 | + field: "Secondary topic", |
| 14 | + value: topics.secondary_topic&.humanize, |
| 15 | + }, |
| 16 | + ], |
| 17 | + } %> |
13 | 18 |
|
14 | | -<% if topics.llm_responses.present? %> |
15 | | - <%= render "govuk_publishing_components/components/details", { |
16 | | - title: "LLM responses", |
17 | | - } do %> |
18 | | - <% topics.llm_responses.each do |namespace, response| %> |
19 | | - <h3 class="govuk-heading-m"><%= namespace %></h3> |
20 | | - <p class="govuk-body"> |
21 | | - <%= render("components/code_snippet", content: JSON.pretty_generate(response)) %> |
22 | | - </p> |
| 19 | + <% if topics.llm_responses.present? %> |
| 20 | + <%= render "govuk_publishing_components/components/details", { |
| 21 | + title: "LLM responses", |
| 22 | + } do %> |
| 23 | + <% topics.llm_responses.each do |namespace, response| %> |
| 24 | + <h3 class="govuk-heading-m"><%= namespace %></h3> |
| 25 | + <p class="govuk-body"> |
| 26 | + <%= render("components/code_snippet", content: JSON.pretty_generate(response)) %> |
| 27 | + </p> |
| 28 | + <% end %> |
23 | 29 | <% end %> |
24 | 30 | <% end %> |
25 | | -<% end %> |
26 | 31 |
|
27 | | -<% if topics.metrics.present? %> |
28 | | - <%= render "govuk_publishing_components/components/details", { |
29 | | - title: "Metrics", |
30 | | - } do %> |
31 | | - <%= render "govuk_publishing_components/components/summary_list", { |
32 | | - items: topics.metrics.map do |metric, value| |
33 | | - { |
34 | | - field: metric, |
35 | | - value: value, |
36 | | - } |
37 | | - end, |
38 | | - borderless: true, |
39 | | - } %> |
| 32 | + <% if topics.metrics.present? %> |
| 33 | + <%= render "govuk_publishing_components/components/details", { |
| 34 | + title: "Metrics", |
| 35 | + } do %> |
| 36 | + <%= render "govuk_publishing_components/components/summary_list", { |
| 37 | + items: topics.metrics.map do |metric, value| |
| 38 | + { |
| 39 | + field: metric, |
| 40 | + value: value, |
| 41 | + } |
| 42 | + end, |
| 43 | + borderless: true, |
| 44 | + } %> |
| 45 | + <% end %> |
40 | 46 | <% end %> |
41 | 47 | <% end %> |
| 48 | + |
| 49 | +<% if answer_relevancy_aggregate.present? %> |
| 50 | + <%= render "auto_evaluation_metric", aggregate: answer_relevancy_aggregate, title: "Answer relevancy" %> |
| 51 | +<% end %> |
0 commit comments