From 4368ef29d8b1ab05a0022456d4100a959f9a1b03 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Mon, 10 Apr 2023 16:02:44 -0300 Subject: [PATCH] FIX: Sometimes Claude sends all titles suggestions in a single ai tag (#40) --- lib/modules/ai_helper/llm_prompt.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/ai_helper/llm_prompt.rb b/lib/modules/ai_helper/llm_prompt.rb index b6149682..76ccbdab 100644 --- a/lib/modules/ai_helper/llm_prompt.rb +++ b/lib/modules/ai_helper/llm_prompt.rb @@ -100,7 +100,7 @@ module DiscourseAi if suggestions.length > 1 suggestions else - suggestions.split("\n").map(&:strip) + suggestions.first.split("\n").map(&:strip) end else [Nokogiri::HTML5.fragment(content).at("ai").text]