Problem/Motivation

Moderation is used for content safety checks. Tests ensure the provider correctly handles moderation requests and properly interprets flagged/unflagged responses.

Proposed resolution

Create kernel tests that mock the MistralClient to test moderation functionality:
Test coverage:
- testGetConfiguredModelsModeration() - Verify mistral-moderation-latest model is returned
- testModerationSafeContent() - Moderation returns not flagged for safe content
- testModerationFlaggedContent() - Moderation returns flagged for harmful content
- testModerationWithDefaultModel() - Verify default model is used when none specified

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

petar_basic created an issue. See original summary.

petar_basic’s picture

Status: Active » Needs review

Added kernel tests for the Moderation operation:

- testGetConfiguredModelsModeration() - verifies mistral-moderation-latest model is available
- testModerationSafeContent() - verifies safe content returns unflagged
- testModerationFlaggedContent() - verifies harmful content returns flagged with category scores
- testModerationWithDefaultModel() - verifies default model is used when not specified

petar_basic’s picture

Assigned: petar_basic » Unassigned

fago made their first commit to this issue’s fork.

fago’s picture

Status: Needs review » Fixed

thx, straight forward and all good - merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.