mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-18 17:51:02 +02:00
Change input_output to flow_processor
This commit is contained in:
parent
8f89336db3
commit
91d28e9d56
5 changed files with 13 additions and 13 deletions
|
|
@ -6,5 +6,5 @@ from . producer import Producer
|
||||||
from . publisher import Publisher
|
from . publisher import Publisher
|
||||||
from . subscriber import Subscriber
|
from . subscriber import Subscriber
|
||||||
from . metrics import ProcessorMetrics, ConsumerMetrics, ProducerMetrics
|
from . metrics import ProcessorMetrics, ConsumerMetrics, ProducerMetrics
|
||||||
from . input_output import InputOutputProcessor
|
from . flow_processor import FlowProcessor
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from .. base import AsyncProcessor, Consumer, Producer
|
||||||
|
|
||||||
from .. base import ProcessorMetrics, ConsumerMetrics, ProducerMetrics
|
from .. base import ProcessorMetrics, ConsumerMetrics, ProducerMetrics
|
||||||
|
|
||||||
class InputOutputProcessor(AsyncProcessor):
|
class FlowProcessor(AsyncProcessor):
|
||||||
|
|
||||||
def __init__(self, **params):
|
def __init__(self, **params):
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ class InputOutputProcessor(AsyncProcessor):
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
super(InputOutputProcessor, self).__init__(
|
super(FlowProcessor, self).__init__(
|
||||||
**params | {
|
**params | {
|
||||||
"id": self.id,
|
"id": self.id,
|
||||||
}
|
}
|
||||||
|
|
@ -138,7 +138,7 @@ class InputOutputProcessor(AsyncProcessor):
|
||||||
print("Handled config update")
|
print("Handled config update")
|
||||||
|
|
||||||
async def start(self):
|
async def start(self):
|
||||||
await super(InputOutputProcessor, self).start()
|
await super(FlowProcessor, self).start()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_args(parser, default_subscriber):
|
def add_args(parser, default_subscriber):
|
||||||
|
|
@ -10,13 +10,13 @@ from prometheus_client import Histogram
|
||||||
from ... schema import TextDocument, Chunk, Metadata
|
from ... schema import TextDocument, Chunk, Metadata
|
||||||
from ... schema import text_ingest_queue, chunk_ingest_queue
|
from ... schema import text_ingest_queue, chunk_ingest_queue
|
||||||
from ... log_level import LogLevel
|
from ... log_level import LogLevel
|
||||||
from ... base import InputOutputProcessor
|
from ... base import FlowProcessor
|
||||||
|
|
||||||
module = "chunker"
|
module = "chunker"
|
||||||
|
|
||||||
default_subscriber = module
|
default_subscriber = module
|
||||||
|
|
||||||
class Processor(InputOutputProcessor):
|
class Processor(FlowProcessor):
|
||||||
|
|
||||||
def __init__(self, **params):
|
def __init__(self, **params):
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ class Processor(InputOutputProcessor):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_args(parser):
|
def add_args(parser):
|
||||||
|
|
||||||
InputOutputProcessor.add_args(parser, default_subscriber)
|
FlowProcessor.add_args(parser, default_subscriber)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-z', '--chunk-size',
|
'-z', '--chunk-size',
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ from prometheus_client import Histogram
|
||||||
from ... schema import TextDocument, Chunk, Metadata
|
from ... schema import TextDocument, Chunk, Metadata
|
||||||
from ... schema import text_ingest_queue, chunk_ingest_queue
|
from ... schema import text_ingest_queue, chunk_ingest_queue
|
||||||
from ... log_level import LogLevel
|
from ... log_level import LogLevel
|
||||||
from ... base import InputOutputProcessor
|
from ... base import FlowProcessor
|
||||||
|
|
||||||
module = "chunker"
|
module = "chunker"
|
||||||
|
|
||||||
default_subscriber = module
|
default_subscriber = module
|
||||||
|
|
||||||
class Processor(InputOutputProcessor):
|
class Processor(FlowProcessor):
|
||||||
|
|
||||||
def __init__(self, **params):
|
def __init__(self, **params):
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ class Processor(InputOutputProcessor):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_args(parser):
|
def add_args(parser):
|
||||||
|
|
||||||
InputOutputProcessor.add_args(parser, default_subscriber)
|
FlowProcessor.add_args(parser, default_subscriber)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-z', '--chunk-size',
|
'-z', '--chunk-size',
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@ from langchain_community.document_loaders import PyPDFLoader
|
||||||
from ... schema import Document, TextDocument, Metadata
|
from ... schema import Document, TextDocument, Metadata
|
||||||
from ... schema import document_ingest_queue, text_ingest_queue
|
from ... schema import document_ingest_queue, text_ingest_queue
|
||||||
from ... log_level import LogLevel
|
from ... log_level import LogLevel
|
||||||
from ... base import InputOutputProcessor
|
from ... base import FlowProcessor
|
||||||
|
|
||||||
module = "pdf-decoder"
|
module = "pdf-decoder"
|
||||||
|
|
||||||
default_subscriber = module
|
default_subscriber = module
|
||||||
|
|
||||||
class Processor(InputOutputProcessor):
|
class Processor(FlowProcessor):
|
||||||
|
|
||||||
def __init__(self, **params):
|
def __init__(self, **params):
|
||||||
|
|
||||||
|
|
@ -78,7 +78,7 @@ class Processor(InputOutputProcessor):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_args(parser):
|
def add_args(parser):
|
||||||
|
|
||||||
InputOutputProcessor.add_args(parser, default_subscriber)
|
FlowProcessor.add_args(parser, default_subscriber)
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue