Source code for lalandre_core.models.embedding_state

"""Pydantic model tracking the embedding status of stored objects."""

from datetime import datetime
from typing import Literal, Optional

from pydantic import BaseModel, ConfigDict, Field


[docs] class EmbeddingState(BaseModel): """Represent one embedding state snapshot for an act, chunk, or subdivision.""" model_config = ConfigDict(from_attributes=True) id: Optional[int] = Field(default=None, description="Primary key") object_type: Literal["subdivision", "chunk", "act"] = Field(..., description="Type of embedded object") object_id: int = Field(..., description="ID of the embedded object") provider: str = Field(..., max_length=50, description="Embedding provider name") model_name: str = Field(..., max_length=255, description="Embedding model name") vector_size: int = Field(..., gt=0, description="Dimensionality of the vector") content_hash: str = Field(..., max_length=64, description="SHA-256 of embedded content") embedded_at: Optional[datetime] = Field(default=None, description="Embedding timestamp")