Builds PaperTrail from the base skeleton into a full evidence-verification platform for the "Built with Claude: Life Sciences" hackathon (Builder Track). New named-user features (Build Beyond the Bench): - Lab Notebook Companion — rough bench notes -> structured, searchable, grounded experiment records (lib/labNotebook, /console/lab-notebook, migration 0059) - Clinical Trial Matcher — de-identified patient notes -> ranked eligible ClinicalTrials.gov trials with per-criterion inclusion/exclusion reasoning (lib/trialMatcher, /console/trial-matcher, migrations 0060) Platform: - Deterministic verification moat (biostats recompute, exact-span grounding) - 11 biomedical evidence engines (FAERS, GWAS, Open Targets, ChEMBL, ClinVar, PharmGKB, PubTator, DDI, repurposing, biomarker, unified verifier) - Evidence Intelligence (KG, dossier, provenance/export, RWE) + enterprise governance (RBAC, /api/v1 gateway, metering, audit chain, retention) - 17 OSS projects assimilated into native TypeScript on our stack (backend/engines retained + credited in NOTICE) - Multi-format upload (PDF/DOCX/XLSX/CSV/MD/TXT), logo, marketing site - Next.js 16 upgrade, benchmark harness (honest smoke-test caveat) Licensing: Apache-2.0 (LICENSE + NOTICE).
70 lines
1.7 KiB
Python
70 lines
1.7 KiB
Python
from datetime import datetime
|
|
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from shared.abstractions import R2RSerializable
|
|
|
|
from ..utils import generate_default_user_collection_id
|
|
|
|
|
|
class Collection(BaseModel):
|
|
id: UUID
|
|
name: str
|
|
description: Optional[str] = None
|
|
created_at: datetime = Field(
|
|
default_factory=datetime.utcnow,
|
|
)
|
|
updated_at: datetime = Field(
|
|
default_factory=datetime.utcnow,
|
|
)
|
|
|
|
class Config:
|
|
populate_by_name = True
|
|
from_attributes = True
|
|
|
|
def __init__(self, **data):
|
|
super().__init__(**data)
|
|
if self.id is None:
|
|
self.id = generate_default_user_collection_id(self.name)
|
|
|
|
|
|
class Token(BaseModel):
|
|
token: str
|
|
token_type: str
|
|
|
|
|
|
class TokenData(BaseModel):
|
|
email: str
|
|
token_type: str
|
|
exp: datetime
|
|
|
|
|
|
class User(R2RSerializable):
|
|
id: UUID
|
|
email: str
|
|
is_active: bool = True
|
|
is_superuser: bool = False
|
|
created_at: datetime = datetime.now()
|
|
updated_at: datetime = datetime.now()
|
|
is_verified: bool = False
|
|
collection_ids: list[UUID] = []
|
|
graph_ids: list[UUID] = []
|
|
document_ids: list[UUID] = []
|
|
|
|
# Optional fields (to update or set at creation)
|
|
limits_overrides: Optional[dict] = None
|
|
metadata: Optional[dict] = None
|
|
verification_code_expiry: Optional[datetime] = None
|
|
name: Optional[str] = None
|
|
bio: Optional[str] = None
|
|
profile_picture: Optional[str] = None
|
|
total_size_in_bytes: Optional[int] = None
|
|
num_files: Optional[int] = None
|
|
|
|
account_type: str = "password"
|
|
hashed_password: Optional[str] = None
|
|
google_id: Optional[str] = None
|
|
github_id: Optional[str] = None
|