Update app.py
Browse files
app.py
CHANGED
|
@@ -13,27 +13,49 @@ from Gradio_UI import GradioUI
|
|
| 13 |
@tool
|
| 14 |
def search_latest_ai_models(topic: str) -> str:
|
| 15 |
"""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
Args:
|
| 19 |
-
topic: The topic to search, e.g., "latest AI models June 2025"
|
| 20 |
|
|
|
|
|
|
|
| 21 |
Returns:
|
| 22 |
-
|
| 23 |
"""
|
| 24 |
search_tool = DuckDuckGoSearchTool()
|
| 25 |
results = search_tool(topic)
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
@tool
|
| 39 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 13 |
@tool
|
| 14 |
def search_latest_ai_models(topic: str) -> str:
|
| 15 |
"""
|
| 16 |
+
Searches for latest AI/GenAI model announcements using DuckDuckGo and returns results in tabular format.
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
Args:
|
| 19 |
+
topic: Topic to search (e.g., 'latest Generative AI models 2025')
|
| 20 |
Returns:
|
| 21 |
+
Markdown table summarizing AI model, company, and purpose.
|
| 22 |
"""
|
| 23 |
search_tool = DuckDuckGoSearchTool()
|
| 24 |
results = search_tool(topic)
|
| 25 |
|
| 26 |
+
# Process first 5 results only for simplicity
|
| 27 |
+
table_data = []
|
| 28 |
+
for item in results[:5]:
|
| 29 |
+
# Try to split headline to get a rough model and org
|
| 30 |
+
title = item.get("title", "")
|
| 31 |
+
link = item.get("link", "")
|
| 32 |
+
snippet = item.get("body", "")
|
| 33 |
+
|
| 34 |
+
model = title.split(" ")[0]
|
| 35 |
+
company = "Unknown"
|
| 36 |
+
if "Google" in snippet or "Google" in title:
|
| 37 |
+
company = "Google"
|
| 38 |
+
elif "OpenAI" in snippet or "OpenAI" in title:
|
| 39 |
+
company = "OpenAI"
|
| 40 |
+
elif "Anthropic" in snippet or "Anthropic" in title:
|
| 41 |
+
company = "Anthropic"
|
| 42 |
+
elif "Alibaba" in snippet or "Alibaba" in title:
|
| 43 |
+
company = "Alibaba"
|
| 44 |
+
|
| 45 |
+
table_data.append({
|
| 46 |
+
"Model": model,
|
| 47 |
+
"Company": company,
|
| 48 |
+
"Purpose": snippet[:100] + "..." if snippet else "N/A",
|
| 49 |
+
"Link": link
|
| 50 |
+
})
|
| 51 |
+
|
| 52 |
+
# Convert to markdown table
|
| 53 |
+
markdown = "| Model | Company | Purpose | Link |\n|-------|---------|---------|------|\n"
|
| 54 |
+
for row in table_data:
|
| 55 |
+
markdown += f"| {row['Model']} | {row['Company']} | {row['Purpose']} | [Link]({row['Link']}) |\n"
|
| 56 |
+
|
| 57 |
+
return markdown
|
| 58 |
+
|
| 59 |
|
| 60 |
@tool
|
| 61 |
def get_current_time_in_timezone(timezone: str) -> str:
|