Spaces:
Sleeping
Sleeping
jesusgj
commited on
Commit
·
80ef074
1
Parent(s):
9a1c771
Modified files
Browse files
agent.py
CHANGED
|
@@ -167,7 +167,7 @@ def initialize_agent():
|
|
| 167 |
To achieve the best results, follow these steps:
|
| 168 |
1. **Understand the Question:** Carefully read and analyze the user's question to identify the core task and any specific constraints (e.g., format, type of answer).
|
| 169 |
2. **Formulate a Plan:** Based on the question, devise a step-by-step plan. This might involve using web search, querying webpages, or analyzing YouTube videos. Consider what information is needed and which tool is best suited to obtain it.
|
| 170 |
-
3. **Execute Tools:**
|
| 171 |
4. **Synthesize Information:** Combine and process the information obtained from the tools to formulate a comprehensive answer. If the question requires specific data extraction, ensure accuracy.
|
| 172 |
5. **Format the Final Answer:** Adhere strictly to the specified FINAL ANSWER template. Ensure the answer type (number, string, comma-separated list) matches the question's requirement.
|
| 173 |
6. **Self-Correction:** If initial attempts fail or produce unsatisfactory results, re-evaluate the plan and try alternative approaches or tools.'''
|
|
|
|
| 167 |
To achieve the best results, follow these steps:
|
| 168 |
1. **Understand the Question:** Carefully read and analyze the user's question to identify the core task and any specific constraints (e.g., format, type of answer).
|
| 169 |
2. **Formulate a Plan:** Based on the question, devise a step-by-step plan. This might involve using web search, querying webpages, or analyzing YouTube videos. Consider what information is needed and which tool is best suited to obtain it.
|
| 170 |
+
3. **Execute Tools:** Prioritize using `WebSearchTool()` for general web searches. If `WebSearchTool()` fails, or if more specific, structured search results are required (e.g., for AI overviews or specific data points), then use `google_search` (SerpApi). Use `query_webpage` for detailed information extraction from specific URLs and `query_youtube_video` for YouTube transcript analysis. Be mindful of rate limits and use caching effectively.
|
| 171 |
4. **Synthesize Information:** Combine and process the information obtained from the tools to formulate a comprehensive answer. If the question requires specific data extraction, ensure accuracy.
|
| 172 |
5. **Format the Final Answer:** Adhere strictly to the specified FINAL ANSWER template. Ensure the answer type (number, string, comma-separated list) matches the question's requirement.
|
| 173 |
6. **Self-Correction:** If initial attempts fail or produce unsatisfactory results, re-evaluate the plan and try alternative approaches or tools.'''
|