DEV: Use `ChatSDK.create` instead of service in specs
This patch will allow upcoming changes to services (https://github.com/discourse/discourse/pull/29129) without breaking the `discourse-ai` specs.
This commit is contained in:
parent
792703c942
commit
7919173cba
|
@ -433,12 +433,12 @@ RSpec.describe DiscourseAi::AiBot::Playground do
|
||||||
DiscourseAi::Completions::Llm.with_prepared_responses(["World"]) do |_, _, _prompts|
|
DiscourseAi::Completions::Llm.with_prepared_responses(["World"]) do |_, _, _prompts|
|
||||||
prompts = _prompts
|
prompts = _prompts
|
||||||
|
|
||||||
::Chat::CreateMessage.call!(
|
ChatSDK::Message.create(
|
||||||
chat_channel_id: dm_channel.id,
|
raw: "Hello",
|
||||||
message: "Hello",
|
channel_id: dm_channel.id,
|
||||||
guardian: guardian,
|
|
||||||
context_post_ids: [post.id],
|
context_post_ids: [post.id],
|
||||||
).message_instance
|
guardian:,
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(prompts[0].messages[1][:content]).to include("this is post content")
|
expect(prompts[0].messages[1][:content]).to include("this is post content")
|
||||||
|
|
Loading…
Reference in New Issue