FIX: Sometimes Claude sends all titles suggestions in a single ai tag (#40)

This commit is contained in:
Rafael dos Santos Silva 2023-04-10 16:02:44 -03:00 committed by GitHub
parent bb0b829634
commit 4368ef29d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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]