parent
057fbe1ce6
commit
a0542d1859
|
@ -0,0 +1 @@
|
||||||
|
3.1.0.beta3: 057fbe1ce6
|
|
@ -34,18 +34,17 @@ module DiscourseAi
|
||||||
end
|
end
|
||||||
|
|
||||||
%i[topic_view TopicViewPosts].each do |serializer|
|
%i[topic_view TopicViewPosts].each do |serializer|
|
||||||
plugin.add_to_serializer(serializer, :related_topics) do
|
plugin.add_to_serializer(
|
||||||
|
serializer,
|
||||||
|
:related_topics,
|
||||||
|
include_condition: -> { SiteSetting.ai_embeddings_semantic_related_topics_enabled },
|
||||||
|
) do
|
||||||
if object.next_page.nil? && !object.topic.private_message?
|
if object.next_page.nil? && !object.topic.private_message?
|
||||||
object.related_topics.map do |t|
|
object.related_topics.map do |t|
|
||||||
SuggestedTopicSerializer.new(t, scope: scope, root: false)
|
SuggestedTopicSerializer.new(t, scope: scope, root: false)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# custom include method so we also check on semantic search
|
|
||||||
plugin.add_to_serializer(serializer, :include_related_topics?) do
|
|
||||||
plugin.enabled? && SiteSetting.ai_embeddings_semantic_related_topics_enabled
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
callback =
|
callback =
|
||||||
|
|
Loading…
Reference in New Issue