Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,17 +125,22 @@ class MultiAgentRAG:
|
|
| 125 |
return rewritten_query.strip()
|
| 126 |
|
| 127 |
def generation_agent(self, query, retrieved_content):
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
return self.generate_response_with_timeout(input_ids)
|
| 140 |
|
| 141 |
def run_multi_agent_rag(self, query):
|
|
|
|
| 125 |
return rewritten_query.strip()
|
| 126 |
|
| 127 |
def generation_agent(self, query, retrieved_content):
|
| 128 |
+
conversation = [
|
| 129 |
+
{"role": "system", "content": "You are a knowledgeable assistant with access to a comprehensive database."},
|
| 130 |
+
{"role": "user", "content": f"""
|
| 131 |
+
I need you to answer my question and provide related information in a specific format.
|
| 132 |
+
I have provided five relatable json files {retrieved_content}, choose the most suitable chunks for answering the query.
|
| 133 |
+
RETURN ONLY SOLUTION without additional comments, sign-offs, retrived chunks, refrence to any Ticket or extra phrases. Be direct and to the point.
|
| 134 |
+
IF THERE IS NO ANSWER RELATABLE IN RETRIEVED CHUNKS, RETURN "NO SOLUTION AVAILABLE".
|
| 135 |
+
DO NOT GIVE REFRENCE TO ANY CHUNKS OR TICKETS,BE ON POINT.
|
| 136 |
+
|
| 137 |
+
Here's my question:
|
| 138 |
+
Query: {query}
|
| 139 |
+
Solution==>
|
| 140 |
+
"""}
|
| 141 |
+
]
|
| 142 |
+
|
| 143 |
+
input_ids = self.tokenizer.encode(self.tokenizer.apply_chat_template(conversation, tokenize=False), return_tensors="pt").to(self.model.device)
|
| 144 |
return self.generate_response_with_timeout(input_ids)
|
| 145 |
|
| 146 |
def run_multi_agent_rag(self, query):
|