requestModeration

open suspend fun requestModeration(moderatingModel: LLModel? = null): ModerationResult(source)

Sends a moderation request to the specified or default large language model (LLM) for content moderation.

This method validates the session state before processing the request. It prepares the prompt and uses the executor to perform the moderation check. A specific moderating model can be provided; if not, the default session model will be used.

Return

A ModerationResult instance containing the details of the moderation analysis, including content classification and flagged categories.

Parameters

moderatingModel

An optional LLModel instance representing the model to be used for moderation. If null, the default model configured for the session will be used.