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
Adds a new tool definition to the request.@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.default @NotNull Request.Builder
Configures the request using the specified other request.@NotNull Request.Builder
variantCount
(int variantCount) Configures the number of variants to be requested,1
by default.
-
Method Details
-
from
@Contract("_ -> this") @NotNull default @NotNull Request.Builder from(@NotNull @NotNull Request request) Configures the request using the specified other request.- Parameters:
request
- The request to copy the settings from.- Returns:
- This builder instance.
- Since:
- 5.2.250908
-
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. Keep also in mind that generating multiple variants may not be supported for the configured AI service.- Parameters:
variantCount
- The number of variants.- Returns:
- This builder instance.
- Since:
- 5.2.240708
-
addTool
Adds a new tool definition to the request.- Parameters:
tool
- The tool definition.- Returns:
- This builder instance.
- Since:
- 5.2.250908
- See Also:
-
create
Creates a new request instance based on the current configuration.- Returns:
- The new request instance.
- Since:
- 5.2.240708
-