Update app.py
Browse filesadding in DuckDuckGo search tool
app.py
CHANGED
@@ -43,6 +43,14 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
43 |
except Exception as e:
|
44 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
# Initialize components
|
47 |
final_answer = FinalAnswerTool()
|
48 |
|
|
|
43 |
except Exception as e:
|
44 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
45 |
|
46 |
+
def initialize_agent():
|
47 |
+
"""Initialize and return the CodeAgent with all tools."""
|
48 |
+
|
49 |
+
# Initialize tools
|
50 |
+
final_answer = FinalAnswerTool()
|
51 |
+
web_search = DuckDuckGoSearchTool(max_results=5) # Initialize DDG search with 5 results
|
52 |
+
|
53 |
+
|
54 |
# Initialize components
|
55 |
final_answer = FinalAnswerTool()
|
56 |
|