jonathanjordan21 commited on
Commit
633923e
·
verified ·
1 Parent(s): 1663925

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -22,7 +22,7 @@ app.add_middleware(
22
 
23
 
24
  @app.get("/google_search")
25
- async def google_search(q: str):
26
  url = f"https://www.google.com/search?q={q}"
27
  # if sites:
28
  # url += "&" + " OR ".join(["site:"+site for site in sites])
@@ -39,7 +39,7 @@ async def google_search(q: str):
39
  print(text)
40
  text = f'[{text}]({href["href"].split("/url?q=")[-1]})'
41
  if text != None and text.strip():
42
- texts += text + "\n---\n"
43
  return {"results":texts}
44
 
45
 
 
22
 
23
 
24
  @app.get("/google_search")
25
+ async def google_search(q: str, delimiter: str = "\n---\n", 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])
 
39
  print(text)
40
  text = f'[{text}]({href["href"].split("/url?q=")[-1]})'
41
  if text != None and text.strip():
42
+ texts += text + delimiter
43
  return {"results":texts}
44
 
45