mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31: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
|
|
@ -11,13 +11,16 @@ from trustgraph.api import Api
|
|||
default_url = os.getenv("TRUSTGRAPH_URL", 'http://localhost:8088/')
|
||||
default_user = 'trustgraph'
|
||||
default_collection = 'default'
|
||||
default_doc_limit = 10
|
||||
|
||||
def question(url, question, user, collection):
|
||||
def question(url, question, user, collection, doc_limit):
|
||||
|
||||
rag = Api(url)
|
||||
|
||||
# user=user, collection=collection,
|
||||
resp = rag.document_rag(question=question)
|
||||
resp = rag.document_rag(
|
||||
question=question, user=user, collection=collection,
|
||||
doc_limit=doc_limit,
|
||||
)
|
||||
|
||||
print(resp)
|
||||
|
||||
|
|
@ -58,6 +61,12 @@ def main():
|
|||
help=f'Collection ID (default: {default_collection})'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-d', '--doc-limit',
|
||||
default=default_doc_limit,
|
||||
help=f'Document limit (default: {default_doc_limit})'
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
try:
|
||||
|
|
@ -67,6 +76,7 @@ def main():
|
|||
question=args.question,
|
||||
user=args.user,
|
||||
collection=args.collection,
|
||||
doc_limit=args.doc_limit,
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue