feat: make AI Moderation provider-agnostic - #64
Merged
Merged
Conversation
Alam-2U
marked this pull request as ready for review
August 25, 2026 07:45
| what comes back spam, and soft deletes it when auto-delete is enabled. Both | ||
| steps are gated on course waffle flags, and every spam verdict is recorded on a | ||
| moderation audit log. | ||
| """ |
There was a problem hiding this comment.
One small thing to confirm: since forum.ai_moderation is being moved from a single module to a package structure, please make sure there are no remaining imports using the old path in any other repo or downstream branch.
Author
There was a problem hiding this comment.
@santhosh-apphelix-2u I have confirmed there is no remaining imports using the old path in any other repo or downstream branch
santhosh-apphelix-2u
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
AI moderation was hard-wired to XPert. The service built the XPert request and parsed the XPert response itself, so the provider and the moderation workflow were one piece of code — there was no way to run this against anything else.
This separates them. Forum now defines a moderation interface and ships no provider of its own.
AIModerationServiceorchestrates only — deduplication, caching, spam flagging, soft deletion, audit logging — and delegates classification to whichever backendAI_MODERATION_BACKENDnames. XPert becomes one implementation of that interface, chosen by configuration rather than by being the only option.No behaviour change for edX: XPert is selected in edx-internal and sends exactly the requests it sent before.
Changes
AI_MODERATION_BACKENDand loaded by dotted path.Ticket ref
LP-1032
Related PR