mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 01:21:48 +03:00
fix(assistants): brain id is null
This commit is contained in:
parent
e0edaedbd0
commit
d63ed6e651
@ -2,7 +2,7 @@ import json
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, model_validator
|
||||
from pydantic import BaseModel, model_validator, root_validator
|
||||
|
||||
|
||||
class EmailInput(BaseModel):
|
||||
@ -10,8 +10,15 @@ class EmailInput(BaseModel):
|
||||
|
||||
|
||||
class BrainInput(BaseModel):
|
||||
activated: bool
|
||||
value: UUID
|
||||
activated: Optional[bool] = False
|
||||
value: Optional[UUID] = None
|
||||
|
||||
@root_validator(pre=True)
|
||||
def empty_string_to_none(cls, values):
|
||||
for field, value in values.items():
|
||||
if value == "":
|
||||
values[field] = None
|
||||
return values
|
||||
|
||||
|
||||
class FileInput(BaseModel):
|
||||
|
Loading…
Reference in New Issue
Block a user