DEV: Update rubocop-discourse to version 3.8.0 (#641)
This commit is contained in:
@@ -13,8 +13,8 @@ module DiscourseAi
|
||||
plugin.on(:chat_message_created) do |message, channel, user, extra|
|
||||
next unless SiteSetting.composer_ai_helper_enabled
|
||||
next unless SiteSetting.ai_helper_automatic_chat_thread_title
|
||||
next unless extra[:thread].present?
|
||||
next unless extra[:thread].title.blank?
|
||||
next if extra[:thread].blank?
|
||||
next if extra[:thread].title.present?
|
||||
|
||||
reply_count = extra[:thread].replies.count
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ module DiscourseAi
|
||||
SiteSetting.ai_embeddings_semantic_search_hyde_model,
|
||||
).generate(prompt, user: @guardian.user, feature_name: "semantic_search_hyde")
|
||||
|
||||
Nokogiri::HTML5.fragment(llm_response).at("ai")&.text&.presence || llm_response
|
||||
Nokogiri::HTML5.fragment(llm_response).at("ai")&.text.presence || llm_response
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -49,7 +49,7 @@ module DiscourseAi
|
||||
def topic_truncation(topic, tokenizer, max_length)
|
||||
text = +topic_information(topic)
|
||||
|
||||
if topic&.topic_embed&.embed_content_cache&.present?
|
||||
if topic&.topic_embed&.embed_content_cache.present?
|
||||
text << Nokogiri::HTML5.fragment(topic.topic_embed.embed_content_cache).text
|
||||
text << "\n\n"
|
||||
end
|
||||
@@ -66,7 +66,7 @@ module DiscourseAi
|
||||
def post_truncation(post, tokenizer, max_length)
|
||||
text = +topic_information(post.topic)
|
||||
|
||||
if post.is_first_post? && post.topic&.topic_embed&.embed_content_cache&.present?
|
||||
if post.is_first_post? && post.topic&.topic_embed&.embed_content_cache.present?
|
||||
text << Nokogiri::HTML5.fragment(post.topic.topic_embed.embed_content_cache).text
|
||||
else
|
||||
text << Nokogiri::HTML5.fragment(post.cooked).text
|
||||
|
||||
Reference in New Issue
Block a user