From dc6ca7c0eb1fa22ac36f5751f32358ef0a7cd290 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Tue, 13 Aug 2024 09:13:17 +0100 Subject: [PATCH] Fix issues, RAG working with new services --- scripts/query | 2 ++ tests/test-graph-rag | 4 ++-- trustgraph/graph_rag.py | 1 + trustgraph/retrieval/graph_rag/rag.py | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/query b/scripts/query index c8d72aa2..4983cde8 100755 --- a/scripts/query +++ b/scripts/query @@ -8,6 +8,8 @@ query = " ".join(sys.argv[1:]) gr = GraphRag( verbose=True, pulsar_host="pulsar://localhost:6650", + completion_request_queue="non-persistent://tg/request/text-completion-rag", + completion_response_queue="non-persistent://tg/response/text-completion-rag-response", ) if query == "": diff --git a/tests/test-graph-rag b/tests/test-graph-rag index c2f629b1..0e07ff67 100755 --- a/tests/test-graph-rag +++ b/tests/test-graph-rag @@ -6,8 +6,8 @@ from trustgraph.graph_rag_client import GraphRagClient rag = GraphRagClient(pulsar_host="pulsar://localhost:6650") query=""" -Identify any facts which provide an explanation of the explosion of the -space shuttle rocket boosters""" +This knowledge graph describes the Space Shuttle disaster. +Present 20 facts which are present in the knowledge graph.""" resp = rag.request(query) diff --git a/trustgraph/graph_rag.py b/trustgraph/graph_rag.py index 833c080b..e48fa4ad 100644 --- a/trustgraph/graph_rag.py +++ b/trustgraph/graph_rag.py @@ -271,6 +271,7 @@ Use only the provided knowledge statements to respond to the following: if self.verbose: print("Invoke LLM...", flush=True) + print(prompt) resp = self.llm.request(prompt) diff --git a/trustgraph/retrieval/graph_rag/rag.py b/trustgraph/retrieval/graph_rag/rag.py index 1191bba9..1eb8a235 100755 --- a/trustgraph/retrieval/graph_rag/rag.py +++ b/trustgraph/retrieval/graph_rag/rag.py @@ -88,8 +88,8 @@ class Processor(ConsumerProducer): emb_response_queue=emb_response_queue, ge_request_queue=ge_request_queue, ge_response_queue=ge_response_queue, - triples_request_queue=triples_request_queue, - triples_response_queue=triples_response_queue, + tpl_request_queue=triples_request_queue, + tpl_response_queue=triples_response_queue, verbose=True, entity_limit=entity_limit, triple_limit=triple_limit,