From 4e7145a82ce105b1a2a30433a8c005673dff29b4 Mon Sep 17 00:00:00 2001 From: Akrem Abayed Date: Mon, 11 Dec 2023 16:11:28 +0100 Subject: [PATCH] adjust names --- agenta-backend/agenta_backend/models/db_models.py | 10 ++++++---- .../agenta_backend/services/evaluation_service.py | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/agenta-backend/agenta_backend/models/db_models.py b/agenta-backend/agenta_backend/models/db_models.py index 0f145f651c..b7f6c4f253 100644 --- a/agenta-backend/agenta_backend/models/db_models.py +++ b/agenta-backend/agenta_backend/models/db_models.py @@ -212,7 +212,8 @@ class EvaluationScenarioOutput(EmbeddedModel): variant_id: str variant_output: str - +# TODO: This should be removed and replaced with EvaluationDB +# Keppeing it for now for backwards compatibility class BulkEvaluationDB(Model): app: AppDB = Reference(key_name="app") organization: OrganizationDB = Reference(key_name="organization") @@ -262,13 +263,14 @@ class EvaluationScenarioDB(Model): class Config: collection = "evaluation_scenarios" - -class SingleEvaluationScenarioDB(Model): +# TODO: This should be removed and replaced with EvaluationScenarioDB +# Keppeing it for now for backwards compatibility +class EvaluationScenarioDBForBulkEvaluationDB(Model): user: UserDB = Reference(key_name="user") organization: OrganizationDB = Reference(key_name="organization") evaluation: BulkEvaluationDB = Reference(key_name="bulk_evaluations") inputs: List[EvaluationScenarioInput] - output: EvaluationScenarioOutput + outputs: List[EvaluationScenarioOutput] vote: Optional[str] score: Optional[Union[str, int]] correct_answer: Optional[str] diff --git a/agenta-backend/agenta_backend/services/evaluation_service.py b/agenta-backend/agenta_backend/services/evaluation_service.py index 85ecb6de90..959d81a277 100644 --- a/agenta-backend/agenta_backend/services/evaluation_service.py +++ b/agenta-backend/agenta_backend/services/evaluation_service.py @@ -34,7 +34,7 @@ BulkEvaluationDB, EvaluationDB, EvaluationScenarioDB, - SingleEvaluationScenarioDB, + EvaluationScenarioDBForBulkEvaluationDB, UserDB, AppDB, EvaluationTypeSettings, @@ -337,7 +337,7 @@ async def create_single_evaluation_scenario( for input_item in payload.inputs ] - new_eval_scenario = SingleEvaluationScenarioDB( + new_eval_scenario = EvaluationScenarioDBForBulkEvaluationDB( user=evaluation.user, organization=evaluation.organization, evaluation=evaluation,