Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 9822a33

Browse files
committed
DEV: Didn't actually need to create, .new sufficient
1 parent 8af2ccd commit 9822a33

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

evals/lib/eval.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,13 @@ def valid_javascript?(str)
317317

318318
def summarization(llm, input:)
319319
topic =
320-
Topic.create!(
320+
Topic.new(
321321
category: Category.last,
322322
title: "Eval topic for topic summarization",
323323
id: -99,
324324
user_id: Discourse.system_user.id,
325325
)
326-
post = Post.create!(topic: topic, id: -99, user_id: Discourse.system_user.id, raw: input)
326+
Post.new(topic: topic, id: -99, user_id: Discourse.system_user.id, raw: input)
327327

328328
strategy =
329329
DiscourseAi::Summarization::FoldContent.new(
@@ -332,11 +332,6 @@ def summarization(llm, input:)
332332
)
333333

334334
summary = DiscourseAi::TopicSummarization.new(strategy, Discourse.system_user).summarize
335-
summarized_text = summary.summarized_text
336-
337-
topic.destroy
338-
post.destroy
339-
340-
summarized_text
335+
summary.summarized_text
341336
end
342337
end

0 commit comments

Comments
 (0)