DEV: Don't use delays for streaming summaries. (#1244)

We started used a callback as a buffer in FoldContent, so the Fake endpoint is attempting
to emulate delays in the streaming. However, we don't care about that in these specs.
This commit is contained in:
Roman Rizzi 2025-04-02 13:38:15 -03:00 committed by GitHub
parent 0d60aca6ef
commit fccd072f44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,9 @@ RSpec.describe Jobs::SummariesBackfill do
let(:limit) { 24 } # guarantee two summaries per batch let(:limit) { 24 } # guarantee two summaries per batch
let(:intervals) { 12 } # budget is split into intervals. Job runs every five minutes. let(:intervals) { 12 } # budget is split into intervals. Job runs every five minutes.
before { DiscourseAi::Completions::Endpoints::Fake.delays = [] }
after { DiscourseAi::Completions::Endpoints::Fake.reset! }
before do before do
assign_fake_provider_to(:ai_summarization_model) assign_fake_provider_to(:ai_summarization_model)
SiteSetting.ai_summarization_enabled = true SiteSetting.ai_summarization_enabled = true

View File

@ -10,6 +10,9 @@ RSpec.describe DiscourseAi::Summarization::FoldContent do
before { SiteSetting.ai_summarization_enabled = true } before { SiteSetting.ai_summarization_enabled = true }
before { DiscourseAi::Completions::Endpoints::Fake.delays = [] }
after { DiscourseAi::Completions::Endpoints::Fake.reset! }
describe "#summarize" do describe "#summarize" do
before do before do
# Make sure each content fits in a single chunk. # Make sure each content fits in a single chunk.