mirror of
https://github.com/onyx-dot-app/onyx.git
synced 2026-10-22 11:22:49 -05:00
* ran bump-pydantic * replace root_validator with model_validator * mostly working. some alternate assistant error. changed root_validator and typing_extensions * working generation chat. changed type * replacing .dict with .model_dump * argument needed to bring model_dump up to parity with dict() * fix a fewremaining issues -- working with llama and gpt * updating requirements file * more requirement updates * more requirement updates * fix to make search work * return type fix: * half way tpyes change * fixes for mypy and pydantic: * endpoint fix * fix pydantic protected namespaces * it works! * removed unecessary None initializations * better logging * changed default values to empty lists * mypy fixes * fixed array defaulting --------- Co-authored-by: hagen-danswer <hagen@danswer.ai>
47 lines
785 B
Python
47 lines
785 B
Python
from typing import Generic
|
|
from typing import Optional
|
|
from typing import TypeVar
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from danswer.auth.schemas import UserRole
|
|
from danswer.auth.schemas import UserStatus
|
|
|
|
|
|
DataT = TypeVar("DataT")
|
|
|
|
|
|
class StatusResponse(BaseModel, Generic[DataT]):
|
|
success: bool
|
|
message: Optional[str] = None
|
|
data: Optional[DataT] = None
|
|
|
|
|
|
class ApiKey(BaseModel):
|
|
api_key: str
|
|
|
|
|
|
class IdReturn(BaseModel):
|
|
id: int
|
|
|
|
|
|
class MinimalUserSnapshot(BaseModel):
|
|
id: UUID
|
|
email: str
|
|
|
|
|
|
class FullUserSnapshot(BaseModel):
|
|
id: UUID
|
|
email: str
|
|
role: UserRole
|
|
status: UserStatus
|
|
|
|
|
|
class InvitedUserSnapshot(BaseModel):
|
|
email: str
|
|
|
|
|
|
class DisplayPriorityRequest(BaseModel):
|
|
display_priority_map: dict[int, int]
|