Class Generation
java.lang.Object
org.springframework.ai.chat.model.Generation
- All Implemented Interfaces:
ModelResult<AssistantMessage>
Represents a response returned by the AI.
-
Constructor Summary
ConstructorDescriptionGeneration
(String text) Deprecated.Generation
(String text, Map<String, Object> properties) Deprecated.UseGeneration(AssitantMessage)
constructor instead.Generation
(AssistantMessage assistantMessage) Generation
(AssistantMessage assistantMessage, ChatGenerationMetadata chatGenerationMetadata) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Retrieves the metadata associated with the result of an AI model.Retrieves the output generated by the AI model.int
hashCode()
toString()
withGenerationMetadata
(ChatGenerationMetadata chatGenerationMetadata) Deprecated.UseGeneration(AssitantMessage, ChatGenerationMetadata)
constructor instead.
-
Constructor Details
-
Generation
Deprecated.UseGeneration(AssitantMessage)
constructor instead. -
Generation
Deprecated.UseGeneration(AssitantMessage)
constructor instead. -
Generation
-
Generation
-
-
Method Details
-
getOutput
Description copied from interface:ModelResult
Retrieves the output generated by the AI model.- Specified by:
getOutput
in interfaceModelResult<AssistantMessage>
- 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<AssistantMessage>
- Returns:
- the metadata associated with the result
-
withGenerationMetadata
@Deprecated public Generation withGenerationMetadata(@Nullable ChatGenerationMetadata chatGenerationMetadata) Deprecated.UseGeneration(AssitantMessage, ChatGenerationMetadata)
constructor instead.- Parameters:
chatGenerationMetadata
-- Returns:
-
equals
-
hashCode
public int hashCode() -
toString
-
Generation(AssitantMessage)
constructor instead.