Skip to content

Commit 902ac4a

Browse files
committed
Add extra bing params
1 parent e68619b commit 902ac4a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/backend/bing_client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,15 @@ def __init__(self, api_key: str, bing_endpoint: Optional[str] = "api.bing.micros
4646
# "X-Search-Location": "" # this would be useful in future
4747
}
4848

49-
async def search(self, query: str) -> WebAnswer:
50-
params: dict[str, Union[str,bool]] = {
49+
async def search(self, query: str, lang="en-US") -> WebAnswer:
50+
params: dict[str, Union[str, bool, int]] = {
5151
"q": query,
52+
"mkt": lang,
5253
"textDecorations": True,
5354
"textFormat": "HTML",
55+
"responseFilter": "Webpages",
56+
"safeSearch": "Strict",
57+
"setLang": lang,
5458
}
5559
async with httpx.AsyncClient() as client:
5660
response = await client.get(self.base_url, headers=self.headers, params=params)

0 commit comments

Comments
 (0)