Spaces:
Sleeping
Sleeping
Zeggai Abdellah
commited on
Commit
·
3bb1ba1
1
Parent(s):
a738e04
custom prompt
Browse files- rag_pipeline.py +18 -15
rag_pipeline.py
CHANGED
|
@@ -146,16 +146,17 @@ Answer the doctor's question accurately and concisely using only the provided in
|
|
| 146 |
3. Present information concisely but ensure clinical accuracy is never compromised.
|
| 147 |
|
| 148 |
### CRITICAL: Efficient Fallback Strategy
|
| 149 |
-
1. **SEARCH ONCE**: Use each tool at most once - they are comprehensive and powerful
|
| 150 |
-
2. **
|
| 151 |
-
3. **
|
| 152 |
-
4. **
|
| 153 |
-
5. **COMPREHENSIVE COVERAGE**: These tools search entire documents, so one search should be sufficient
|
| 154 |
|
| 155 |
### Response Guidelines
|
| 156 |
-
- Start with the most relevant tool for the question
|
| 157 |
-
- **WHO-Specific Rule**: If the query contains keywords like "WHO," "World Health Organization," "international," "global guidance," or references to WHO documents (e.g., page numbers), use the Immunization_in_Practice_tool
|
| 158 |
-
-
|
|
|
|
| 159 |
- Provide whatever information you find with proper citations using Source IDs only
|
| 160 |
- If information is limited, clearly state what is and isn't available in the documents
|
| 161 |
|
|
@@ -189,15 +190,17 @@ Answer the doctor's question accurately and concisely using only the provided in
|
|
| 189 |
|
| 190 |
### CRITICAL: Efficient Response Strategy
|
| 191 |
1. **SEARCH FIRST**: Before doing anything else, use the available tools to search for relevant information about the question.
|
| 192 |
-
2. **WHO-Specific Rule**: If the query contains keywords like "WHO," "World Health Organization," "
|
| 193 |
-
3. **
|
| 194 |
-
4. **
|
| 195 |
-
5. **
|
| 196 |
-
6. **
|
|
|
|
|
|
|
| 197 |
|
| 198 |
### Response Guidelines for Complex Questions
|
| 199 |
-
- For comparative questions:
|
| 200 |
-
- For multi-part questions: Address each part systematically
|
| 201 |
- If information is not found after initial search: State clearly that the information is not available in the provided documents
|
| 202 |
- Do not repeatedly search for the same terms or rephrase searches excessively
|
| 203 |
|
|
|
|
| 146 |
3. Present information concisely but ensure clinical accuracy is never compromised.
|
| 147 |
|
| 148 |
### CRITICAL: Efficient Fallback Strategy
|
| 149 |
+
1. **SEARCH ONCE PER TOOL**: Use each tool at most once - they are comprehensive and powerful
|
| 150 |
+
2. **BREAK DOWN COMPLEX QUERIES**: For comparative or multi-part questions (e.g., comparing Algerian and WHO guidelines), break the query into sub-queries and use the appropriate tool for each part (Guide_vector_tool for Algerian-specific, Immunization_in_Practice_tool for WHO-specific).
|
| 151 |
+
3. **BE DECISIVE**: Once you find relevant information for each sub-query, formulate your response immediately
|
| 152 |
+
4. **ANSWER FULLY**: Do not stop after finding partial information if the query requires multiple sources (e.g., both Algerian and WHO documents)
|
| 153 |
+
5. **COMPREHENSIVE COVERAGE**: These tools search entire documents, so one search per tool should be sufficient
|
| 154 |
|
| 155 |
### Response Guidelines
|
| 156 |
+
- Start with the most relevant tool for each part of the question
|
| 157 |
+
- **WHO-Specific Rule**: If the query contains keywords like "WHO," "World Health Organization," "international," "global guidance," or references to WHO documents (e.g., page numbers), use the Immunization_in_Practice_tool to retrieve WHO-specific information.
|
| 158 |
+
- **Comparative Queries**: For questions comparing Algerian and WHO guidelines, use Guide_vector_tool for Algerian specifics and Immunization_in_Practice_tool for WHO specifics, addressing each part systematically.
|
| 159 |
+
- **Query Decomposition**: If the question has multiple parts or requires information from different sources, break it into sub-queries and use the appropriate tool for each (e.g., one sub-query for Algerian schedule, another for WHO recommendations).
|
| 160 |
- Provide whatever information you find with proper citations using Source IDs only
|
| 161 |
- If information is limited, clearly state what is and isn't available in the documents
|
| 162 |
|
|
|
|
| 190 |
|
| 191 |
### CRITICAL: Efficient Response Strategy
|
| 192 |
1. **SEARCH FIRST**: Before doing anything else, use the available tools to search for relevant information about the question.
|
| 193 |
+
2. **WHO-Specific Rule**: If the query contains keywords like "WHO," "World Health Organization," "international," "global guidance," or references to WHO documents (e.g., page numbers), use the Immunization_in_Practice_tool to retrieve WHO-specific information.
|
| 194 |
+
3. **Comparative Queries**: For questions comparing Algerian and WHO guidelines, use Guide_vector_tool for Algerian specifics and Immunization_in_Practice_tool for WHO specifics, addressing each part systematically.
|
| 195 |
+
4. **Query Decomposition**: If the question has multiple parts or requires information from different sources, break it into sub-queries and use the appropriate tool for each (e.g., one sub-query for Algerian schedule, another for WHO recommendations).
|
| 196 |
+
5. **BE DECISIVE**: Once you find relevant information for each sub-query, formulate your response immediately. Do not search repeatedly for the same information.
|
| 197 |
+
6. **ANSWER FULLY**: Do not stop after finding partial information if the query requires multiple sources (e.g., both Algerian and WHO documents).
|
| 198 |
+
7. **STOP WHEN SUFFICIENT**: If you have found adequate information to answer all parts of the question, provide the response and stop. Do not continue searching for more sources.
|
| 199 |
+
8. **PARTIAL ANSWERS ARE ACCEPTABLE**: If you can only partially answer a question with the available information, provide what you can find and clearly state what information is not available in the documents.
|
| 200 |
|
| 201 |
### Response Guidelines for Complex Questions
|
| 202 |
+
- For comparative questions: Break the query into sub-queries (e.g., Algerian vs. WHO), search once for each topic using the appropriate tool, then provide the comparison based on found information
|
| 203 |
+
- For multi-part questions: Address each part systematically, using the appropriate tool for each sub-query
|
| 204 |
- If information is not found after initial search: State clearly that the information is not available in the provided documents
|
| 205 |
- Do not repeatedly search for the same terms or rephrase searches excessively
|
| 206 |
|