|
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_response.present? %> |
15 | | - <%= render "govuk_publishing_components/components/details", { |
16 | | - title: "LLM responses", |
17 | | - } do %> |
18 | | - <h3 class="govuk-heading-m">Topic tagger</h3> |
19 | | - <p class="govuk-body"> |
20 | | - <%= render("components/code_snippet", content: JSON.pretty_generate(topics.llm_response)) %> |
21 | | - </p> |
| 19 | + <% if topics.llm_response.present? %> |
| 20 | + <%= render "govuk_publishing_components/components/details", { |
| 21 | + title: "LLM responses", |
| 22 | + } do %> |
| 23 | + <h3 class="govuk-heading-m">Topic tagger</h3> |
| 24 | + <p class="govuk-body"> |
| 25 | + <%= render("components/code_snippet", content: JSON.pretty_generate(topics.llm_response)) %> |
| 26 | + </p> |
| 27 | + <% end %> |
22 | 28 | <% end %> |
23 | | -<% end %> |
24 | 29 |
|
25 | | -<% if topics.metrics.present? %> |
26 | | - <%= render "govuk_publishing_components/components/details", { |
27 | | - title: "Metrics", |
28 | | - } do %> |
29 | | - <%= render "govuk_publishing_components/components/summary_list", { |
30 | | - title: "Topic tagger", |
31 | | - items: topics.metrics.map do |metric, value| |
32 | | - { |
33 | | - field: metric, |
34 | | - value: value, |
35 | | - } |
36 | | - end, |
37 | | - borderless: true, |
38 | | - } %> |
| 30 | + <% if topics.metrics.present? %> |
| 31 | + <%= render "govuk_publishing_components/components/details", { |
| 32 | + title: "Metrics", |
| 33 | + } do %> |
| 34 | + <%= render "govuk_publishing_components/components/summary_list", { |
| 35 | + title: "Topic tagger", |
| 36 | + items: topics.metrics.map do |metric, value| |
| 37 | + { |
| 38 | + field: metric, |
| 39 | + value: value, |
| 40 | + } |
| 41 | + end, |
| 42 | + borderless: true, |
| 43 | + } %> |
| 44 | + <% end %> |
39 | 45 | <% end %> |
40 | 46 | <% end %> |
| 47 | + |
| 48 | +<% if answer_relevancy_aggregate.present? %> |
| 49 | + <%= render "metric", aggregate: answer_relevancy_aggregate, title: "Answer relevancy" %> |
| 50 | +<% end %> |
0 commit comments