Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from typing import Annotated
|
2 |
|
3 |
from fastapi import FastAPI, Header
|
4 |
|
@@ -22,7 +22,7 @@ app.add_middleware(
|
|
22 |
|
23 |
|
24 |
@app.get("/google_search")
|
25 |
-
async def google_search(q: str, sites: list):
|
26 |
url = f"https://www.google.com/search?q={q}"
|
27 |
if sites:
|
28 |
url += "&" + " OR ".join(["site:"+site for site in sites])
|
|
|
1 |
+
from typing import Annotated Optional
|
2 |
|
3 |
from fastapi import FastAPI, Header
|
4 |
|
|
|
22 |
|
23 |
|
24 |
@app.get("/google_search")
|
25 |
+
async def google_search(q: str, sites: Optional[list]=None):
|
26 |
url = f"https://www.google.com/search?q={q}"
|
27 |
if sites:
|
28 |
url += "&" + " OR ".join(["site:"+site for site in sites])
|