Skip to content

Conversation

Ololoshechkin
Copy link
Collaborator

@Ololoshechkin Ololoshechkin commented Jul 4, 2025

Fixes: #396


Type of the change

  • New feature
  • Bug fix
  • Documentation fix

Checklist for all pull requests

  • The pull request has a description of the proposed change
  • I read the Contributing Guidelines before opening the pull request
  • The pull request uses develop as the base branch
  • Tests for the changes have been added
  • All new and existing tests passed
Additional steps for pull requests adding a new feature
  • An issue describing the proposed change exists
  • The pull request includes a link to the issue
  • The change was discussed and approved in the issue
  • Docs have been added / updated

@Ololoshechkin Ololoshechkin force-pushed the vbr/moderating-models branch from 719eb00 to 954588e Compare July 5, 2025 00:13
@Ololoshechkin Ololoshechkin requested a review from sdubov July 5, 2025 00:13
@Ololoshechkin Ololoshechkin changed the title Support content moderation requests and moderating models (for Ollama and OpenAI) #396: Support content moderation requests and moderating models (for Ollama and OpenAI) Jul 5, 2025
@Ololoshechkin Ololoshechkin changed the title #396: Support content moderation requests and moderating models (for Ollama and OpenAI) Support content moderation requests and moderating models (for Ollama and OpenAI) Jul 5, 2025
@Ololoshechkin Ololoshechkin requested a review from ptitjes July 5, 2025 18:54
@tiginamaria tiginamaria requested review from tiginamaria and removed request for ptitjes July 8, 2025 13:19
Copy link
Contributor

@sdubov sdubov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, look good for me. I would update test data and rebased onto a new develop branch to fix compilation.

logger.debug { "Moderating multi-modal content with model: ${model.id}" }

val provider = model.provider
val client = llmClients[provider] ?: throw IllegalArgumentException("No client found for provider: $provider")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about extracting this check into a separate function and generalize the error? Similar code is used in other methods above.

@sdubov
Copy link
Contributor

sdubov commented Jul 10, 2025

@Ololoshechkin , btw, it looks like Mistral has Moderation API already as well - https://docs.mistral.ai/capabilities/guardrailing/

Copy link
Contributor

@EugeneTheDev EugeneTheDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a few mosly style related comments

@Ololoshechkin
Copy link
Collaborator Author

@sdubov thanks, will apply your suggestions.
As for the Mistral -- we don't support Mistral yet :) So adding Mistral will be a separate task anyway (and we have it in the roadmap)

@Ololoshechkin Ololoshechkin force-pushed the vbr/moderating-models branch from 9e7bdb5 to fce56cd Compare July 12, 2025 14:36
@Ololoshechkin Ololoshechkin force-pushed the vbr/moderating-models branch from fce56cd to 4f249e1 Compare July 12, 2025 14:41
@Ololoshechkin Ololoshechkin requested a review from sdubov July 12, 2025 14:41
@Ololoshechkin Ololoshechkin changed the title Support content moderation requests and moderating models (for Ollama and OpenAI) Support content moderation requests and moderating models (for Ollama, OpenAI, and Bedrock) Jul 12, 2025
@Ololoshechkin Ololoshechkin merged commit f1c1e32 into develop Jul 12, 2025
4 checks passed
@Ololoshechkin Ololoshechkin deleted the vbr/moderating-models branch July 12, 2025 22:17
Copy link

Qodana for JVM

446 new problems were found

Inspection name Severity Problems
Check Kotlin and Java source code coverage 🔶 Warning 379
Missing KDoc for public API declaration 🔶 Warning 47
Unused import directive 🔶 Warning 16
Vulnerable imported dependency 🔶 Warning 4
@@ Code coverage @@
+ 63% total lines covered
7835 lines analyzed, 5003 lines covered
# Calculated according to the filters of your coverage tool

☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Moderating models and content moderation requests
5 participants