2025-05-24 12:15:48 +02:00

32 lines
659 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Data models for tSNE exports.
These models are used by *vecview* and any endpoint that needs to return or
validate tSNE projection data.
"""
from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class TSNEPoint(BaseModel):
"""A single point in a 3D tSNE projection."""
x: float
y: float
z: float
file_id: str
chunk: str
cluster: Optional[str] = None
hover_text: Optional[str] = None
class TSNEData(BaseModel):
"""Container returned to callers requesting a tSNE view."""
course_id: Optional[int] = None
total: int
points: List[TSNEPoint]