diff options
Diffstat (limited to 'gnqa/src/study2/run_questions.py')
-rw-r--r-- | gnqa/src/study2/run_questions.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gnqa/src/study2/run_questions.py b/gnqa/src/study2/run_questions.py index 07aee5f0..9bac5a23 100644 --- a/gnqa/src/study2/run_questions.py +++ b/gnqa/src/study2/run_questions.py @@ -2,17 +2,19 @@ import json import sys import os -from r2r import R2RClient -from study2.document_operations import DocOps, QuestionList +from r2r import R2RClient, RAGResponse +from document_operations import DocOps, QuestionList ''' ******************************************************************************* Variables ******************************************************************************* ''' +rag_gen_cfg = {"model": "openai/gpt-4o-mini", "temperature": 0.0, "use_hybrid_search": True} rag_response = {} -client = R2RClient("http://localhost:8000") -health_resp = client.health() +#client = R2RClient("http://localhost:8000") +client = R2RClient("http://localhost:7272") +#health_resp = client.health() ''' ******************************************************************************* @@ -20,19 +22,20 @@ Commands ******************************************************************************* ''' -print("The R2R client's health status is {0}".format(health_resp)) +#print("The R2R client's health status is {0}".format(health_resp)) try: read_file = str(sys.argv[1]) out_file = str(sys.argv[2]) except: - exit('Example use "python run_questions.py ../data/questions/human/de/aging.json ../data/responses/human/de/aging_resp.json"') + exit('Example use "python run_questions.py ../../data/study2/lists/human-questions.json ../../data/test_study/human/de/aging_resp.json"') qLst = QuestionList(read_file, 1) # second parameter is for verbose output ndx = 1 for question in qLst.get("domainexpert","aging"): print('Getting response for the following question --> {0}'.format(question)) - rag_response[str(ndx)] = client.rag(question) + #rag_response[str(ndx)] = client.rag(question) + rag_response[str(ndx)] = client.retrieval.rag(question, rag_gen_cfg) ndx += 1 -DocOps.writeDatasetFile(rag_response, out_file)
\ No newline at end of file +DocOps.writeRAGResponses(rag_response, out_file)
\ No newline at end of file |