Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /li-boxuan_OpenDevin /enterprise /storage /experiment_assignment.py
| """ | |
| Database model for experiment assignments. | |
| This model tracks which experiments a conversation is assigned to and what variant | |
| they received from PostHog feature flags. | |
| """ | |
| import uuid | |
| from datetime import UTC, datetime | |
| from sqlalchemy import Column, DateTime, String, UniqueConstraint | |
| from storage.base import Base | |
| class ExperimentAssignment(Base): # type: ignore | |
| __tablename__ = 'experiment_assignments' | |
| id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) | |
| conversation_id = Column(String, nullable=True, index=True) | |
| experiment_name = Column(String, nullable=False) | |
| variant = Column(String, nullable=False) | |
| created_at = Column( | |
| DateTime(timezone=True), | |
| default=lambda: datetime.now(UTC), # type: ignore[attr-defined] | |
| nullable=False, | |
| ) | |
| updated_at = Column( | |
| DateTime(timezone=True), | |
| default=lambda: datetime.now(UTC), # type: ignore[attr-defined] | |
| onupdate=lambda: datetime.now(UTC), # type: ignore[attr-defined] | |
| nullable=False, | |
| ) | |
| __table_args__ = ( | |
| UniqueConstraint( | |
| 'conversation_id', | |
| 'experiment_name', | |
| name='uq_experiment_assignments_conversation_experiment', | |
| ), | |
| ) | |
Xet Storage Details
- Size:
- 1.26 kB
- Xet hash:
- 898f1b6d4cd17942b91f2688dd42cf77329c2dc2cd1b28d1b19422ecca3428a5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.