mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
references: models
This commit is contained in:
parent
d0b2548019
commit
ee9b9af8d3
1 changed files with 29 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
"""Data shapes for a resolved ``@``-reference."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class ReferenceKind(str, Enum):
|
||||
"""What the user pointed at; the value is the label shown to the model."""
|
||||
|
||||
DOCUMENT = "document"
|
||||
FOLDER = "folder"
|
||||
CONNECTOR = "connector"
|
||||
CHAT = "chat"
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ResolvedReference:
|
||||
"""A resolved reference: identity plus the bits a pointer line needs."""
|
||||
|
||||
kind: ReferenceKind
|
||||
entity_id: int
|
||||
label: str
|
||||
path: str | None = None # document/folder virtual path
|
||||
provider: str | None = None # connector provider, e.g. "Gmail"
|
||||
|
||||
|
||||
__all__ = ["ReferenceKind", "ResolvedReference"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue