Skip to content

Commit

Permalink
adjust names
Browse files Browse the repository at this point in the history
  • Loading branch information
aakrem committed Dec 11, 2023
1 parent d50be89 commit 4e7145a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions agenta-backend/agenta_backend/models/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions agenta-backend/agenta_backend/services/evaluation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
BulkEvaluationDB,
EvaluationDB,
EvaluationScenarioDB,
SingleEvaluationScenarioDB,
EvaluationScenarioDBForBulkEvaluationDB,
UserDB,
AppDB,
EvaluationTypeSettings,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4e7145a

Please sign in to comment.