Skip to content

Commit

Permalink
Merge branch 'feat/support-parent-child-chunk' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong committed Dec 24, 2024
2 parents 0458ab6 + 98cd57f commit cee7873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions api/services/dataset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,10 @@ def save_document_with_dataset_id(
elif knowledge_config.data_source.info_list.data_source_type == "notion_import":
notion_info_list = knowledge_config.data_source.info_list.notion_info_list
for notion_info in notion_info_list:
count = count + len(notion_info["pages"])
count = count + len(notion_info.pages)
elif knowledge_config.data_source.info_list.data_source_type == "website_crawl":
website_info = knowledge_config.data_source.info_list.website_info_list
count = len(website_info["urls"])
count = len(website_info.urls)
batch_upload_limit = int(dify_config.BATCH_UPLOAD_LIMIT)
if count > batch_upload_limit:
raise ValueError(f"You have reached the batch upload limit of {batch_upload_limit}.")
Expand Down Expand Up @@ -902,7 +902,7 @@ def save_document_with_dataset_id(
data_source_info = {
"notion_workspace_id": workspace_id,
"notion_page_id": page.page_id,
"notion_page_icon": page.page_icon,
"notion_page_icon": page.page_icon.model_dump(),
"type": page.type,
}
document = DocumentService.build_document(
Expand Down Expand Up @@ -1145,7 +1145,7 @@ def save_document_without_dataset_id(tenant_id: str, knowledge_config: Knowledge
elif knowledge_config.data_source.info_list.data_source_type == "notion_import":
notion_info_list = knowledge_config.data_source.info_list.notion_info_list
for notion_info in notion_info_list:
count = count + len(notion_info["pages"])
count = count + len(notion_info.pages)
elif knowledge_config.data_source.info_list.data_source_type == "website_crawl":
website_info = knowledge_config.data_source.info_list.website_info_list
count = len(website_info.urls)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,16 @@ class ParentMode(str, Enum):
PARAGRAPH = "paragraph"


class NotionIcon(BaseModel):
type: str
url: Optional[str] = None
emoji: Optional[str] = None


class NotionPage(BaseModel):
page_id: str
page_name: str
page_icon: Optional[str]
page_icon: Optional[NotionIcon] = None
type: str


Expand Down

0 comments on commit cee7873

Please sign in to comment.