DEV: Allow `ChatSDK.create` to take extra parameters

Currently, `ChatSDK.create` restricts what parameters can be provided to
the underlying service. This prevents the `discourse-ai` plugin from
using it in one of its specs.

This patch allows extra parameters to be provided.
This commit is contained in:
Loïc Guitaut 2024-10-16 12:22:55 +02:00 committed by Loïc Guitaut
parent 789aa2d9de
commit 76aa9b66d0
1 changed files with 2 additions and 0 deletions

View File

@ -116,6 +116,7 @@ module ChatSDK
enforce_membership: false,
force_thread: false,
strip_whitespaces: true,
**params,
&block
)
message =
@ -131,6 +132,7 @@ module ChatSDK
force_thread: force_thread,
strip_whitespaces: strip_whitespaces,
created_by_sdk: true,
**params,
) do
on_model_not_found(:channel) { raise "Couldn't find channel with id: `#{channel_id}`" }
on_model_not_found(:membership) do