mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-14 05:31:40 +00:00
fix: VectorStore can not be attached to EmbeddingAssemblerOperator bug (#2170)
This commit is contained in:
@@ -232,6 +232,7 @@ class PDFKnowledge(Knowledge):
|
||||
"page": page,
|
||||
"type": "excel",
|
||||
"title": file_title,
|
||||
"source": self.file_path,
|
||||
}
|
||||
page_documents.append(
|
||||
Document(
|
||||
@@ -244,6 +245,7 @@ class PDFKnowledge(Knowledge):
|
||||
"page": page,
|
||||
"type": "text",
|
||||
"title": file_title,
|
||||
"source": self.file_path,
|
||||
}
|
||||
page_documents.append(
|
||||
Document(content=inside_content, metadata=content_metadata)
|
||||
|
@@ -155,7 +155,7 @@ class EmbeddingAssemblerOperator(AssemblerOperator[Knowledge, List[Chunk]]):
|
||||
IOField.build_from(
|
||||
_("Chunks"),
|
||||
"chunks",
|
||||
Chunk,
|
||||
List[Chunk],
|
||||
description=_(
|
||||
"The assembled chunks, it has been persisted to vector " "store."
|
||||
),
|
||||
|
@@ -20,7 +20,7 @@ class KnowledgeOperator(MapOperator[str, Knowledge]):
|
||||
"""Knowledge Factory Operator."""
|
||||
|
||||
metadata = ViewMetadata(
|
||||
label=_("Knowledge Operator"),
|
||||
label=_("Knowledge Loader Operator"),
|
||||
name="knowledge_operator",
|
||||
category=OperatorCategory.RAG,
|
||||
description=_(
|
||||
@@ -30,7 +30,7 @@ class KnowledgeOperator(MapOperator[str, Knowledge]):
|
||||
IOField.build_from(
|
||||
_("knowledge datasource"),
|
||||
"knowledge datasource",
|
||||
str,
|
||||
dict,
|
||||
_("knowledge datasource, which can be a document, url, or text."),
|
||||
)
|
||||
],
|
||||
@@ -89,7 +89,7 @@ class KnowledgeOperator(MapOperator[str, Knowledge]):
|
||||
self._datasource = datasource
|
||||
self._knowledge_type = KnowledgeType.get_by_value(knowledge_type)
|
||||
|
||||
async def map(self, datasource: str) -> Knowledge:
|
||||
async def map(self, datasource: dict) -> Knowledge:
|
||||
"""Create knowledge from datasource."""
|
||||
if self._datasource:
|
||||
datasource = self._datasource
|
||||
@@ -120,7 +120,7 @@ class ChunksToStringOperator(MapOperator[List[Chunk], str]):
|
||||
IOField.build_from(
|
||||
_("Chunks"),
|
||||
"chunks",
|
||||
Chunk,
|
||||
List[Chunk],
|
||||
description=_("The input chunks."),
|
||||
is_list=True,
|
||||
)
|
||||
|
Reference in New Issue
Block a user