Interface IPromptExecutionCommonsService


public interface IPromptExecutionCommonsService
Service that provides common logic needed when executing prompt queries. Usage of this service is optional, but may simplify implementation of prompt service handlers. Obtain instances via CDI.
Since:
8.5.0
  • Method Details

    • objectGraphPlaceholderReplacer

      Gets a builder for a replacer that replaces placeholders in the object graph of a deserialized prompt connection or query configuration. Useful for replacing placeholders in your model classes, before accessing their data. Uses the configured replacer to perform the replacements. The replacer will process fields annotated with the following annotations: For @Placeholder, replaces placeholders according to the settings of that annotation.

      For @PromptTextParams, replaces all context placeholders (i.e. of the form [%<Context-Name>.<Content>%]) that match the configured context name. The content of the context placeholder is interpreted as a JSON path into the provided text parameters.

      Returns:
      A builder for an object graph placeholder replacer.
    • resolveFiles

      Given a list of file set parameters and/or a list of configured static files, resolves those files into the actual binary data. For dynamic files (file set parameters), this method reads the files from the provided request object.
      Returns:
      A new builder for resolving files.
    • resolveTextParameters

      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.
      Returns:
      A new builder for resolving text parameters.