36 lines
692 B
Python
36 lines
692 B
Python
from __future__ import annotations
|
|
|
|
from enum import Enum
|
|
from typing import Any, TypedDict
|
|
|
|
|
|
class StrEnum(str, Enum):
|
|
def __str__(self) -> str:
|
|
return self.value
|
|
|
|
|
|
class SourceType(StrEnum):
|
|
CONSULTANT = "consultant_document"
|
|
|
|
|
|
class MessageRole(StrEnum):
|
|
USER = "user"
|
|
ASSISTANT = "assistant"
|
|
SYSTEM = "system"
|
|
|
|
|
|
class ParserChunkMetadata(TypedDict, total=False):
|
|
source_title: str
|
|
source_short_name: str
|
|
consultant_category: str
|
|
chapter_title: str | None
|
|
section_title: str | None
|
|
article_number: str | None
|
|
article_title: str | None
|
|
document_url: str
|
|
breadcrumb: list[str]
|
|
version_hash: str
|
|
|
|
|
|
JSONDict = dict[str, Any]
|