Spaces:
Running
Running
Update rag.py
Browse files
rag.py
CHANGED
@@ -43,7 +43,7 @@ def query_groq_llm(prompt, model_name="llama3-70b-8192"):
|
|
43 |
print(f"Error querying Groq API: {e}")
|
44 |
return ""
|
45 |
|
46 |
-
|
47 |
user_input_lower = user_input.lower().strip()
|
48 |
|
49 |
# π Check if question is about fee
|
@@ -70,9 +70,7 @@ def query_groq_llm(prompt, model_name="llama3-70b-8192"):
|
|
70 |
prompt = f"""As an official assistant for University of Education Lahore, provide a helpful response:
|
71 |
Include relevant details about university policies.
|
72 |
If unsure, direct to official channels.
|
73 |
-
|
74 |
Question: {user_input}
|
75 |
-
|
76 |
Official Answer:"""
|
77 |
|
78 |
llm_response = query_groq_llm(prompt)
|
@@ -91,4 +89,3 @@ def query_groq_llm(prompt, model_name="llama3-70b-8192"):
|
|
91 |
π ue.edu.pk"""
|
92 |
|
93 |
return response
|
94 |
-
|
|
|
43 |
print(f"Error querying Groq API: {e}")
|
44 |
return ""
|
45 |
|
46 |
+
def get_best_answer(user_input):
|
47 |
user_input_lower = user_input.lower().strip()
|
48 |
|
49 |
# π Check if question is about fee
|
|
|
70 |
prompt = f"""As an official assistant for University of Education Lahore, provide a helpful response:
|
71 |
Include relevant details about university policies.
|
72 |
If unsure, direct to official channels.
|
|
|
73 |
Question: {user_input}
|
|
|
74 |
Official Answer:"""
|
75 |
|
76 |
llm_response = query_groq_llm(prompt)
|
|
|
89 |
π ue.edu.pk"""
|
90 |
|
91 |
return response
|
|