Class Generation
java.lang.Object
org.springframework.ai.moderation.Generation
- All Implemented Interfaces:
ModelResult<Moderation>
The Generation class represents a response from a moderation process. It encapsulates
the moderation generation metadata and the moderation object.
- Since:
- 1.0.0
- Author:
- Ahmed Yousri
-
Constructor Summary
ConstructorDescriptionGeneration
(Moderation moderation) Generation
(Moderation moderation, ModerationGenerationMetadata moderationGenerationMetadata) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the metadata associated with the result of an AI model.Retrieves the output generated by the AI model.toString()
withGenerationMetadata
(ModerationGenerationMetadata moderationGenerationMetadata)
-
Constructor Details
-
Generation
public Generation() -
Generation
-
Generation
-
-
Method Details
-
withGenerationMetadata
public Generation withGenerationMetadata(@Nullable ModerationGenerationMetadata moderationGenerationMetadata) -
getOutput
Description copied from interface:ModelResult
Retrieves the output generated by the AI model.- Specified by:
getOutput
in interfaceModelResult<Moderation>
- Returns:
- the output generated by the AI model
-
getMetadata
Description copied from interface:ModelResult
Retrieves the metadata associated with the result of an AI model.- Specified by:
getMetadata
in interfaceModelResult<Moderation>
- Returns:
- the metadata associated with the result
-
toString
-