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.BuilderaddVariant(@NotNull Message variant) Adds a new variant as message.default @NotNull Response.BuilderaddVariants(@NotNull List<Message> variants) Adds variants to the response.@NotNull Response.Builderattribute(@NotNull String name, @Nullable Serializable value) Configures a generic attribute for this response object.@NotNull Responsecreate()Creates a new request instance based on the current configuration.default @NotNull Response.BuilderConfigures the response using the specified other response.@NotNull Response.BuildertokenUsage(@Nullable TokenUsage tokenUsage) Configures the token usage associated with the request.
-
Method Details
-
from
@Contract("_ -> this") @NotNull default @NotNull Response.Builder from(@NotNull @NotNull Response response) Configures the response using the specified other response.- Parameters:
response- The response to copy the settings from.- Returns:
- This builder instance.
- Since:
- 5.2.251104
-
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
-