mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 11:41:02 +02:00
Change document-rag and graph-rag processing so that the user can
specify parameters. Changes in Pulsar services, Pulsar message schemas, gateway and command-line tools. User-visible changes in new parameters on command-line tools.
This commit is contained in:
parent
f1559c5944
commit
8830e99e57
12 changed files with 154 additions and 48 deletions
|
|
@ -102,11 +102,19 @@ class Api:
|
|||
except:
|
||||
raise ProtocolException(f"Response not formatted correctly")
|
||||
|
||||
def graph_rag(self, question):
|
||||
def graph_rag(
|
||||
self, question, user="trustgraph", collection="default",
|
||||
entity_limit=50, triple_limit=30, subgraph_limit=1000,
|
||||
):
|
||||
|
||||
# The input consists of a question
|
||||
input = {
|
||||
"query": question
|
||||
"query": question,
|
||||
"user": user,
|
||||
"collection": collection,
|
||||
"entity-limit": entity_limit,
|
||||
"triple-limit": triple_limit,
|
||||
"max-subgraph-limit": subgraph_limit,
|
||||
}
|
||||
|
||||
url = f"{self.url}graph-rag"
|
||||
|
|
@ -131,11 +139,17 @@ class Api:
|
|||
except:
|
||||
raise ProtocolException(f"Response not formatted correctly")
|
||||
|
||||
def document_rag(self, question):
|
||||
def document_rag(
|
||||
self, question, user="trustgraph", collection="default",
|
||||
doc_limit=10,
|
||||
):
|
||||
|
||||
# The input consists of a question
|
||||
input = {
|
||||
"query": question
|
||||
"query": question,
|
||||
"user": user,
|
||||
"collection": collection,
|
||||
"doc-limit": doc_limit,
|
||||
}
|
||||
|
||||
url = f"{self.url}document-rag"
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ class GraphRagQuery(Record):
|
|||
query = String()
|
||||
user = String()
|
||||
collection = String()
|
||||
entity_limit = Integer()
|
||||
triple_limit = Integer()
|
||||
max_subgraph_size = Integer()
|
||||
|
||||
class GraphRagResponse(Record):
|
||||
error = Error()
|
||||
|
|
@ -31,6 +34,7 @@ class DocumentRagQuery(Record):
|
|||
query = String()
|
||||
user = String()
|
||||
collection = String()
|
||||
doc_limit = Integer()
|
||||
|
||||
class DocumentRagResponse(Record):
|
||||
error = Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue