mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-18 01:31:02 +02:00
API finalised
This commit is contained in:
parent
91d28e9d56
commit
b94b4b7389
10 changed files with 87 additions and 133 deletions
|
|
@ -59,7 +59,7 @@ class Processor(FlowProcessor):
|
|||
|
||||
print("Chunker initialised", flush=True)
|
||||
|
||||
async def on_message(self, msg, consumer):
|
||||
async def on_message(self, msg, consumer, flow):
|
||||
|
||||
v = msg.value()
|
||||
print(f"Chunking {v.metadata.id}...", flush=True)
|
||||
|
|
@ -81,7 +81,7 @@ class Processor(FlowProcessor):
|
|||
id=consumer.id, flow=consumer.flow
|
||||
).observe(len(chunk.page_content))
|
||||
|
||||
await consumer.q["output"].send(r)
|
||||
await flow.producer["output"].send(r)
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class Processor(FlowProcessor):
|
|||
|
||||
print("Chunker initialised", flush=True)
|
||||
|
||||
async def on_message(self, msg, consumer):
|
||||
async def on_message(self, msg, consumer, flow):
|
||||
|
||||
v = msg.value()
|
||||
print(f"Chunking {v.metadata.id}...", flush=True)
|
||||
|
|
@ -80,7 +80,7 @@ class Processor(FlowProcessor):
|
|||
id=consumer.id, flow=consumer.flow
|
||||
).observe(len(chunk.page_content))
|
||||
|
||||
await consumer.q["output"].send(r)
|
||||
await flow.producer["output"].send(r)
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class Processor(AsyncProcessor):
|
|||
)
|
||||
|
||||
self.subs = self.subscribe(
|
||||
flow = None,
|
||||
queue = request_queue,
|
||||
subscriber = subscriber,
|
||||
schema = request_schema,
|
||||
|
|
@ -105,7 +106,7 @@ class Processor(AsyncProcessor):
|
|||
|
||||
print("Pushed version ", self.config.version)
|
||||
|
||||
async def on_message(self, msg, consumer):
|
||||
async def on_message(self, msg, consumer, flow):
|
||||
|
||||
try:
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class Processor(FlowProcessor):
|
|||
|
||||
print("PDF inited", flush=True)
|
||||
|
||||
async def on_message(self, msg, consumer):
|
||||
async def on_message(self, msg, consumer, flow):
|
||||
|
||||
print("PDF message received", flush=True)
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ class Processor(FlowProcessor):
|
|||
text=page.page_content.encode("utf-8"),
|
||||
)
|
||||
|
||||
await consumer.q["output"].send(r)
|
||||
await flow.producer["output"].send(r)
|
||||
|
||||
print("Done.", flush=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue