File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from pydantic import BaseModel , Field
2- from typing import Optional
2+ # Removed Optional in favor of X | None
33import datetime
44
55
66class Document (BaseModel ):
77 """A source doc (meeting note, CRM record, report)."""
8- id : Optional [ int ] = None
8+ id : int | None = None
99 source_type : str = "meeting_note" # meeting_note | crm_record | report
1010 title : str
1111 raw_text : str
12- author : Optional [ str ] = None
12+ author : str | None = None
1313 created_at : str = Field (default_factory = lambda : datetime .datetime .now (datetime .timezone .utc ).isoformat ())
1414 meta : dict = Field (default_factory = dict )
1515
1616
1717class Chunk (BaseModel ):
1818 """A retrievable unit with embedding + metadata for filtered vector search."""
19- id : Optional [ int ] = None
19+ id : int | None = None
2020 doc_id : int
2121 text : str
2222 embedding : list [float ] = Field (default_factory = list )
2323 source_type : str
24- entity : Optional [ str ] = None # e.g. investor/company name for graph
25- author : Optional [ str ] = None
24+ entity : str | None = None # e.g. investor/company name for graph
25+ author : str | None = None
2626 # populated at query time
2727 score : float = 0.0
2828 cited : bool = False
@@ -32,7 +32,7 @@ class Citation(BaseModel):
3232 chunk_id : int
3333 snippet : str
3434 source_type : str
35- entity : Optional [ str ] = None
35+ entity : str | None = None
3636
3737
3838class Answer (BaseModel ):
You can’t perform that action at this time.
0 commit comments