Package de.espirit.firstspirit.ai.dto
Interface Response.Builder
- Enclosing interface:
- Response
public static interface Response.Builder
Builder for a
Response
instance.- Since:
- 5.2.240708
-
Method Summary
Modifier and TypeMethodDescription@NotNull Response.Builder
addVariant
(@NotNull Message variant) Adds a new variant as message.default @NotNull Response.Builder
addVariants
(@NotNull List<Message> variants) Adds variants to the response.@NotNull Response.Builder
attribute
(@NotNull String name, @Nullable Serializable value) Configures a generic attribute for this response object.@NotNull Response
create()
Creates a new request instance based on the current configuration.@NotNull Response.Builder
tokenUsage
(@Nullable TokenUsage tokenUsage) Configures the token usage associated with the request.
-
Method Details
-
addVariant
@Contract("_ -> this") @NotNull @NotNull Response.Builder addVariant(@NotNull @NotNull Message variant) Adds a new variant as message.- Parameters:
variant
- The variant to be added.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
addVariants
@Contract("_ -> this") @NotNull default @NotNull Response.Builder addVariants(@NotNull @NotNull List<Message> variants) Adds variants to the response.- Parameters:
variants
- The variants to be added.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
attribute
@Contract("_,_ -> this") @NotNull @NotNull Response.Builder attribute(@NotNull @NotNull String name, @Nullable @Nullable Serializable value) Configures a generic attribute for this response object.- Parameters:
name
- The name of the attribute.value
- The attribute value.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
tokenUsage
@Contract("_ -> this") @NotNull @NotNull Response.Builder tokenUsage(@Nullable @Nullable TokenUsage tokenUsage) Configures the token usage associated with the request.- Parameters:
tokenUsage
- The token usages.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
create
Creates a new request instance based on the current configuration.- Returns:
- The new request instance.
- Since:
- 5.2.240708
-