DEV: Pass the user who requested the summary to the strategy. (#24489)

This change allows the `discourse-ai` plugin to log the user who requested the summary in the `AiApiAuditLog`.
This commit is contained in:
Roman Rizzi
2023-11-21 13:27:27 -03:00
committed by GitHub
parent 18cbb37e23
commit 75e2c6b506
4 changed files with 6 additions and 4 deletions
@@ -31,7 +31,7 @@ class Chat::Api::SummariesController < Chat::ApiController
if content[:contents].empty?
I18n.t("chat.summaries.no_targets")
else
strategy.summarize(content).dig(:summary)
strategy.summarize(content, current_user).dig(:summary)
end
render json: { summary: summarized_text }