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 SummaryConstructorsConstructorDescriptionModerationResponse(Generation generations) ModerationResponse(Generation generations, ModerationResponseMetadata moderationResponseMetadata) 
- 
Method Summary
- 
Constructor Details- 
ModerationResponse
- 
ModerationResponsepublic ModerationResponse(Generation generations, ModerationResponseMetadata moderationResponseMetadata) 
 
- 
- 
Method Details- 
getResultDescription copied from interface:ModelResponseRetrieves the result of the AI model.- Specified by:
- getResultin interface- ModelResponse<Generation>
- Returns:
- the result generated by the AI model
 
- 
getResultsDescription copied from interface:ModelResponseRetrieves the list of generated outputs by the AI model.- Specified by:
- getResultsin interface- ModelResponse<Generation>
- Returns:
- the list of generated outputs
 
- 
getMetadataDescription copied from interface:ModelResponseRetrieves the response metadata associated with the AI model's response.- Specified by:
- getMetadatain interface- ModelResponse<Generation>
- Returns:
- the response metadata
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
 
-