Package de.espirit.firstspirit.ai.dto
Interface Response
- All Superinterfaces:
AttributeProvider
Response descriptor of a generative AI request.
- Since:
- 5.2.240708
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Response.Builder
builder()
Creates a new builder to create a request instance with.getText()
Convenience method for retrieving the response text of the first variant.@NotNull Optional<TokenUsage>
Returns information about the token usage associated with the operation.Returns the list of variants returned by the generative AI.Methods inherited from interface de.espirit.firstspirit.ai.dto.AttributeProvider
getAttribute, getAttribute, getAttributeBoolean, getAttributeDouble, getAttributeFloat, getAttributeInteger, getAttributeLong, getAttributeString
-
Method Details
-
builder
Creates a new builder to create a request instance with.- Returns:
- The builder instance.
- Since:
- 5.2.240708
-
getVariants
Returns the list of variants returned by the generative AI. Keep in mind, that the response text may only be a fragment, if the response is part of aResponseStream
.- Returns:
- The list of response texts.
- Since:
- 5.2.240708
-
getText
Convenience method for retrieving the response text of the first variant. Any additional variant (as requested usingRequest.getVariantCount()
) will be ignored.- Returns:
- The response text of the first variant, or empty.
- Since:
- 5.2.240708
- See Also:
-
getTokenUsage
Returns information about the token usage associated with the operation.- Returns:
- The token usage information.
- Since:
- 5.2.240708
-