Class Feedback.Builder

java.lang.Object
com.oracle.database.selectai.model.Feedback.Builder
Enclosing class:
Feedback

public static final class Feedback.Builder extends Object
Builder for Feedback request payloads.
  • Method Details

    • sqlId

      public Feedback.Builder sqlId(String sqlId)
      Identifies the reviewed SQL by its database SQL identifier.

      Use this when the generated SQL can be identified by SQL ID. Do not also set sqlText(String).

      Parameters:
      sqlId - SQL_ID value
      Returns:
      this builder instance
    • sqlText

      public Feedback.Builder sqlText(String sqlText)
      Identifies the reviewed SQL by its full statement text.

      Use this when the generated SQL should be identified by its full SQL text. Do not also set sqlId(String).

      Parameters:
      sqlText - generated SQL text
      Returns:
      this builder instance
    • feedbackType

      public Feedback.Builder feedbackType(String feedbackType)
      Sets whether the generated SQL was useful or needs correction.
      Parameters:
      feedbackType - feedback type, typically positive or negative
      Returns:
      this builder instance
    • feedbackType

      Sets whether the generated SQL was useful or needs correction.
      Parameters:
      feedbackType - feedback type enum
      Returns:
      this builder instance
    • response

      public Feedback.Builder response(String response)
      Sets the expected or corrected response for the reviewed SQL.
      Parameters:
      response - expected SQL result or corrected SQL response
      Returns:
      this builder instance
    • feedbackContent

      public Feedback.Builder feedbackContent(String feedbackContent)
      Sets the natural-language explanation for the feedback.
      Parameters:
      feedbackContent - natural-language feedback notes or revised SQL guidance
      Returns:
      this builder instance
    • operation

      public Feedback.Builder operation(String operation)
      Sets the action to perform on the feedback store.

      Null or blank input is preserved so DBMS_CLOUD_AI.FEEDBACK can apply its database default. Non-blank values are parsed into Feedback.Operation.ADD or Feedback.Operation.DELETE.

      Parameters:
      operation - operation text, for example add or delete
      Returns:
      this builder instance
    • operation

      Sets the action to perform on the feedback store.
      Parameters:
      operation - operation enum, or null to let DBMS_CLOUD_AI.FEEDBACK apply its database default
      Returns:
      this builder instance
    • build

      public Feedback build()
      Builds and validates the feedback request.

      A valid request must identify the generated SQL exactly one way, must include an assessment when storing feedback, must include an expected/corrected response when storing negative feedback, and must not include add-only fields when deleting feedback.

      Returns:
      validated immutable Feedback request
      Throws:
      IllegalArgumentException - when the request is invalid