Files
onyx/backend/danswer/server/models.py
T
josvdwandhagen-danswer 50c17438d5 Litellm bump (#2195)
* 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>
2024-08-28 00:00:27 +00:00

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]