Class AiToolKernelSettings

java.lang.Object
com.kingsrook.qqq.backend.core.actions.ai.AiToolKernelSettings
All Implemented Interfaces:
MetaDataProducerOutput, QMetaDataObject, QSupplementalInstanceMetaData, TopLevelMetaDataInterface, Serializable

public class AiToolKernelSettings extends Object implements QSupplementalInstanceMetaData
Settings for an AiToolKernel. maxRowsToModel - the most rows any tool sends to the model (a server cap - a larger requested limit is reduced to this). maxCellChars - longer string values are truncated (after redaction). defaultExposure - the exposure of tables and fields that have no explicit AiTableMetaData / AiFieldMetaData and no more restrictive default (e.g., METADATA_ONLY for a high-sensitivity deployment). customRedactionPatterns - additional patterns the redactor replaces with [REDACTED:custom], on top of its built-in secret and PII patterns. allowedWidgetNames - the widgets the assistant may render (render_widget) or mention (digests, search_help): widgets are default-DENY, because a widget renderer may read data without the user's table permissions (e.g., as a system user) - so only widgets an app developer has reviewed and listed here are used. (QQQ widget meta-data has no supplemental meta-data hook, so the opt-in lives in these settings.) hiddenWidgetNames - widgets never rendered, even if allowed (an override deny).
See Also:
  • Field Details

  • Constructor Details

    • AiToolKernelSettings

      public AiToolKernelSettings()
  • Method Details

    • of

      public static AiToolKernelSettings of(QInstance instance)
      Instance settings for assistant-channel requests outside a kernel call.
    • getName

      public String getName()
      Supplemental metadata name.
      Specified by:
      getName in interface TopLevelMetaDataInterface
    • withCustomRedactionPattern

      public AiToolKernelSettings withCustomRedactionPattern(Pattern pattern)
      Fluent method to add one custom redaction pattern.
    • withAllowedWidgetName

      public AiToolKernelSettings withAllowedWidgetName(String widgetName)
      Fluent method to allow one widget (opt it in to the assistant).
    • isWidgetAllowed

      public boolean isWidgetAllowed(String widgetName)
      Whether the assistant may use a widget: it is allowed, and not hidden.
    • withHiddenWidgetName

      public AiToolKernelSettings withHiddenWidgetName(String widgetName)
      Fluent method to add one hidden widget name.
    • getMaxRowsToModel

      public Integer getMaxRowsToModel()
      Getter for maxRowsToModel
    • setMaxRowsToModel

      public void setMaxRowsToModel(Integer maxRowsToModel)
      Setter for maxRowsToModel
    • withMaxRowsToModel

      public AiToolKernelSettings withMaxRowsToModel(Integer maxRowsToModel)
      Fluent setter for maxRowsToModel
    • getMaxCellChars

      public Integer getMaxCellChars()
      Getter for maxCellChars
    • setMaxCellChars

      public void setMaxCellChars(Integer maxCellChars)
      Setter for maxCellChars
    • withMaxCellChars

      public AiToolKernelSettings withMaxCellChars(Integer maxCellChars)
      Fluent setter for maxCellChars
    • getDefaultExposure

      public AiExposure getDefaultExposure()
      Getter for defaultExposure
    • setDefaultExposure

      public void setDefaultExposure(AiExposure defaultExposure)
      Setter for defaultExposure
    • withDefaultExposure

      public AiToolKernelSettings withDefaultExposure(AiExposure defaultExposure)
      Fluent setter for defaultExposure
    • getCustomRedactionPatterns

      public List<Pattern> getCustomRedactionPatterns()
      Getter for customRedactionPatterns
    • setCustomRedactionPatterns

      public void setCustomRedactionPatterns(List<Pattern> customRedactionPatterns)
      Setter for customRedactionPatterns
    • withCustomRedactionPatterns

      public AiToolKernelSettings withCustomRedactionPatterns(List<Pattern> customRedactionPatterns)
      Fluent setter for customRedactionPatterns
    • getHiddenWidgetNames

      public Set<String> getHiddenWidgetNames()
      Getter for hiddenWidgetNames
    • setHiddenWidgetNames

      public void setHiddenWidgetNames(Set<String> hiddenWidgetNames)
      Setter for hiddenWidgetNames
    • withHiddenWidgetNames

      public AiToolKernelSettings withHiddenWidgetNames(Set<String> hiddenWidgetNames)
      Fluent setter for hiddenWidgetNames
    • getAllowedWidgetNames

      public Set<String> getAllowedWidgetNames()
      Getter for allowedWidgetNames
    • setAllowedWidgetNames

      public void setAllowedWidgetNames(Set<String> allowedWidgetNames)
      Setter for allowedWidgetNames
    • withAllowedWidgetNames

      public AiToolKernelSettings withAllowedWidgetNames(Set<String> allowedWidgetNames)
      Fluent setter for allowedWidgetNames
    • getDataGateway

      public AiDataGateway getDataGateway()
      Getter for dataGateway (null means the core actions)
    • setDataGateway

      public void setDataGateway(AiDataGateway dataGateway)
      Setter for dataGateway
    • withDataGateway

      public AiToolKernelSettings withDataGateway(AiDataGateway dataGateway)
      Fluent setter for dataGateway: how the data tools read data (e.g. the UI API gateway, so every read is a /qqq/v1 operation as the user).