Skip to content

Commit

Permalink
Add Validation Options to allow user use their own options to validate
Browse files Browse the repository at this point in the history
  • Loading branch information
shincap8 committed Aug 9, 2024
1 parent 57b7f47 commit 32c6ead
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/app/domain/services/base/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def get_validate_configuration(self, task_id: int) -> dict:
context_info = {
"validation_user_input": config_yaml.get("validation_user_input"),
"validation_context": config_yaml.get("validation_context"),
"validation_options": config_yaml.get("validation_options"),
}
return context_info

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ const ValidateSamples: FC = () => {
)}
<RadioButton
instructions="Actions"
options={["πŸ‘ Correct", "πŸ‘Ž Incorrect", "🚩 Flag"]}
options={
validationConfigInfo.validation_options || [
"πŸ‘ Correct",
"πŸ‘Ž Incorrect",
"🚩 Flag",
]
}
field_name_for_the_model="label"
onInputChange={(input) => {
setLabel(input.label);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type ConfigurationTask = {
export type ValidationConfigurationTask = {
validation_user_input: object[];
validation_context: object[];
validation_options?: string[];
};

type ModelOutput = {
Expand Down

0 comments on commit 32c6ead

Please sign in to comment.