Skip to content

Commit

Permalink
create direct_use evaluators with default correct answers
Browse files Browse the repository at this point in the history
  • Loading branch information
aakrem committed May 19, 2024
1 parent f610819 commit 0aa62e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "Exact Match",
"key": "auto_exact_match",
"direct_use": False,
"direct_use": True,
"settings_template": {
"label": "Exact Match Settings",
"description": "Settings for the Exact Match evaluator",
Expand Down
8 changes: 7 additions & 1 deletion agenta-backend/agenta_backend/services/evaluator_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,20 @@ async def create_ready_to_use_evaluators(app: AppDB):
]

for evaluator in direct_use_evaluators:
settings_values = {}
settings_template = evaluator.get("settings_template", {})
if "correct_answer_keys" in settings_template:
settings_values["correct_answer_keys"] = settings_template[
"correct_answer_keys"
].get("default", [])
await db_manager.create_evaluator_config(
app=app,
organization=app.organization if isCloudEE() else None, # noqa,
workspace=app.workspace if isCloudEE() else None, # noqa,
user=app.user,
name=evaluator["name"],
evaluator_key=evaluator["key"],
settings_values={},
settings_values=settings_values,
)


Expand Down

0 comments on commit 0aa62e1

Please sign in to comment.