feat(core): Upgrade pydantic to 2.x (#1428)

This commit is contained in:
Fangyin Cheng
2024-04-20 09:41:16 +08:00
committed by GitHub
parent baa1e3f9f6
commit 57be1ece18
103 changed files with 1146 additions and 534 deletions

View File

@@ -40,6 +40,7 @@ from dbgpt.util.tracer import root_tracer, trace
from ..api.schemas import (
DocumentServeRequest,
DocumentServeResponse,
DocumentVO,
KnowledgeSyncRequest,
SpaceServeRequest,
SpaceServeResponse,
@@ -419,7 +420,7 @@ class Service(BaseService[KnowledgeSpaceEntity, SpaceServeRequest, SpaceServeRes
def _sync_knowledge_document(
self,
space_id,
doc: KnowledgeDocumentEntity,
doc_vo: DocumentVO,
chunk_parameters: ChunkParameters,
) -> List[Chunk]:
"""sync knowledge document chunk into vector store"""
@@ -431,6 +432,8 @@ class Service(BaseService[KnowledgeSpaceEntity, SpaceServeRequest, SpaceServeRes
)
from dbgpt.storage.vector_store.base import VectorStoreConfig
doc = KnowledgeDocumentEntity.from_document_vo(doc_vo)
space = self.get({"id": space_id})
config = VectorStoreConfig(
name=space.name,