Spaces:
Sleeping
Sleeping
Update env.py
Browse files
env.py
CHANGED
|
@@ -8,6 +8,7 @@ from typing import Any, Dict, List, Optional
|
|
| 8 |
from uuid import uuid4
|
| 9 |
|
| 10 |
from openenv.core.env_server.interfaces import Environment
|
|
|
|
| 11 |
from pydantic import BaseModel, Field
|
| 12 |
|
| 13 |
try:
|
|
@@ -174,6 +175,17 @@ class ClinicalTrialEnvironment(
|
|
| 174 |
def state(self) -> ClinicalTrialState:
|
| 175 |
return self._state
|
| 176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
def grader(self) -> float:
|
| 178 |
"""Deterministically compare agent outputs against the current scenario ground truth."""
|
| 179 |
if self._current_scenario is None:
|
|
@@ -418,3 +430,18 @@ class ClinicalTrialEnv(ClinicalTrialEnvironment):
|
|
| 418 |
"""Compatibility alias for manifest entry points expecting env:ClinicalTrialEnv."""
|
| 419 |
|
| 420 |
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
from uuid import uuid4
|
| 9 |
|
| 10 |
from openenv.core.env_server.interfaces import Environment
|
| 11 |
+
from openenv.core.env_server.types import EnvironmentMetadata
|
| 12 |
from pydantic import BaseModel, Field
|
| 13 |
|
| 14 |
try:
|
|
|
|
| 175 |
def state(self) -> ClinicalTrialState:
|
| 176 |
return self._state
|
| 177 |
|
| 178 |
+
def get_metadata(self) -> EnvironmentMetadata:
|
| 179 |
+
return EnvironmentMetadata(
|
| 180 |
+
name="clinical_trial_env",
|
| 181 |
+
description=(
|
| 182 |
+
"Clinical trial patient screening environment with 3 deterministic tasks "
|
| 183 |
+
"and explicit graders for easy, medium, and hard difficulty."
|
| 184 |
+
),
|
| 185 |
+
version="1.0.0",
|
| 186 |
+
author="Abhishek-CS221006",
|
| 187 |
+
)
|
| 188 |
+
|
| 189 |
def grader(self) -> float:
|
| 190 |
"""Deterministically compare agent outputs against the current scenario ground truth."""
|
| 191 |
if self._current_scenario is None:
|
|
|
|
| 430 |
"""Compatibility alias for manifest entry points expecting env:ClinicalTrialEnv."""
|
| 431 |
|
| 432 |
pass
|
| 433 |
+
|
| 434 |
+
|
| 435 |
+
def grade_easy_screening() -> float:
|
| 436 |
+
"""Module-level easy task grader for validator discovery."""
|
| 437 |
+
return ClinicalTrialEnv().grade_easy_screening()
|
| 438 |
+
|
| 439 |
+
|
| 440 |
+
def grade_medium_ranking() -> float:
|
| 441 |
+
"""Module-level medium task grader for validator discovery."""
|
| 442 |
+
return ClinicalTrialEnv().grade_medium_ranking()
|
| 443 |
+
|
| 444 |
+
|
| 445 |
+
def grade_hard_exclusions() -> float:
|
| 446 |
+
"""Module-level hard task grader for validator discovery."""
|
| 447 |
+
return ClinicalTrialEnv().grade_hard_exclusions()
|