mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-04 08:35:40 +00:00
refactor:refactor knowledge api
1.delete CFG in embedding_engine api 2.add a text_splitter param in embedding_engine api
This commit is contained in:
@@ -8,11 +8,12 @@ from pilot.embedding_engine import SourceEmbedding, register
|
||||
class StringEmbedding(SourceEmbedding):
|
||||
"""string embedding for read string document."""
|
||||
|
||||
def __init__(self, file_path, vector_store_config):
|
||||
"""Initialize with pdf path."""
|
||||
super().__init__(file_path, vector_store_config)
|
||||
def __init__(self, file_path, vector_store_config, text_splitter=None):
|
||||
"""Initialize raw text word path."""
|
||||
super().__init__(file_path, vector_store_config, text_splitter=None)
|
||||
self.file_path = file_path
|
||||
self.vector_store_config = vector_store_config
|
||||
self.text_splitter = text_splitter or None
|
||||
|
||||
@register
|
||||
def read(self):
|
||||
|
Reference in New Issue
Block a user