THEZYZSTUDIO commited on
Commit
ca18acf
·
verified ·
1 Parent(s): 67b74ff

Delete search_engine.py

Browse files
Files changed (1) hide show
  1. search_engine.py +0 -12
search_engine.py DELETED
@@ -1,12 +0,0 @@
1
- from duckduckgo_search import DDGS
2
-
3
- def search_web(query: str, max_results: int = 5) -> str:
4
- try:
5
- with DDGS() as ddgs:
6
- results = list(ddgs.text(query, max_results=max_results))
7
- if not results:
8
- return "لا توجد نتائج بحث."
9
- formatted = "\n".join([f"- {r['title']}: {r['href']}\n {r['body']}" for r in results])
10
- return f"🔍 نتائج البحث لـ '{query}':\n{formatted}"
11
- except Exception as e:
12
- return f"خطأ في البحث: {str(e)}"