From 281ade3f2624ac77be127d316855b9e419a3b3a7 Mon Sep 17 00:00:00 2001 From: jyong <718720800@qq.com> Date: Sat, 15 Jun 2024 00:28:10 +0800 Subject: [PATCH] add optional type --- api/core/rag/extractor/entity/extract_setting.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/core/rag/extractor/entity/extract_setting.py b/api/core/rag/extractor/entity/extract_setting.py index adc50449c5b01f..e474cf376f0632 100644 --- a/api/core/rag/extractor/entity/extract_setting.py +++ b/api/core/rag/extractor/entity/extract_setting.py @@ -1,3 +1,5 @@ +from typing import Optional + from pydantic import BaseModel, ConfigDict from models.dataset import Document @@ -42,10 +44,10 @@ class ExtractSetting(BaseModel): Model class for provider response. """ datasource_type: str - upload_file: UploadFile = None - notion_info: NotionInfo = None - website_info: WebsiteInfo = None - document_model: str = None + upload_file: Optional[UploadFile] + notion_info: Optional[NotionInfo] + website_info: Optional[WebsiteInfo] + document_model: Optional[str] model_config = ConfigDict(arbitrary_types_allowed=True) def __init__(self, **data) -> None: