Interface IPromptExecutionResolveTextParametersBuilder
public interface IPromptExecutionResolveTextParametersBuilder
Builder for resolving text parameters.
Given a list of prompt text parameter descriptors for a set of text parameters, reads
those parameters from the given request object, and returns a map with the parameter name as the key, and the
parameter value as the value. Optionally also replaces placeholders in the parameter values when a replacer is
configured.
- Since:
- 8.5.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Reads theprompt text parametersfrom the configured request object, and returns a map with the parameter name as the key, and the parameter value as the value.replacer(IPromptExecutionReplacerBound replacer) Sets the optional replacer to use for processing the resolved text parameter values.requestObject(IPromptQueryRequestObject requestObject) Sets the request object from which to text parameter values.textParameters(IPromptQueryConfig_TextParameters textParameters) Sets the text parameters to resolve.textParameters(List<PromptTextParameter> textParameters) Sets the text parameters to resolve.
-
Method Details
-
build
Reads theprompt text parametersfrom the configured request object, and returns a map with the parameter name as the key, and the parameter value as the value. Also replaces placeholders in the parameter values, if a replacer was configured.- Returns:
- A map with the parameter name as the key, and the parameter value as the value.
- Throws:
PromptExecutionException- When the parameters could not be read, e.g. when a required parameter is missing.
-
replacer
@CanIgnoreReturnValue IPromptExecutionResolveTextParametersBuilder replacer(IPromptExecutionReplacerBound replacer) Sets the optional replacer to use for processing the resolved text parameter values. When set, the replacer is applied to each resolved text parameter value, replacing any placeholders found in the value.- Parameters:
replacer- The replacer to use for replacing placeholders in the parameter values. If null, no replacement is performed.- Returns:
- The builder instance for method chaining.
-
requestObject
@CanIgnoreReturnValue IPromptExecutionResolveTextParametersBuilder requestObject(IPromptQueryRequestObject requestObject) Sets the request object from which to text parameter values.- Parameters:
requestObject- The request object to read the value from.- Returns:
- This builder for chaining method calls.
-
textParameters
@CanIgnoreReturnValue IPromptExecutionResolveTextParametersBuilder textParameters(List<PromptTextParameter> textParameters) Sets the text parameters to resolve.- Parameters:
textParameters- The text parameters descriptor.- Returns:
- The builder instance for method chaining.
-
textParameters
@CanIgnoreReturnValue IPromptExecutionResolveTextParametersBuilder textParameters(IPromptQueryConfig_TextParameters textParameters) Sets the text parameters to resolve.- Parameters:
textParameters- The text parameters descriptor.- Returns:
- The builder instance for method chaining.
-