Skip to content

Commit

Permalink
improved logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bekossy committed May 18, 2024
1 parent a74ce69 commit e055e4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
9 changes: 0 additions & 9 deletions agenta-backend/agenta_backend/services/evaluator_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ async def create_evaluator_config(
EvaluatorConfigDB: The newly created evaluator configuration object.
"""
app = await db_manager.fetch_app_by_id(app_id)
evaluator_config = evaluators.get_evaluator_by_key(evaluator_key)

if evaluator_config is not None:
if "correct_answer_keys" in evaluator_config.get("settings_template", {}):
if settings_values is None:
settings_values = {}
settings_values["correct_answer_keys"] = evaluator_config[
"settings_template"
]["correct_answer_keys"]["default"]

evaluator_config = await db_manager.create_evaluator_config(
app=app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ const DynamicFormField: React.FC<DynamicFormFieldProps> = ({
expandIcon={({isActive}) => (
<CaretRightOutlined rotate={isActive ? 90 : 0} />
)}
defaultActiveKey={["1"]}
className={"my-[10px]"}
items={[
{
Expand Down Expand Up @@ -321,6 +320,13 @@ const NewEvaluatorModal: React.FC<Props> = ({
: [settingsValues.correct_answer_keys]
}

if (
!settingsValues.correct_answer_keys &&
selectedEval.settings_template.correct_answer_keys
) {
settingsValues["correct_answer_keys"] = ["correct_answer"]
}

const data = {
...values,
evaluator_key: selectedEval.key,
Expand Down

0 comments on commit e055e4f

Please sign in to comment.