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 TypeMethodDescriptiongenerationMetadata
(ModerationGenerationMetadata moderationGenerationMetadata) Retrieves the metadata associated with the result of an AI model.Retrieves the output generated by the AI model.toString()
withGenerationMetadata
(ModerationGenerationMetadata moderationGenerationMetadata) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
Generation
public Generation() -
Generation
-
Generation
-
-
Method Details
-
generationMetadata
public Generation generationMetadata(@Nullable ModerationGenerationMetadata moderationGenerationMetadata) -
withGenerationMetadata
@Deprecated(forRemoval=true, since="1.0.0-M5") public Generation withGenerationMetadata(@Nullable ModerationGenerationMetadata moderationGenerationMetadata) Deprecated, for removal: This API element is subject to removal in a future version.usegenerationMetadata(ModerationGenerationMetadata)
instead. -
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
-
generationMetadata(ModerationGenerationMetadata)
instead.