AlgoCore commited on
Commit
65c3da2
Β·
1 Parent(s): db7c50d

Fix Pydantic v2 MRO conflict in SupportObservation/Action/State - 24/24 tests pass

Browse files
Files changed (1) hide show
  1. models.py +3 -3
models.py CHANGED
@@ -20,7 +20,7 @@ from openenv.core.env_server.types import Action, Observation, State
20
  # ═══════════════════════════════════════════════════════════════
21
 
22
  if _USE_PYDANTIC:
23
- class SupportAction(Action, BaseModel): # type: ignore[misc]
24
  model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid")
25
  metadata: Dict[str, Any] = {}
26
  action_type: Literal["classify", "reply", "escalate", "close"]
@@ -56,7 +56,7 @@ else:
56
  # ═══════════════════════════════════════════════════════════════
57
 
58
  if _USE_PYDANTIC:
59
- class SupportObservation(Observation, BaseModel): # type: ignore[misc]
60
  model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid")
61
  done: bool = False
62
  reward: Optional[float] = None
@@ -90,7 +90,7 @@ else:
90
  # ═══════════════════════════════════════════════════════════════
91
 
92
  if _USE_PYDANTIC:
93
- class SupportState(State, BaseModel): # type: ignore[misc]
94
  model_config = ConfigDict(arbitrary_types_allowed=True, extra="allow")
95
  episode_id: Optional[str] = None
96
  step_count: int = 0
 
20
  # ═══════════════════════════════════════════════════════════════
21
 
22
  if _USE_PYDANTIC:
23
+ class SupportAction(BaseModel): # type: ignore[misc]
24
  model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid")
25
  metadata: Dict[str, Any] = {}
26
  action_type: Literal["classify", "reply", "escalate", "close"]
 
56
  # ═══════════════════════════════════════════════════════════════
57
 
58
  if _USE_PYDANTIC:
59
+ class SupportObservation(BaseModel): # type: ignore[misc]
60
  model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid")
61
  done: bool = False
62
  reward: Optional[float] = None
 
90
  # ═══════════════════════════════════════════════════════════════
91
 
92
  if _USE_PYDANTIC:
93
+ class SupportState(BaseModel): # type: ignore[misc]
94
  model_config = ConfigDict(arbitrary_types_allowed=True, extra="allow")
95
  episode_id: Optional[str] = None
96
  step_count: int = 0