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 Detail

      • build

        Map<String,​String> build()
                                throws PromptExecutionException
        Reads the prompt text parameters from 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.