Package de.espirit.firstspirit.ai.dto
Interface Request.Builder
- Enclosing interface:
- Request
public static interface Request.Builder
Builder for a
Request
instance.- Since:
- 5.2.240708
-
Method Summary
Modifier and TypeMethodDescription@NotNull Request.Builder
addMessage
(@NotNull Message message) Adds a new request message.@NotNull Request.Builder
attribute
(@NotNull String name, @Nullable Serializable value) Configures a generic attribute for the request.@NotNull Request
create()
Creates a new request instance based on the current configuration.@NotNull Request.Builder
variantCount
(int variantCount) Configures the number of variants to be requested,1
by default.
-
Method Details
-
addMessage
@Contract("_ -> this") @NotNull @NotNull Request.Builder addMessage(@NotNull @NotNull Message message) Adds a new request message.- Parameters:
message
- The message to be added.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
attribute
@Contract("_,_ -> this") @NotNull @NotNull Request.Builder attribute(@NotNull @NotNull String name, @Nullable @Nullable Serializable value) Configures a generic attribute for the request. The attributes available may depend on the configuredGenerativeAIConnectorPlugin
.- Parameters:
name
- The name of the attribute.value
- The attribute value.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
variantCount
Configures the number of variants to be requested,1
by default. Note that you will usually be charged based on the number of generated tokens across all generated variants.- Parameters:
variantCount
- The number of variants.- 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
-