Interface ConfigurablePromptOperation

All Superinterfaces:
InheritablePrompt, PresettablePrompt<PromptOperation>, PromptOperation

@Experimental public interface ConfigurablePromptOperation extends PresettablePrompt<PromptOperation>, InheritablePrompt, PromptOperation
Object for configuring a specific PromptOperation.

Please note that currently you can not overwrite the definition of inherited operations, use InheritablePrompt.isInherited() and InheritablePrompt.getSourceType() to check for the source of this operation. However, tags can be modified in each PromptConfiguration individually, even for inherited operations.

Since:
5.2.241209
  • Method Details

    • setTags

      void setTags(@NotNull @NotNull Set<String> tags)
      Configures the active tags associated with this operation. Any other inherited but inactive tag will be explicitly disabled for this operation using this method.
      Parameters:
      tags - The operation tags to be used.
      Since:
      5.2.241209
    • setTags

      void setTags(@NotNull @NotNull Map<String,Boolean> tags)
      Configures the tags explicitly for this operation. Any tag not specified in the given map will be inherited automatically.
      Parameters:
      tags - The tags to configure, with true as active and false as inactive.
      Since:
      5.2.241209
    • setTag

      void setTag(@NotNull @NotNull String tag, @Nullable @Nullable Boolean active)
      Configures the active state of the specified tag.
      Parameters:
      tag - The tag to configure.
      active - true if active, false if inactive, null for default state (or inherited one)
      Since:
      5.2.241209
    • getTagStates

      @NotNull @Unmodifiable @NotNull Set<PromptOperationTagState> getTagStates()
      Returns the configuration details for the tags specified locally as well as the inherited values.
      Returns:
      The tags for this operation as detailed state objects.
      Since:
      5.2.241209
    • setName

      void setName(@NotNull @NotNull String name)
      Configures the name to visualize the operation with.

      Please note that currently you can not overwrite the definition of inherited operations, use InheritablePrompt.isInherited() and InheritablePrompt.getSourceType() to check for the source of this operation.

      Parameters:
      name - The operation name.
      Throws:
      UnsupportedOperationException - if the operation is inherited.
      Since:
      5.2.241209
    • setPrompt

      void setPrompt(@NotNull @NotNull String prompt)
      Configures the prompt to build the generative AI request with.

      Please note that currently you can not overwrite the definition of inherited operations, use InheritablePrompt.isInherited() and InheritablePrompt.getSourceType() to check for the source of this operation.

      Parameters:
      prompt - The operation prompt.
      Throws:
      UnsupportedOperationException - if the operation is inherited.
      Since:
      5.2.241209
    • setTextRequired

      void setTextRequired(boolean textRequired)
      Configures whether the operation requires input text.

      Please note that currently you can not overwrite the definition of inherited operations, use InheritablePrompt.isInherited() and InheritablePrompt.getSourceType() to check for the source of this operation.

      Parameters:
      textRequired - true if the operation requires input text, false otherwise.
      Throws:
      UnsupportedOperationException - if the operation is inherited.
      Since:
      5.2.241209
    • setOptions

      void setOptions(@NotNull @NotNull List<UUID> options)
      Configures a list of option identifiers the operation is configurable with.

      Please note that currently you can not overwrite the definition of inherited operations, use InheritablePrompt.isInherited() and InheritablePrompt.getSourceType() to check for the source of this operation.

      Parameters:
      options - The option identifiers of this operation.
      Throws:
      UnsupportedOperationException - if the operation is inherited.
      Since:
      5.2.241209
    • apply

      @Contract("_ -> this") @NotNull default @NotNull ConfigurablePromptOperation apply(@NotNull @NotNull PromptOperation definition)
      Applies the definition of the given prompt operation, which is the same as calling each setter individually.

      Please note that currently you can not overwrite the definition of inherited operations, use InheritablePrompt.isInherited() and InheritablePrompt.getSourceType() to check for the source of this operation.

      Parameters:
      definition - The definition to apply the settings from.
      Returns:
      This instance.
      Throws:
      UnsupportedOperationException - if the operation is inherited.
      Since:
      5.2.241209