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

Commit 7919173

Browse files
committed
DEV: Use ChatSDK.create instead of service in specs
This patch will allow upcoming changes to services (discourse/discourse#29129) without breaking the `discourse-ai` specs.
1 parent 792703c commit 7919173

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spec/lib/modules/ai_bot/playground_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,12 @@
433433
DiscourseAi::Completions::Llm.with_prepared_responses(["World"]) do |_, _, _prompts|
434434
prompts = _prompts
435435

436-
::Chat::CreateMessage.call!(
437-
chat_channel_id: dm_channel.id,
438-
message: "Hello",
439-
guardian: guardian,
436+
ChatSDK::Message.create(
437+
raw: "Hello",
438+
channel_id: dm_channel.id,
440439
context_post_ids: [post.id],
441-
).message_instance
440+
guardian:,
441+
)
442442
end
443443

444444
expect(prompts[0].messages[1][:content]).to include("this is post content")

0 commit comments

Comments
 (0)