|
2 | 2 | items: [ |
3 | 3 | { |
4 | 4 | field: "Primary topic", |
5 | | - value: analysis.primary_topic&.humanize, |
| 5 | + value: topics.primary_topic&.humanize, |
6 | 6 | }, |
7 | 7 | { |
8 | 8 | field: "Secondary topic", |
9 | | - value: analysis.secondary_topic&.humanize, |
| 9 | + value: topics.secondary_topic&.humanize, |
10 | 10 | }, |
11 | 11 | ], |
12 | 12 | } %> |
13 | 13 |
|
14 | | -<% if analysis.llm_responses.present? %> |
| 14 | +<% if topics.llm_response.present? %> |
15 | 15 | <%= render "govuk_publishing_components/components/details", { |
16 | 16 | title: "LLM responses", |
17 | 17 | } do %> |
18 | | - <% analysis.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> |
23 | | - <% end %> |
| 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> |
24 | 22 | <% end %> |
25 | 23 | <% end %> |
26 | 24 |
|
27 | | -<% if analysis.metrics.present? %> |
| 25 | +<% if topics.metrics.present? %> |
28 | 26 | <%= render "govuk_publishing_components/components/details", { |
29 | 27 | title: "Metrics", |
30 | 28 | } do %> |
31 | | - <% analysis.metrics.sort.each do |namespace, metrics| %> |
32 | | - <%= render "govuk_publishing_components/components/summary_list", { |
33 | | - title: namespace, |
34 | | - items: metrics.map do |metric, value| |
35 | | - { |
36 | | - field: metric, |
37 | | - value: value, |
38 | | - } |
39 | | - end, |
40 | | - borderless: true, |
41 | | - } %> |
42 | | - <% end %> |
| 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 | + } %> |
43 | 39 | <% end %> |
44 | 40 | <% end %> |
0 commit comments