Tryna get knowledge core to load

This commit is contained in:
Cyber MacGeddon 2025-05-02 20:44:17 +01:00
parent 03d59b62af
commit dddf47d161
5 changed files with 33 additions and 24 deletions

View file

@ -28,7 +28,7 @@ async def load_ge(running, queue, url):
async with aiohttp.ClientSession() as session:
async with session.ws_connect(f"{url}load/graph-embeddings") as ws:
async with session.ws_connect(url) as ws:
while running.get():
@ -73,7 +73,7 @@ async def load_triples(running, queue, url):
async with aiohttp.ClientSession() as session:
async with session.ws_connect(f"{url}load/triples") as ws:
async with session.ws_connect(url) as ws:
while running.get():
@ -200,6 +200,9 @@ async def run(running, **args):
ge_q = asyncio.Queue(maxsize=10)
t_q = asyncio.Queue(maxsize=10)
flow_id = args["flow"]
url = args["url"]
load_task = asyncio.create_task(
loader(
running=running,
@ -212,15 +215,17 @@ async def run(running, **args):
ge_task = asyncio.create_task(
load_ge(
running=running,
queue=ge_q, url=args["url"] + "api/v1/"
running = running,
queue = ge_q,
url = f"{url}api/v1/{flow_id}/import/graph-embeddings"
)
)
triples_task = asyncio.create_task(
load_triples(
running=running,
queue=t_q, url=args["url"] + "api/v1/"
running = running,
queue = t_q,
url = f"{url}api/v1/{flow_id}/import/triples"
)
)
@ -258,6 +263,13 @@ async def main(running):
help=f'Output file'
)
parser.add_argument(
'-f', '--flow-id',
# Make it mandatory, difficult to over-write an existing file
default="0000",
help=f'Flow ID'
)
parser.add_argument(
'--format',
default="msgpack",