Class ModerationResponse
java.lang.Object
org.springframework.ai.moderation.ModerationResponse
- All Implemented Interfaces:
ModelResponse<Generation>
Represents a response from a moderation process, encapsulating the moderation metadata
and the generated content. This class provides access to both the single generation
result and a list containing that result, alongside the metadata associated with the
moderation response. Designed for flexibility, it allows retrieval of
moderation-specific metadata as well as the moderated content.
- Since:
- 1.0.0
- Author:
- Ahmed Yousri
-
Constructor Summary
ConstructorDescriptionModerationResponse
(Generation generations) ModerationResponse
(Generation generations, ModerationResponseMetadata moderationResponseMetadata) -
Method Summary
-
Constructor Details
-
ModerationResponse
-
ModerationResponse
public ModerationResponse(Generation generations, ModerationResponseMetadata moderationResponseMetadata)
-
-
Method Details
-
getResult
Description copied from interface:ModelResponse
Retrieves the result of the AI model.- Specified by:
getResult
in interfaceModelResponse<Generation>
- Returns:
- the result generated by the AI model
-
getResults
Description copied from interface:ModelResponse
Retrieves the list of generated outputs by the AI model.- Specified by:
getResults
in interfaceModelResponse<Generation>
- Returns:
- the list of generated outputs
-
getMetadata
Description copied from interface:ModelResponse
Retrieves the response metadata associated with the AI model's response.- Specified by:
getMetadata
in interfaceModelResponse<Generation>
- Returns:
- the response metadata
-
toString
-
equals
-
hashCode
public int hashCode()
-