1. Three party web website data access - Web site synchronization Building a knowledge base by crawling web page data in batches through web crawlers Web site synchronization utilizes crawler technology, which can automatically capture all websites under the same domain name through a single entry website. Currently, it supports up to 200 subpages. For compliance and security reasons, only static site crawling is supported, mainly used for quickly building knowledge bases on various document sites. 2. Feishu Knowledge Base By configuring Feishu document permissions, a knowledge base can be built using Feishu documents, and the documents will not undergo secondary storage 3. Language Bird Knowledge Base You can configure the permissions of the language bird document to build a knowledge base using the language bird document, and the document will not undergo secondary storage
43 lines
1010 B
Python
43 lines
1010 B
Python
from pydantic import BaseModel, Field, field_serializer, ConfigDict
|
|
import datetime
|
|
import uuid
|
|
|
|
|
|
class FileBase(BaseModel):
|
|
kb_id: uuid.UUID
|
|
created_by: uuid.UUID | None = None
|
|
parent_id: uuid.UUID | None = None
|
|
file_name: str
|
|
file_ext: str
|
|
file_size: int
|
|
file_url: str | None = None
|
|
created_at: datetime.datetime | None = None
|
|
|
|
|
|
class FileCreate(FileBase):
|
|
pass
|
|
|
|
|
|
class CustomTextFileCreate(BaseModel):
|
|
title: str
|
|
content: str
|
|
|
|
|
|
class FileUpdate(BaseModel):
|
|
parent_id: uuid.UUID | None = Field(None)
|
|
file_name: str | None = Field(None)
|
|
file_ext: str | None = Field(None)
|
|
file_size: str | None = Field(None)
|
|
file_url: str | None = Field(None)
|
|
|
|
|
|
class File(FileBase):
|
|
id: uuid.UUID
|
|
created_at: datetime.datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
@field_serializer("created_at", when_used="json")
|
|
def _serialize_created_at(self, dt: datetime.datetime):
|
|
return int(dt.timestamp() * 1000) if dt else None
|