Interface IPromptExecutionObjectGraphPlaceholderReplacerBuilder


  • public interface IPromptExecutionObjectGraphPlaceholderReplacerBuilder
    Builder for a replacer that replaces placeholders in an object graph of a prompt model.
    Since:
    8.5.0
    • Method Detail

      • build

        IPromptExecutionObjectGraphPlaceholderReplacer build()
        Creates a new replacer instance for replacing placeholders in an object graph, using the current configuration. Subsequent modifications to this builder do not affect the created instance.
        Returns:
        The replacer instance.
      • replacePlaceholdersInTextParameters

        IPromptExecutionObjectGraphPlaceholderReplacerBuilder replacePlaceholdersInTextParameters​(boolean replacePlaceholdersInTextParameters)
        Sets whether to replace placeholders in text parameters. If true, placeholders in text parameters are replaced, using the configured replacer(IPromptExecutionReplacer). If false, they are not replaced. Defaults to false.
        Parameters:
        replacePlaceholdersInTextParameters - Whether to replace placeholders in text parameters.
        Returns:
        This builder for chaining method calls.
      • textParameterContextName

        IPromptExecutionObjectGraphPlaceholderReplacerBuilder textParameterContextName​(String textParameterContextName)
        Sets the context name for text parameters. Context placeholders are of the form [%<Context-Name>.<Content>%]. When the context name of the placeholder matches the configured name, the content of the context placeholder is interpreted as a JSON path into the provided text parameters.

        Defaults to "param".

        Parameters:
        textParameterContextName - The context name.
        Returns:
        This builder for chaining method calls.
      • textParameters

        IPromptExecutionObjectGraphPlaceholderReplacerBuilder textParameters​(Object textParameters)
        Sets the text parameters with the data for context placeholders whose context name matches the configured context name. Context placeholders are of the form [%<Context-Name>.<Content>%]. The content of the context placeholder is interpreted as a JSON path into the provided text parameters.

        Default to null.

        Parameters:
        textParameters - The text parameters object. Should be a JSON like object, i.e. null, Boolean, Number, String; or a List or Map thereof.
        Returns:
        This builder for chaining method calls.