Class Feedback.Builder
java.lang.Object
com.oracle.database.selectai.model.Feedback.Builder
- Enclosing class:
Feedback
Builder for
Feedback request payloads.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and validates the feedback request.feedbackContent(String feedbackContent) Sets the natural-language explanation for the feedback.feedbackType(Feedback.FeedbackType feedbackType) Sets whether the generated SQL was useful or needs correction.feedbackType(String feedbackType) Sets whether the generated SQL was useful or needs correction.operation(Feedback.Operation operation) Sets the action to perform on the feedback store.Sets the action to perform on the feedback store.Sets the expected or corrected response for the reviewed SQL.Identifies the reviewed SQL by its database SQL identifier.Identifies the reviewed SQL by its full statement text.
-
Method Details
-
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
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
Sets whether the generated SQL was useful or needs correction.- Parameters:
feedbackType- feedback type, typicallypositiveornegative- 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
Sets the expected or corrected response for the reviewed SQL.- Parameters:
response- expected SQL result or corrected SQL response- Returns:
- this builder instance
-
feedbackContent
Sets the natural-language explanation for the feedback.- Parameters:
feedbackContent- natural-language feedback notes or revised SQL guidance- Returns:
- this builder instance
-
operation
Sets the action to perform on the feedback store.Null or blank input is preserved so
DBMS_CLOUD_AI.FEEDBACKcan apply its database default. Non-blank values are parsed intoFeedback.Operation.ADDorFeedback.Operation.DELETE.- Parameters:
operation- operation text, for exampleaddordelete- Returns:
- this builder instance
-
operation
Sets the action to perform on the feedback store.- Parameters:
operation- operation enum, ornullto letDBMS_CLOUD_AI.FEEDBACKapply its database default- Returns:
- this builder instance
-
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
-