mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-06 03:20:41 +00:00
feat: add GraphRAG framework and integrate TuGraph (#1506)
Co-authored-by: KingSkyLi <15566300566@163.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
This commit is contained in:
26
dbgpt/rag/transformer/base.py
Normal file
26
dbgpt/rag/transformer/base.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""Transformer base class."""
|
||||
import logging
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import List, Optional
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TransformerBase:
|
||||
"""Transformer base class."""
|
||||
|
||||
|
||||
class EmbedderBase(TransformerBase, ABC):
|
||||
"""Embedder base class."""
|
||||
|
||||
|
||||
class ExtractorBase(TransformerBase, ABC):
|
||||
"""Extractor base class."""
|
||||
|
||||
@abstractmethod
|
||||
async def extract(self, text: str, limit: Optional[int] = None) -> List:
|
||||
"""Extract results from text."""
|
||||
|
||||
|
||||
class TranslatorBase(TransformerBase, ABC):
|
||||
"""Translator base class."""
|
Reference in New Issue
Block a user